diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/CHANGELOG.md b/sdk/appcontainers/azure-resourcemanager-appcontainers/CHANGELOG.md index 40903a947a78f..c3057eae27f9e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/CHANGELOG.md +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/CHANGELOG.md @@ -1,14 +1,649 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-09-18) -### Features Added +- Azure Resource Manager ContainerAppsApi client library for Java. This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. Functions is an extension resource to revisions and the api listed is used to proxy the call from Web RP to the function app's host process, this api is not exposed to users and only Web RP is allowed to invoke functions extension resource. Package tag package-preview-2024-08. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.ContainerAppsSourceControls` was modified + +* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `delete(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.Jobs` was modified + +* `proxyGetWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `proxyGet(java.lang.String,java.lang.String,java.lang.String)` was removed + +#### `models.BillingMeter` was modified + +* `systemData()` was removed + +### Features Added + +* `models.SessionContainer` was added + +* `models.ContainerAppsBuilds` was added + +* `models.DotNetComponent$UpdateStages` was added + +* `models.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration` was added + +* `models.HttpConnectionPool` was added + +* `models.LogicApp$Definition` was added + +* `models.Runtime` was added + +* `models.SessionPoolUpdatableProperties` was added + +* `models.LoggerSetting` was added + +* `models.JavaComponentPropertiesScale` was added + +* `models.BuildResource$UpdateStages` was added + +* `models.ScaleConfiguration` was added + +* `models.ManagedEnvironmentPrivateEndpointConnections` was added + +* `models.DotNetComponents` was added + +* `models.RuntimeJavaAgentLogging` was added + +* `models.BuildProvisioningState` was added + +* `models.WorkflowState` was added + +* `models.PrivateEndpointConnectionListResult` was added + +* `models.AppResiliency` was added + +* `models.DaprSubscriptions` was added + +* `models.BuilderResource$Update` was added + +* `models.BuildConfiguration` was added + +* `models.PoolManagementType` was added + +* `models.PatchType` was added + +* `models.BuildResource$Update` was added + +* `models.SmbStorage` was added + +* `models.CertificateKeyVaultProperties` was added + +* `models.IdentitySettingsLifeCycle` was added + +* `models.EnvironmentVariable` was added + +* `models.SessionPoolProvisioningState` was added + +* `models.DotNetComponentServiceBind` was added + +* `models.SpringBootAdminComponent` was added + +* `models.AppResiliencies` was added + +* `models.PrivateEndpoint` was added + +* `models.PatchDetailsOldLayer` was added + +* `models.JavaComponentServiceBind` was added + +* `models.LogsConfiguration` was added + +* `models.DotNetComponent$Update` was added + +* `models.PatchApplyStatus` was added + +* `models.DaprSubscription$UpdateStages` was added + +* `models.DotNetComponent$DefinitionStages` was added + +* `models.HttpGet` was added + +* `models.ContainerAppsPatches` was added + +* `models.LogicApps` was added + +* `models.PrivateEndpointConnection$Definition` was added + +* `models.SessionPool$UpdateStages` was added + +* `models.JavaComponentConfigurationProperty` was added + +* `models.DotNetComponentProvisioningState` was added + +* `models.DotNetComponentType` was added + +* `models.SpringCloudConfigComponent` was added + +* `models.PrivateEndpointConnection` was added + +* `models.BuilderResourceUpdate` was added + +* `models.FunctionsExtensions` was added + +* `models.SessionPool$Definition` was added + +* `models.AppResiliency$DefinitionStages` was added + +* `models.DaprComponentResiliencyPoliciesCollection` was added + +* `models.ImageType` was added + +* `models.BuildAuthTokens` was added + +* `models.PatchCollection` was added + +* `models.ContainerRegistry` was added + +* `models.IngressTargetPortHttpScheme` was added + +* `models.AppResiliency$Definition` was added + +* `models.DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration` was added + +* `models.WorkflowEnvelopeProperties` was added + +* `models.WorkflowHealthState` was added + +* `models.ContainerAppsPatchResource` was added + +* `models.DaprSubscription$DefinitionStages` was added + +* `models.OtlpConfiguration` was added + +* `models.MetricsConfiguration` was added + +* `models.DaprServiceBindMetadata` was added + +* `models.ScgRoute` was added + +* `models.TracesConfiguration` was added + +* `models.DaprSubscriptionBulkSubscribeOptions` was added + +* `models.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration` was added + +* `models.JavaComponent$Definition` was added + +* `models.SessionPool$DefinitionStages` was added + +* `models.PrivateEndpointServiceConnectionStatus` was added + +* `models.SessionIngress` was added + +* `models.BuildsByBuilderResources` was added + +* `models.BuildResource` was added + +* `models.ContainerAppsBuildConfiguration` was added + +* `models.WorkflowEnvelopeCollection` was added + +* `models.TimeoutPolicy` was added + +* `models.PrivateEndpointConnection$Update` was added + +* `models.DotNetComponentConfigurationProperty` was added + +* `models.ContainerAppsBuildCollection` was added + +* `models.DaprSubscriptionsCollection` was added + +* `models.ErrorEntity` was added + +* `models.LogicApp$UpdateStages` was added + +* `models.PrivateLinkServiceConnectionState` was added + +* `models.AppInsightsConfiguration` was added + +* `models.WorkflowHealth` was added + +* `models.DaprSubscriptionRoutes` was added + +* `models.DaprComponentResiliencyPolicy$Definition` was added + +* `models.PatchProperties` was added + +* `models.HttpRetryPolicy` was added + +* `models.PatchDetails` was added + +* `models.PrivateEndpointConnectionProvisioningState` was added + +* `models.SessionPool` was added + +* `models.NfsAzureFileProperties` was added + +* `models.PrivateLinkResource` was added + +* `models.CircuitBreakerPolicy` was added + +* `models.DaprComponentResiliencyPolicy$DefinitionStages` was added + +* `models.SessionContainerResources` was added + +* `models.TcpRetryPolicy` was added + +* `models.SessionPoolSecret` was added + +* `models.PatchSkipConfig` was added + +* `models.DaprComponentResiliencyPolicies` was added + +* `models.HeaderMatch` was added + +* `models.AppResiliencyCollection` was added + +* `models.DotNetComponent` was added + +* `models.BuilderCollection` was added + +* `models.BuildStatus` was added + +* `models.DaprSubscription` was added + +* `models.SessionPool$Update` was added + +* `models.DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration` was added + +* `models.BuildToken` was added + +* `models.DaprComponentResiliencyPolicyConfiguration` was added + +* `models.WorkflowEnvelope` was added + +* `models.BuilderResource$DefinitionStages` was added + +* `models.JavaComponentsCollection` was added + +* `models.OpenTelemetryConfiguration` was added + +* `models.PrivateLinkResourceListResult` was added -### Other Changes +* `models.Builders` was added + +* `models.Level` was added + +* `models.DaprComponentResiliencyPolicy$Update` was added + +* `models.BuildResource$DefinitionStages` was added + +* `models.JavaComponent` was added + +* `models.AppResiliency$Update` was added + +* `models.SessionNetworkStatus` was added + +* `models.LogicAppsProxyMethod` was added + +* `models.DaprSubscription$Update` was added + +* `models.DestinationsConfiguration` was added + +* `models.CertificateType` was added + +* `models.DataDogConfiguration` was added + +* `models.DotNetComponentsCollection` was added + +* `models.ManagedEnvironmentPrivateLinkResources` was added + +* `models.RuntimeJava` was added + +* `models.DotNetComponent$Definition` was added + +* `models.DaprComponentResiliencyPolicy$UpdateStages` was added + +* `models.BuildCollection` was added + +* `models.ExecutionType` was added + +* `models.JavaComponent$UpdateStages` was added + +* `models.LogicApp` was added + +* `models.JavaComponentProvisioningState` was added + +* `models.PatchDetailsNewLayer` was added + +* `models.DetectionStatus` was added + +* `models.ReplicaExecutionStatus` was added + +* `models.PreBuildStep` was added + +* `models.ContainerExecutionStatus` was added + +* `models.DaprComponentServiceBinding` was added + +* `models.ContainerAppsBuildsByContainerApps` was added + +* `models.CustomContainerTemplate` was added + +* `models.WorkflowArtifacts` was added + +* `models.SessionNetworkConfiguration` was added + +* `models.BuilderResource$UpdateStages` was added + +* `models.RuntimeJavaAgent` was added + +* `models.DynamicPoolConfiguration` was added + +* `models.PatchingMode` was added + +* `models.ContainerAppsBuildResource` was added + +* `models.PrivateEndpointConnection$UpdateStages` was added + +* `models.IdentitySettings` was added + +* `models.JavaComponent$DefinitionStages` was added + +* `models.ExecutionStatus` was added + +* `models.DaprComponentResiliencyPolicy` was added + +* `models.JobRunningState` was added + +* `models.ContainerRegistryWithCustomImage` was added + +* `models.ContainerType` was added + +* `models.SessionRegistryCredentials` was added + +* `models.JavaComponentType` was added + +* `models.RuntimeDotnet` was added + +* `models.AppResiliency$UpdateStages` was added + +* `models.JavaComponentProperties` was added + +* `models.BuilderResource` was added + +* `models.SpringCloudGatewayComponent` was added + +* `models.BuildResource$Definition` was added + +* `models.Kind` was added + +* `models.Builds` was added + +* `models.ContainerAppsSessionPools` was added + +* `models.SessionPoolCollection` was added + +* `models.ContainerAppPropertiesPatchingConfiguration` was added + +* `models.BuilderResource$Definition` was added + +* `models.LogicApp$Update` was added + +* `models.NacosComponent` was added + +* `models.LogicApp$DefinitionStages` was added + +* `models.JavaComponent$Update` was added + +* `models.JavaComponentIngress` was added + +* `models.Header` was added + +* `models.TcpConnectionPool` was added + +* `models.PublicNetworkAccess` was added + +* `models.JavaComponents` was added + +* `models.DaprSubscriptionRouteRule` was added + +* `models.DaprSubscription$Definition` was added + +* `models.PrivateEndpointConnection$DefinitionStages` was added + +* `models.BuilderProvisioningState` was added + +* `models.SpringCloudEurekaComponent` was added + +#### `models.ContainerAppsSourceControls` was modified + +* `delete(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.Boolean,java.lang.Boolean,com.azure.core.util.Context)` was added +* `deleteByIdWithResponse(java.lang.String,java.lang.String,java.lang.Boolean,java.lang.Boolean,com.azure.core.util.Context)` was added + +#### `models.ServiceBind` was modified + +* `withClientType(java.lang.String)` was added +* `clientType()` was added +* `customizedKeys()` was added +* `withCustomizedKeys(java.util.Map)` was added + +#### `models.Job` was modified + +* `suspend(com.azure.core.util.Context)` was added +* `resume(com.azure.core.util.Context)` was added +* `extendedLocation()` was added +* `suspend()` was added +* `resume()` was added +* `runningState()` was added + +#### `models.DaprComponent$Definition` was modified + +* `withServiceComponentBind(java.util.List)` was added + +#### `models.ManagedEnvironment$Update` was modified + +* `withPublicNetworkAccess(models.PublicNetworkAccess)` was added +* `withOpenTelemetryConfiguration(models.OpenTelemetryConfiguration)` was added +* `withAppInsightsConfiguration(models.AppInsightsConfiguration)` was added +* `withIdentity(models.ManagedServiceIdentity)` was added + +#### `models.SourceControl$Definition` was modified + +* `withXMsGithubAuxiliary(java.lang.String)` was added + +#### `models.WorkloadProfile` was modified + +* `withEnableFips(java.lang.Boolean)` was added +* `enableFips()` was added + +#### `models.InitContainer` was modified + +* `withImageType(models.ImageType)` was added + +#### `models.Job$Definition` was modified + +* `withExtendedLocation(models.ExtendedLocation)` was added + +#### `models.QueueScaleRule` was modified + +* `withAccountName(java.lang.String)` was added +* `identity()` was added +* `withIdentity(java.lang.String)` was added +* `accountName()` was added + +#### `models.Jobs` was modified + +* `suspend(java.lang.String,java.lang.String)` was added +* `resume(java.lang.String,java.lang.String)` was added +* `proxyGetWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `proxyGet(java.lang.String,java.lang.String)` was added +* `suspend(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `resume(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `models.ConnectedEnvironmentStorageProperties` was modified + +* `smb()` was added +* `withSmb(models.SmbStorage)` was added + +#### `models.DaprComponent$Update` was modified + +* `withServiceComponentBind(java.util.List)` was added + +#### `models.ManagedEnvironment$Definition` was modified + +* `withPublicNetworkAccess(models.PublicNetworkAccess)` was added +* `withAppInsightsConfiguration(models.AppInsightsConfiguration)` was added +* `withIdentity(models.ManagedServiceIdentity)` was added +* `withOpenTelemetryConfiguration(models.OpenTelemetryConfiguration)` was added + +#### `models.ContainerApp$Update` was modified + +* `withPatchingConfiguration(models.ContainerAppPropertiesPatchingConfiguration)` was added + +#### `models.ManagedEnvironmentStorageProperties` was modified + +* `withNfsAzureFile(models.NfsAzureFileProperties)` was added +* `nfsAzureFile()` was added + +#### `models.GithubActionConfiguration` was modified + +* `buildEnvironmentVariables()` was added +* `withBuildEnvironmentVariables(java.util.List)` was added +* `withDockerfilePath(java.lang.String)` was added +* `dockerfilePath()` was added + +#### `models.DaprComponent` was modified + +* `serviceComponentBind()` was added + +#### `models.JobConfiguration` was modified + +* `identitySettings()` was added +* `withIdentitySettings(java.util.List)` was added + +#### `models.TcpScaleRule` was modified + +* `identity()` was added +* `withIdentity(java.lang.String)` was added + +#### `models.Scale` was modified + +* `withCooldownPeriod(java.lang.Integer)` was added +* `withPollingInterval(java.lang.Integer)` was added +* `cooldownPeriod()` was added +* `pollingInterval()` was added + +#### `models.SourceControl$Update` was modified + +* `withXMsGithubAuxiliary(java.lang.String)` was added + +#### `models.LogAnalyticsConfiguration` was modified + +* `withDynamicJsonColumns(java.lang.Boolean)` was added +* `dynamicJsonColumns()` was added + +#### `models.Job$Update` was modified + +* `withExtendedLocation(models.ExtendedLocation)` was added + +#### `models.ManagedEnvironment` was modified + +* `identity()` was added +* `openTelemetryConfiguration()` was added +* `appInsightsConfiguration()` was added +* `publicNetworkAccess()` was added +* `privateEndpointConnections()` was added + +#### `models.HttpScaleRule` was modified + +* `identity()` was added +* `withIdentity(java.lang.String)` was added + +#### `models.JobExecution` was modified + +* `detailedStatus()` was added + +#### `models.JobPatchProperties` was modified + +* `withExtendedLocation(models.ExtendedLocation)` was added +* `extendedLocation()` was added + +#### `models.Container` was modified + +* `withImageType(models.ImageType)` was added + +#### `models.CertificateProperties` was modified + +* `certificateKeyVaultProperties()` was added +* `withCertificateKeyVaultProperties(models.CertificateKeyVaultProperties)` was added +* `withCertificateType(models.CertificateType)` was added +* `certificateType()` was added + +#### `models.ContainerApp` was modified + +* `patchingConfiguration()` was added +* `deploymentErrors()` was added +* `kind()` was added + +#### `models.JobScaleRule` was modified + +* `withIdentity(java.lang.String)` was added +* `identity()` was added + +#### `ContainerAppsApiManager` was modified + +* `dotNetComponents()` was added +* `logicApps()` was added +* `managedEnvironmentPrivateLinkResources()` was added +* `containerAppsPatches()` was added +* `functionsExtensions()` was added +* `containerAppsSessionPools()` was added +* `builds()` was added +* `daprComponentResiliencyPolicies()` was added +* `daprSubscriptions()` was added +* `appResiliencies()` was added +* `containerAppsBuildsByContainerApps()` was added +* `containerAppsBuilds()` was added +* `managedEnvironmentPrivateEndpointConnections()` was added +* `buildAuthTokens()` was added +* `javaComponents()` was added +* `buildsByBuilderResources()` was added +* `builders()` was added + +#### `models.ReplicaContainer` was modified + +* `debugEndpoint()` was added + +#### `models.BaseContainer` was modified + +* `imageType()` was added +* `withImageType(models.ImageType)` was added + +#### `models.CustomScaleRule` was modified + +* `identity()` was added +* `withIdentity(java.lang.String)` was added + +#### `models.ContainerApp$Definition` was modified + +* `withKind(models.Kind)` was added +* `withPatchingConfiguration(models.ContainerAppPropertiesPatchingConfiguration)` was added + +#### `models.Ingress` was modified + +* `targetPortHttpScheme()` was added +* `withTargetPortHttpScheme(models.IngressTargetPortHttpScheme)` was added + +#### `models.CustomDomainConfiguration` was modified + +* `withCertificateKeyVaultProperties(models.CertificateKeyVaultProperties)` was added +* `certificateKeyVaultProperties()` was added + +#### `models.Configuration` was modified + +* `identitySettings()` was added +* `withRuntime(models.Runtime)` was added +* `withIdentitySettings(java.util.List)` was added +* `runtime()` was added ## 1.0.0 (2024-08-07) diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/README.md b/sdk/appcontainers/azure-resourcemanager-appcontainers/README.md index 95f400479497e..9d05f22b61283 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/README.md +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/README.md @@ -2,7 +2,7 @@ Azure Resource Manager ContainerAppsApi client library for Java. -This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. Package tag package-2024-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. Functions is an extension resource to revisions and the api listed is used to proxy the call from Web RP to the function app's host process, this api is not exposed to users and only Web RP is allowed to invoke functions extension resource. Package tag package-preview-2024-08. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-appcontainers - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/SAMPLE.md b/sdk/appcontainers/azure-resourcemanager-appcontainers/SAMPLE.md index 16d11dbaacae3..243232cd094ea 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/SAMPLE.md +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/SAMPLE.md @@ -1,6 +1,14 @@ # Code snippets and samples +## AppResiliency + +- [CreateOrUpdate](#appresiliency_createorupdate) +- [Delete](#appresiliency_delete) +- [Get](#appresiliency_get) +- [List](#appresiliency_list) +- [Update](#appresiliency_update) + ## AvailableWorkloadProfiles - [Get](#availableworkloadprofiles_get) @@ -9,6 +17,29 @@ - [Get](#billingmeters_get) +## BuildAuthToken + +- [List](#buildauthtoken_list) + +## Builders + +- [CreateOrUpdate](#builders_createorupdate) +- [Delete](#builders_delete) +- [GetByResourceGroup](#builders_getbyresourcegroup) +- [List](#builders_list) +- [ListByResourceGroup](#builders_listbyresourcegroup) +- [Update](#builders_update) + +## Builds + +- [CreateOrUpdate](#builds_createorupdate) +- [Delete](#builds_delete) +- [Get](#builds_get) + +## BuildsByBuilderResource + +- [List](#buildsbybuilderresource_list) + ## Certificates - [CreateOrUpdate](#certificates_createorupdate) @@ -71,6 +102,15 @@ - [Get](#containerappsauthconfigs_get) - [ListByContainerApp](#containerappsauthconfigs_listbycontainerapp) +## ContainerAppsBuilds + +- [Delete](#containerappsbuilds_delete) +- [Get](#containerappsbuilds_get) + +## ContainerAppsBuildsByContainerApp + +- [List](#containerappsbuildsbycontainerapp_list) + ## ContainerAppsDiagnostics - [GetDetector](#containerappsdiagnostics_getdetector) @@ -79,6 +119,14 @@ - [ListDetectors](#containerappsdiagnostics_listdetectors) - [ListRevisions](#containerappsdiagnostics_listrevisions) +## ContainerAppsPatches + +- [Apply](#containerappspatches_apply) +- [Delete](#containerappspatches_delete) +- [Get](#containerappspatches_get) +- [ListByContainerApp](#containerappspatches_listbycontainerapp) +- [SkipConfigure](#containerappspatches_skipconfigure) + ## ContainerAppsRevisionReplicas - [GetReplica](#containerappsrevisionreplicas_getreplica) @@ -92,6 +140,15 @@ - [ListRevisions](#containerappsrevisions_listrevisions) - [RestartRevision](#containerappsrevisions_restartrevision) +## ContainerAppsSessionPools + +- [CreateOrUpdate](#containerappssessionpools_createorupdate) +- [Delete](#containerappssessionpools_delete) +- [GetByResourceGroup](#containerappssessionpools_getbyresourcegroup) +- [List](#containerappssessionpools_list) +- [ListByResourceGroup](#containerappssessionpools_listbyresourcegroup) +- [Update](#containerappssessionpools_update) + ## ContainerAppsSourceControls - [CreateOrUpdate](#containerappssourcecontrols_createorupdate) @@ -99,6 +156,13 @@ - [Get](#containerappssourcecontrols_get) - [ListByContainerApp](#containerappssourcecontrols_listbycontainerapp) +## DaprComponentResiliencyPolicies + +- [CreateOrUpdate](#daprcomponentresiliencypolicies_createorupdate) +- [Delete](#daprcomponentresiliencypolicies_delete) +- [Get](#daprcomponentresiliencypolicies_get) +- [List](#daprcomponentresiliencypolicies_list) + ## DaprComponents - [CreateOrUpdate](#daprcomponents_createorupdate) @@ -107,6 +171,33 @@ - [List](#daprcomponents_list) - [ListSecrets](#daprcomponents_listsecrets) +## DaprSubscriptions + +- [CreateOrUpdate](#daprsubscriptions_createorupdate) +- [Delete](#daprsubscriptions_delete) +- [Get](#daprsubscriptions_get) +- [List](#daprsubscriptions_list) + +## DotNetComponents + +- [CreateOrUpdate](#dotnetcomponents_createorupdate) +- [Delete](#dotnetcomponents_delete) +- [Get](#dotnetcomponents_get) +- [List](#dotnetcomponents_list) +- [Update](#dotnetcomponents_update) + +## FunctionsExtension + +- [InvokeFunctionsHost](#functionsextension_invokefunctionshost) + +## JavaComponents + +- [CreateOrUpdate](#javacomponents_createorupdate) +- [Delete](#javacomponents_delete) +- [Get](#javacomponents_get) +- [List](#javacomponents_list) +- [Update](#javacomponents_update) + ## Jobs - [CreateOrUpdate](#jobs_createorupdate) @@ -118,15 +209,28 @@ - [ListDetectors](#jobs_listdetectors) - [ListSecrets](#jobs_listsecrets) - [ProxyGet](#jobs_proxyget) +- [Resume](#jobs_resume) - [Start](#jobs_start) - [StopExecution](#jobs_stopexecution) - [StopMultipleExecutions](#jobs_stopmultipleexecutions) +- [Suspend](#jobs_suspend) - [Update](#jobs_update) ## JobsExecutions - [List](#jobsexecutions_list) +## LogicApps + +- [CreateOrUpdate](#logicapps_createorupdate) +- [Delete](#logicapps_delete) +- [DeployWorkflowArtifacts](#logicapps_deployworkflowartifacts) +- [Get](#logicapps_get) +- [GetWorkflow](#logicapps_getworkflow) +- [Invoke](#logicapps_invoke) +- [ListWorkflows](#logicapps_listworkflows) +- [ListWorkflowsConnections](#logicapps_listworkflowsconnections) + ## ManagedCertificates - [CreateOrUpdate](#managedcertificates_createorupdate) @@ -140,6 +244,17 @@ - [GetDetector](#managedenvironmentdiagnostics_getdetector) - [ListDetectors](#managedenvironmentdiagnostics_listdetectors) +## ManagedEnvironmentPrivateEndpointConnections + +- [CreateOrUpdate](#managedenvironmentprivateendpointconnections_createorupdate) +- [Delete](#managedenvironmentprivateendpointconnections_delete) +- [Get](#managedenvironmentprivateendpointconnections_get) +- [List](#managedenvironmentprivateendpointconnections_list) + +## ManagedEnvironmentPrivateLinkResources + +- [List](#managedenvironmentprivatelinkresources_list) + ## ManagedEnvironmentUsages - [List](#managedenvironmentusages_list) @@ -182,178 +297,269 @@ ## Usages - [List](#usages_list) -### AvailableWorkloadProfiles_Get +### AppResiliency_CreateOrUpdate ```java +import com.azure.resourcemanager.appcontainers.models.CircuitBreakerPolicy; +import com.azure.resourcemanager.appcontainers.models.HeaderMatch; +import com.azure.resourcemanager.appcontainers.models.HttpConnectionPool; +import com.azure.resourcemanager.appcontainers.models.HttpRetryPolicy; +import com.azure.resourcemanager.appcontainers.models.TcpConnectionPool; +import com.azure.resourcemanager.appcontainers.models.TcpRetryPolicy; +import com.azure.resourcemanager.appcontainers.models.TimeoutPolicy; +import java.util.Arrays; + /** - * Samples for AvailableWorkloadProfiles Get. + * Samples for AppResiliency CreateOrUpdate. */ -public final class AvailableWorkloadProfilesGetSamples { +public final class AppResiliencyCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/AvailableWorkloadProfiles_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AppResiliency_CreateOrUpdate + * .json */ /** - * Sample code: BillingMeters_Get. + * Sample code: Create or Update App Resiliency. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void billingMetersGet(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.availableWorkloadProfiles().get("East US", com.azure.core.util.Context.NONE); + public static void + createOrUpdateAppResiliency(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.appResiliencies() + .define("resiliency-policy-1") + .withExistingContainerApp("rg", "testcontainerApp0") + .withTimeoutPolicy(new TimeoutPolicy().withResponseTimeoutInSeconds(15).withConnectionTimeoutInSeconds(5)) + .withHttpRetryPolicy( + new HttpRetryPolicy().withMaxRetries(5) + .withInitialDelayInMilliseconds(1000L) + .withMaxIntervalInMilliseconds(10000L) + .withHeaders( + Arrays.asList(new HeaderMatch().withHeaderProperty("X-Content-Type").withPrefixMatch("GOATS"))) + .withHttpStatusCodes(Arrays.asList(502, 503)) + .withErrors(Arrays.asList("5xx", "connect-failure", "reset", "retriable-headers", + "retriable-status-codes"))) + .withTcpRetryPolicy(new TcpRetryPolicy().withMaxConnectAttempts(3)) + .withCircuitBreakerPolicy(new CircuitBreakerPolicy().withConsecutiveErrors(5) + .withIntervalInSeconds(10) + .withMaxEjectionPercent(50)) + .withHttpConnectionPool( + new HttpConnectionPool().withHttp1MaxPendingRequests(1024).withHttp2MaxRequests(1024)) + .withTcpConnectionPool(new TcpConnectionPool().withMaxConnections(100)) + .create(); } } ``` -### BillingMeters_Get +### AppResiliency_Delete ```java /** - * Samples for BillingMeters Get. + * Samples for AppResiliency Delete. */ -public final class BillingMetersGetSamples { +public final class AppResiliencyDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/BillingMeters_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AppResiliency_Delete.json */ /** - * Sample code: BillingMeters_Get. + * Sample code: Delete App Resiliency. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void billingMetersGet(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.billingMeters().getWithResponse("East US", com.azure.core.util.Context.NONE); + public static void deleteAppResiliency(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.appResiliencies() + .deleteWithResponse("rg", "testcontainerApp0", "resiliency-policy-1", com.azure.core.util.Context.NONE); } } ``` -### Certificates_CreateOrUpdate +### AppResiliency_Get ```java -import com.azure.resourcemanager.appcontainers.fluent.models.CertificateInner; -import com.azure.resourcemanager.appcontainers.models.CertificateProperties; +/** + * Samples for AppResiliency Get. + */ +public final class AppResiliencyGetSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AppResiliency_Get.json + */ + /** + * Sample code: Get App Resiliency. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getAppResiliency(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.appResiliencies() + .getWithResponse("rg", "testcontainerApp0", "resiliency-policy-1", com.azure.core.util.Context.NONE); + } +} +``` +### AppResiliency_List + +```java /** - * Samples for Certificates CreateOrUpdate. + * Samples for AppResiliency List. */ -public final class CertificatesCreateOrUpdateSamples { +public final class AppResiliencyListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificate_CreateOrUpdate.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AppResiliency_List.json */ /** - * Sample code: Create or Update Certificate. + * Sample code: List App Resiliency. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - createOrUpdateCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.certificates() - .createOrUpdateWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", - new CertificateInner().withLocation("East US") - .withProperties(new CertificateProperties().withPassword("fakeTokenPlaceholder") - .withValue("Y2VydA==".getBytes())), - com.azure.core.util.Context.NONE); + public static void listAppResiliency(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.appResiliencies().list("rg", "testcontainerApp0", com.azure.core.util.Context.NONE); } } ``` -### Certificates_Delete +### AppResiliency_Update ```java +import com.azure.resourcemanager.appcontainers.models.AppResiliency; +import com.azure.resourcemanager.appcontainers.models.TimeoutPolicy; + /** - * Samples for Certificates Delete. + * Samples for AppResiliency Update. */ -public final class CertificatesDeleteSamples { +public final class AppResiliencyUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificate_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AppResiliency_Patch.json */ /** - * Sample code: Delete Certificate. + * Sample code: Update App Resiliency. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void deleteCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.certificates() - .deleteWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", - com.azure.core.util.Context.NONE); + public static void updateAppResiliency(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + AppResiliency resource = manager.appResiliencies() + .getWithResponse("rg", "testcontainerApp0", "resiliency-policy-1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTimeoutPolicy(new TimeoutPolicy().withResponseTimeoutInSeconds(30).withConnectionTimeoutInSeconds(40)) + .apply(); } } ``` -### Certificates_Get +### AvailableWorkloadProfiles_Get ```java /** - * Samples for Certificates Get. + * Samples for AvailableWorkloadProfiles Get. */ -public final class CertificatesGetSamples { +public final class AvailableWorkloadProfilesGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * AvailableWorkloadProfiles_Get.json + */ + /** + * Sample code: BillingMeters_Get. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void billingMetersGet(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.availableWorkloadProfiles().get("East US", com.azure.core.util.Context.NONE); + } +} +``` + +### BillingMeters_Get + +```java +/** + * Samples for BillingMeters Get. + */ +public final class BillingMetersGetSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificate_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/BillingMeters_Get.json */ /** - * Sample code: Get Certificate. + * Sample code: BillingMeters_Get. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void getCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.certificates() - .getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", - com.azure.core.util.Context.NONE); + public static void billingMetersGet(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.billingMeters().getWithResponse("East US", com.azure.core.util.Context.NONE); } } ``` -### Certificates_List +### BuildAuthToken_List ```java /** - * Samples for Certificates List. + * Samples for BuildAuthToken List. */ -public final class CertificatesListSamples { +public final class BuildAuthTokenListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificates_ListByManagedEnvironment - * .json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builds_ListAuthToken.json */ /** - * Sample code: List Certificates by Managed Environment. + * Sample code: Get Build Auth Token. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - listCertificatesByManagedEnvironment(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.certificates().list("examplerg", "testcontainerenv", com.azure.core.util.Context.NONE); + public static void getBuildAuthToken(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.buildAuthTokens().listWithResponse("rg", "testBuilder", "testBuild", com.azure.core.util.Context.NONE); } } ``` -### Certificates_Update +### Builders_CreateOrUpdate ```java -import com.azure.resourcemanager.appcontainers.models.CertificatePatch; +import com.azure.resourcemanager.appcontainers.models.ContainerRegistry; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.appcontainers.models.UserAssignedIdentity; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; /** - * Samples for Certificates Update. + * Samples for Builders CreateOrUpdate. */ -public final class CertificatesUpdateSamples { +public final class BuildersCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificates_Patch.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_CreateOrUpdate.json */ /** - * Sample code: Patch Certificate. + * Sample code: Builders_CreateOrUpdate_0. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void patchCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.certificates() - .updateWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", - new CertificatePatch().withTags(mapOf("tag1", "value1", "tag2", "value2")), - com.azure.core.util.Context.NONE); + public static void + buildersCreateOrUpdate0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.builders() + .define("testBuilder") + .withRegion("eastus") + .withExistingResourceGroup("rg") + .withTags(mapOf("company", "Microsoft")) + .withIdentity(new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new UserAssignedIdentity()))) + .withEnvironmentId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/managedEnvironments/testEnv") + .withContainerRegistries(Arrays.asList(new ContainerRegistry() + .withContainerRegistryServer("test.azurecr.io") + .withIdentityResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"), + new ContainerRegistry().withContainerRegistryServer("test2.azurecr.io") + .withIdentityResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"))) + .create(); } // Use "Map.of" if available @@ -370,198 +576,310 @@ public final class CertificatesUpdateSamples { } ``` -### ConnectedEnvironments_CheckNameAvailability +### Builders_Delete ```java -import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityRequest; - /** - * Samples for ConnectedEnvironments CheckNameAvailability. + * Samples for Builders Delete. */ -public final class ConnectedEnvironmentsCheckNameAvailabilitySamples { +public final class BuildersDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ - * ConnectedEnvironmentsCertificates_CheckNameAvailability.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_Delete.json */ /** - * Sample code: Certificates_CheckNameAvailability. + * Sample code: Builders_Delete_0. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - certificatesCheckNameAvailability(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironments() - .checkNameAvailabilityWithResponse("examplerg", "testcontainerenv", - new CheckNameAvailabilityRequest().withName("testcertificatename") - .withType("Microsoft.App/connectedEnvironments/certificates"), - com.azure.core.util.Context.NONE); + public static void buildersDelete0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.builders().delete("rg", "testBuilder", com.azure.core.util.Context.NONE); } } ``` -### ConnectedEnvironments_CreateOrUpdate +### Builders_GetByResourceGroup ```java -import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; - /** - * Samples for ConnectedEnvironments CreateOrUpdate. + * Samples for Builders GetByResourceGroup. */ -public final class ConnectedEnvironmentsCreateOrUpdateSamples { +public final class BuildersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironments_CreateOrUpdate. - * json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_Get.json */ /** - * Sample code: Create kube environments. + * Sample code: Builders_Get_0. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void createKubeEnvironments(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironments() - .define("testenv") - .withRegion("East US") - .withExistingResourceGroup("examplerg") - .withStaticIp("1.2.3.4") - .withDaprAIConnectionString( - "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/") - .withCustomDomainConfiguration(new CustomDomainConfiguration().withDnsSuffix("www.my-name.com") - .withCertificateValue("Y2VydA==".getBytes()) - .withCertificatePassword("fakeTokenPlaceholder")) - .create(); + public static void buildersGet0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.builders().getByResourceGroupWithResponse("rg", "testBuilder", com.azure.core.util.Context.NONE); } } ``` -### ConnectedEnvironments_Delete +### Builders_List ```java /** - * Samples for ConnectedEnvironments Delete. + * Samples for Builders List. */ -public final class ConnectedEnvironmentsDeleteSamples { +public final class BuildersListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironments_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_ListBySubscription. + * json */ /** - * Sample code: Delete connected environment by connectedEnvironmentName. + * Sample code: Builders_ListBySubscription_0. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void deleteConnectedEnvironmentByConnectedEnvironmentName( - com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironments().delete("examplerg", "examplekenv", com.azure.core.util.Context.NONE); + public static void + buildersListBySubscription0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.builders().list(com.azure.core.util.Context.NONE); } } ``` -### ConnectedEnvironments_GetByResourceGroup +### Builders_ListByResourceGroup ```java /** - * Samples for ConnectedEnvironments GetByResourceGroup. + * Samples for Builders ListByResourceGroup. */ -public final class ConnectedEnvironmentsGetByResourceGroupSamples { +public final class BuildersListByResourceGroupSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironments_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_ListByResourceGroup + * .json */ /** - * Sample code: Get connected environment by connectedEnvironmentName. + * Sample code: Builders_ListByResourceGroup_0. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void getConnectedEnvironmentByConnectedEnvironmentName( - com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironments() - .getByResourceGroupWithResponse("examplerg", "examplekenv", com.azure.core.util.Context.NONE); + public static void + buildersListByResourceGroup0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.builders().listByResourceGroup("rg", com.azure.core.util.Context.NONE); } } ``` -### ConnectedEnvironments_List +### Builders_Update ```java +import com.azure.resourcemanager.appcontainers.models.BuilderResource; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for ConnectedEnvironments List. + * Samples for Builders Update. */ -public final class ConnectedEnvironmentsListSamples { +public final class BuildersUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ - * ConnectedEnvironments_ListBySubscription.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_Update.json */ /** - * Sample code: List connected environments by subscription. + * Sample code: Builders_Update_0. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void listConnectedEnvironmentsBySubscription( - com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironments().list(com.azure.core.util.Context.NONE); + public static void buildersUpdate0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + BuilderResource resource = manager.builders() + .getByResourceGroupWithResponse("rg", "testBuilder", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("mytag1", "myvalue1")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### ConnectedEnvironments_ListByResourceGroup +### Builds_CreateOrUpdate ```java +import com.azure.resourcemanager.appcontainers.models.BuildConfiguration; +import com.azure.resourcemanager.appcontainers.models.ContainerRegistryWithCustomImage; +import com.azure.resourcemanager.appcontainers.models.EnvironmentVariable; +import com.azure.resourcemanager.appcontainers.models.HttpGet; +import com.azure.resourcemanager.appcontainers.models.PreBuildStep; +import java.util.Arrays; + /** - * Samples for ConnectedEnvironments ListByResourceGroup. + * Samples for Builds CreateOrUpdate. */ -public final class ConnectedEnvironmentsListByResourceGroupSamples { +public final class BuildsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ - * ConnectedEnvironments_ListByResourceGroup.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builds_CreateOrUpdate.json */ /** - * Sample code: List environments by resource group. + * Sample code: Builds_CreateOrUpdate_WithConfig. * * @param manager Entry point to ContainerAppsApiManager. */ public static void - listEnvironmentsByResourceGroup(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironments().listByResourceGroup("examplerg", com.azure.core.util.Context.NONE); + buildsCreateOrUpdateWithConfig(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.builds() + .define("testBuild-123456789az") + .withExistingBuilder("rg", "testBuilder") + .withDestinationContainerRegistry(new ContainerRegistryWithCustomImage().withServer("test.azurecr.io") + .withImage("test.azurecr.io/repo:tag")) + .withConfiguration(new BuildConfiguration().withBaseOs("DebianBullseye") + .withPlatform("dotnetcore") + .withPlatformVersion("7.0") + .withEnvironmentVariables(Arrays.asList(new EnvironmentVariable().withName("foo1").withValue("bar1"), + new EnvironmentVariable().withName("foo2").withValue("bar2"))) + .withPreBuildSteps(Arrays.asList( + new PreBuildStep().withDescription("First pre build step.") + .withScripts(Arrays.asList("echo 'hello'", "echo 'world'")) + .withHttpGet(new HttpGet().withUrl("https://microsoft.com") + .withFileName("output.txt") + .withHeaders(Arrays.asList("foo", "bar"))), + new PreBuildStep().withDescription("Second pre build step.") + .withScripts(Arrays.asList("echo 'hello'", "echo 'again'")) + .withHttpGet(new HttpGet().withUrl("https://microsoft.com") + .withFileName("output.txt") + .withHeaders(Arrays.asList("foo")))))) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * Builds_CreateOrUpdate_NoConfig.json + */ + /** + * Sample code: Builds_CreateOrUpdate_NoConfig. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + buildsCreateOrUpdateNoConfig(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.builds().define("testBuild").withExistingBuilder("rg", "testBuilder").create(); } } ``` -### ConnectedEnvironments_Update +### Builds_Delete ```java /** - * Samples for ConnectedEnvironments Update. + * Samples for Builds Delete. */ -public final class ConnectedEnvironmentsUpdateSamples { +public final class BuildsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironments_Patch.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builds_Delete.json */ /** - * Sample code: Patch Managed Environment. + * Sample code: Builds_Delete_0. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - patchManagedEnvironment(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironments().updateWithResponse("examplerg", "testenv", com.azure.core.util.Context.NONE); + public static void buildsDelete0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.builds().delete("rg", "testBuilder", "testBuild", com.azure.core.util.Context.NONE); } } ``` -### ConnectedEnvironmentsCertificates_CreateOrUpdate +### Builds_Get ```java -import com.azure.resourcemanager.appcontainers.models.CertificateProperties; - /** - * Samples for ConnectedEnvironmentsCertificates CreateOrUpdate. + * Samples for Builds Get. */ -public final class ConnectedEnvironmentsCertificatesCreateOrUpdateSamples { +public final class BuildsGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ - * ConnectedEnvironmentsCertificate_CreateOrUpdate.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builds_Get.json + */ + /** + * Sample code: Builds_Get_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void buildsGet0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.builds().getWithResponse("rg", "testBuilder", "testBuild", com.azure.core.util.Context.NONE); + } +} +``` + +### BuildsByBuilderResource_List + +```java +/** + * Samples for BuildsByBuilderResource List. + */ +public final class BuildsByBuilderResourceListSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builds_ListByBuilderResource + * .json + */ + /** + * Sample code: Builds_ListByBuilderResource_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + buildsListByBuilderResource0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.buildsByBuilderResources().list("rg", "testBuilder", com.azure.core.util.Context.NONE); + } +} +``` + +### Certificates_CreateOrUpdate + +```java +import com.azure.resourcemanager.appcontainers.fluent.models.CertificateInner; +import com.azure.resourcemanager.appcontainers.models.CertificateKeyVaultProperties; +import com.azure.resourcemanager.appcontainers.models.CertificateProperties; +import com.azure.resourcemanager.appcontainers.models.CertificateType; + +/** + * Samples for Certificates CreateOrUpdate. + */ +public final class CertificatesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * Certificate_CreateOrUpdate_FromKeyVault.json + */ + /** + * Sample code: Create or Update Certificate using Managed Identity. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateCertificateUsingManagedIdentity( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.certificates() + .createOrUpdateWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", + new CertificateInner().withLocation("East US") + .withProperties(new CertificateProperties() + .withCertificateKeyVaultProperties(new CertificateKeyVaultProperties().withIdentity( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/microsoft.managedidentity/userassignedidentities/test-user-mi") + .withKeyVaultUrl("fakeTokenPlaceholder")) + .withCertificateType(CertificateType.SERVER_SSLCERTIFICATE)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificate_CreateOrUpdate. + * json */ /** * Sample code: Create or Update Certificate. @@ -570,27 +888,27 @@ public final class ConnectedEnvironmentsCertificatesCreateOrUpdateSamples { */ public static void createOrUpdateCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsCertificates() - .define("certificate-firendly-name") - .withRegion("East US") - .withExistingConnectedEnvironment("examplerg", "testcontainerenv") - .withProperties( - new CertificateProperties().withPassword("fakeTokenPlaceholder").withValue("Y2VydA==".getBytes())) - .create(); + manager.certificates() + .createOrUpdateWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", + new CertificateInner().withLocation("East US") + .withProperties(new CertificateProperties().withPassword("fakeTokenPlaceholder") + .withValue("Y2VydA==".getBytes()) + .withCertificateType(CertificateType.IMAGE_PULL_TRUSTED_CA)), + com.azure.core.util.Context.NONE); } } ``` -### ConnectedEnvironmentsCertificates_Delete +### Certificates_Delete ```java /** - * Samples for ConnectedEnvironmentsCertificates Delete. + * Samples for Certificates Delete. */ -public final class ConnectedEnvironmentsCertificatesDeleteSamples { +public final class CertificatesDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ - * ConnectedEnvironmentsCertificate_Delete.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificate_Delete.json */ /** * Sample code: Delete Certificate. @@ -598,24 +916,23 @@ public final class ConnectedEnvironmentsCertificatesDeleteSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void deleteCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsCertificates() + manager.certificates() .deleteWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", com.azure.core.util.Context.NONE); } } ``` -### ConnectedEnvironmentsCertificates_Get +### Certificates_Get ```java /** - * Samples for ConnectedEnvironmentsCertificates Get. + * Samples for Certificates Get. */ -public final class ConnectedEnvironmentsCertificatesGetSamples { +public final class CertificatesGetSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsCertificate_Get. - * json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificate_Get.json */ /** * Sample code: Get Certificate. @@ -623,51 +940,50 @@ public final class ConnectedEnvironmentsCertificatesGetSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsCertificates() + manager.certificates() .getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", com.azure.core.util.Context.NONE); } } ``` -### ConnectedEnvironmentsCertificates_List +### Certificates_List ```java /** - * Samples for ConnectedEnvironmentsCertificates List. + * Samples for Certificates List. */ -public final class ConnectedEnvironmentsCertificatesListSamples { +public final class CertificatesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ - * ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * Certificates_ListByManagedEnvironment.json */ /** - * Sample code: List Certificates by Connected Environment. + * Sample code: List Certificates by Managed Environment. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void listCertificatesByConnectedEnvironment( - com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsCertificates() - .list("examplerg", "testcontainerenv", com.azure.core.util.Context.NONE); + public static void + listCertificatesByManagedEnvironment(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.certificates().list("examplerg", "testcontainerenv", com.azure.core.util.Context.NONE); } } ``` -### ConnectedEnvironmentsCertificates_Update +### Certificates_Update ```java -import com.azure.resourcemanager.appcontainers.models.Certificate; +import com.azure.resourcemanager.appcontainers.models.CertificatePatch; import java.util.HashMap; import java.util.Map; /** - * Samples for ConnectedEnvironmentsCertificates Update. + * Samples for Certificates Update. */ -public final class ConnectedEnvironmentsCertificatesUpdateSamples { +public final class CertificatesUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ - * ConnectedEnvironmentsCertificates_Patch.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificates_Patch.json */ /** * Sample code: Patch Certificate. @@ -675,11 +991,10 @@ public final class ConnectedEnvironmentsCertificatesUpdateSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void patchCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - Certificate resource = manager.connectedEnvironmentsCertificates() - .getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + manager.certificates() + .updateWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", + new CertificatePatch().withTags(mapOf("tag1", "value1", "tag2", "value2")), + com.azure.core.util.Context.NONE); } // Use "Map.of" if available @@ -696,803 +1011,2873 @@ public final class ConnectedEnvironmentsCertificatesUpdateSamples { } ``` -### ConnectedEnvironmentsDaprComponents_CreateOrUpdate +### ConnectedEnvironments_CheckNameAvailability ```java -import com.azure.resourcemanager.appcontainers.models.DaprMetadata; -import com.azure.resourcemanager.appcontainers.models.Secret; -import java.util.Arrays; +import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityRequest; /** - * Samples for ConnectedEnvironmentsDaprComponents CreateOrUpdate. + * Samples for ConnectedEnvironments CheckNameAvailability. */ -public final class ConnectedEnvironmentsDaprComponentsCreateOrUpdateSamples { +public final class ConnectedEnvironmentsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ - * ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironmentsCertificates_CheckNameAvailability.json */ /** - * Sample code: Create or update dapr component. + * Sample code: Certificates_CheckNameAvailability. * * @param manager Entry point to ContainerAppsApiManager. */ public static void - createOrUpdateDaprComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsDaprComponents() - .define("reddog") - .withExistingConnectedEnvironment("examplerg", "myenvironment") - .withComponentType("state.azure.cosmosdb") - .withVersion("v1") - .withIgnoreErrors(false) - .withInitTimeout("50s") - .withSecrets(Arrays.asList(new Secret().withName("masterkey").withValue("keyvalue"))) - .withMetadata(Arrays.asList(new DaprMetadata().withName("url").withValue(""), - new DaprMetadata().withName("database").withValue("itemsDB"), - new DaprMetadata().withName("collection").withValue("items"), - new DaprMetadata().withName("masterkey").withSecretRef("fakeTokenPlaceholder"))) - .withScopes(Arrays.asList("container-app-1", "container-app-2")) - .create(); + certificatesCheckNameAvailability(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.connectedEnvironments() + .checkNameAvailabilityWithResponse("examplerg", "testcontainerenv", + new CheckNameAvailabilityRequest().withName("testcertificatename") + .withType("Microsoft.App/connectedEnvironments/certificates"), + com.azure.core.util.Context.NONE); } } ``` -### ConnectedEnvironmentsDaprComponents_Delete +### ConnectedEnvironments_CreateOrUpdate ```java +import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; + /** - * Samples for ConnectedEnvironmentsDaprComponents Delete. + * Samples for ConnectedEnvironments CreateOrUpdate. */ -public final class ConnectedEnvironmentsDaprComponentsDeleteSamples { +public final class ConnectedEnvironmentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ - * ConnectedEnvironmentsDaprComponents_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironments_CreateOrUpdate.json */ /** - * Sample code: Delete dapr component. + * Sample code: Create kube environments. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void deleteDaprComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsDaprComponents() - .deleteWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); + public static void createKubeEnvironments(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.connectedEnvironments() + .define("testenv") + .withRegion("East US") + .withExistingResourceGroup("examplerg") + .withStaticIp("1.2.3.4") + .withDaprAIConnectionString( + "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/") + .withCustomDomainConfiguration(new CustomDomainConfiguration().withDnsSuffix("www.my-name.com") + .withCertificateValue("Y2VydA==".getBytes()) + .withCertificatePassword("fakeTokenPlaceholder")) + .create(); } } ``` -### ConnectedEnvironmentsDaprComponents_Get +### ConnectedEnvironments_Delete ```java /** - * Samples for ConnectedEnvironmentsDaprComponents Get. + * Samples for ConnectedEnvironments Delete. */ -public final class ConnectedEnvironmentsDaprComponentsGetSamples { +public final class ConnectedEnvironmentsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ - * ConnectedEnvironmentsDaprComponents_Get.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironments_Delete + * .json */ /** - * Sample code: Get Dapr Component. + * Sample code: Delete connected environment by connectedEnvironmentName. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void getDaprComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsDaprComponents() - .getWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); + public static void deleteConnectedEnvironmentByConnectedEnvironmentName( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.connectedEnvironments().delete("examplerg", "examplekenv", com.azure.core.util.Context.NONE); } } ``` -### ConnectedEnvironmentsDaprComponents_List +### ConnectedEnvironments_GetByResourceGroup ```java /** - * Samples for ConnectedEnvironmentsDaprComponents List. + * Samples for ConnectedEnvironments GetByResourceGroup. */ -public final class ConnectedEnvironmentsDaprComponentsListSamples { +public final class ConnectedEnvironmentsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ - * ConnectedEnvironmentsDaprComponents_List.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironments_Get. + * json */ /** - * Sample code: List Dapr Components. + * Sample code: Get connected environment by connectedEnvironmentName. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void listDaprComponents(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsDaprComponents() - .list("examplerg", "myenvironment", com.azure.core.util.Context.NONE); + public static void getConnectedEnvironmentByConnectedEnvironmentName( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.connectedEnvironments() + .getByResourceGroupWithResponse("examplerg", "examplekenv", com.azure.core.util.Context.NONE); } } ``` -### ConnectedEnvironmentsDaprComponents_ListSecrets +### ConnectedEnvironments_List ```java /** - * Samples for ConnectedEnvironmentsDaprComponents ListSecrets. + * Samples for ConnectedEnvironments List. */ -public final class ConnectedEnvironmentsDaprComponentsListSecretsSamples { +public final class ConnectedEnvironmentsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ - * ConnectedEnvironmentsDaprComponents_ListSecrets.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironments_ListBySubscription.json */ /** - * Sample code: List Container Apps Secrets. + * Sample code: List connected environments by subscription. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - listContainerAppsSecrets(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsDaprComponents() - .listSecretsWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); + public static void listConnectedEnvironmentsBySubscription( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.connectedEnvironments().list(com.azure.core.util.Context.NONE); } } ``` -### ConnectedEnvironmentsStorages_CreateOrUpdate +### ConnectedEnvironments_ListByResourceGroup ```java -import com.azure.resourcemanager.appcontainers.models.AccessMode; -import com.azure.resourcemanager.appcontainers.models.AzureFileProperties; -import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentStorageProperties; - /** - * Samples for ConnectedEnvironmentsStorages CreateOrUpdate. + * Samples for ConnectedEnvironments ListByResourceGroup. */ -public final class ConnectedEnvironmentsStoragesCreateOrUpdateSamples { +public final class ConnectedEnvironmentsListByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ - * ConnectedEnvironmentsStorages_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironments_ListByResourceGroup.json */ /** - * Sample code: Create or update environments storage. + * Sample code: List environments by resource group. * * @param manager Entry point to ContainerAppsApiManager. */ public static void - createOrUpdateEnvironmentsStorage(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsStorages() - .define("jlaw-demo1") - .withExistingConnectedEnvironment("examplerg", "env") - .withProperties(new ConnectedEnvironmentStorageProperties() - .withAzureFile(new AzureFileProperties().withAccountName("account1") - .withAccountKey("fakeTokenPlaceholder") - .withAccessMode(AccessMode.READ_ONLY) + listEnvironmentsByResourceGroup(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.connectedEnvironments().listByResourceGroup("examplerg", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectedEnvironments_Update + +```java +/** + * Samples for ConnectedEnvironments Update. + */ +public final class ConnectedEnvironmentsUpdateSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironments_Patch. + * json + */ + /** + * Sample code: Patch Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + patchManagedEnvironment(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.connectedEnvironments().updateWithResponse("examplerg", "testenv", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectedEnvironmentsCertificates_CreateOrUpdate + +```java +import com.azure.resourcemanager.appcontainers.models.CertificateProperties; + +/** + * Samples for ConnectedEnvironmentsCertificates CreateOrUpdate. + */ +public final class ConnectedEnvironmentsCertificatesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironmentsCertificate_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Certificate. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + createOrUpdateCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.connectedEnvironmentsCertificates() + .define("certificate-firendly-name") + .withRegion("East US") + .withExistingConnectedEnvironment("examplerg", "testcontainerenv") + .withProperties( + new CertificateProperties().withPassword("fakeTokenPlaceholder").withValue("Y2VydA==".getBytes())) + .create(); + } +} +``` + +### ConnectedEnvironmentsCertificates_Delete + +```java +/** + * Samples for ConnectedEnvironmentsCertificates Delete. + */ +public final class ConnectedEnvironmentsCertificatesDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironmentsCertificate_Delete.json + */ + /** + * Sample code: Delete Certificate. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.connectedEnvironmentsCertificates() + .deleteWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", + com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectedEnvironmentsCertificates_Get + +```java +/** + * Samples for ConnectedEnvironmentsCertificates Get. + */ +public final class ConnectedEnvironmentsCertificatesGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironmentsCertificate_Get.json + */ + /** + * Sample code: Get Certificate. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.connectedEnvironmentsCertificates() + .getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", + com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectedEnvironmentsCertificates_List + +```java +/** + * Samples for ConnectedEnvironmentsCertificates List. + */ +public final class ConnectedEnvironmentsCertificatesListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json + */ + /** + * Sample code: List Certificates by Connected Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listCertificatesByConnectedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.connectedEnvironmentsCertificates() + .list("examplerg", "testcontainerenv", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectedEnvironmentsCertificates_Update + +```java +import com.azure.resourcemanager.appcontainers.models.Certificate; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ConnectedEnvironmentsCertificates Update. + */ +public final class ConnectedEnvironmentsCertificatesUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironmentsCertificates_Patch.json + */ + /** + * Sample code: Patch Certificate. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void patchCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + Certificate resource = manager.connectedEnvironmentsCertificates() + .getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ConnectedEnvironmentsDaprComponents_CreateOrUpdate + +```java +import com.azure.resourcemanager.appcontainers.models.DaprComponentServiceBinding; +import com.azure.resourcemanager.appcontainers.models.DaprMetadata; +import com.azure.resourcemanager.appcontainers.models.DaprServiceBindMetadata; +import com.azure.resourcemanager.appcontainers.models.Secret; +import java.util.Arrays; + +/** + * Samples for ConnectedEnvironmentsDaprComponents CreateOrUpdate. + */ +public final class ConnectedEnvironmentsDaprComponentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json + */ + /** + * Sample code: Create or update dapr component. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + createOrUpdateDaprComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.connectedEnvironmentsDaprComponents() + .define("reddog") + .withExistingConnectedEnvironment("examplerg", "myenvironment") + .withComponentType("state.azure.cosmosdb") + .withVersion("v1") + .withIgnoreErrors(false) + .withInitTimeout("50s") + .withSecrets(Arrays.asList(new Secret().withName("masterkey").withValue("keyvalue"))) + .withMetadata(Arrays.asList(new DaprMetadata().withName("url").withValue(""), + new DaprMetadata().withName("database").withValue("itemsDB"), + new DaprMetadata().withName("collection").withValue("items"), + new DaprMetadata().withName("masterkey").withSecretRef("fakeTokenPlaceholder"))) + .withScopes(Arrays.asList("container-app-1", "container-app-2")) + .withServiceComponentBind(Arrays.asList(new DaprComponentServiceBinding().withName("statestore") + .withServiceId( + "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis") + .withMetadata(new DaprServiceBindMetadata().withName("daprcomponentBind").withValue("redis-bind")))) + .create(); + } +} +``` + +### ConnectedEnvironmentsDaprComponents_Delete + +```java +/** + * Samples for ConnectedEnvironmentsDaprComponents Delete. + */ +public final class ConnectedEnvironmentsDaprComponentsDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironmentsDaprComponents_Delete.json + */ + /** + * Sample code: Delete dapr component. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteDaprComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.connectedEnvironmentsDaprComponents() + .deleteWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectedEnvironmentsDaprComponents_Get + +```java +/** + * Samples for ConnectedEnvironmentsDaprComponents Get. + */ +public final class ConnectedEnvironmentsDaprComponentsGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironmentsDaprComponents_Get.json + */ + /** + * Sample code: Get Dapr Component. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getDaprComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.connectedEnvironmentsDaprComponents() + .getWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectedEnvironmentsDaprComponents_List + +```java +/** + * Samples for ConnectedEnvironmentsDaprComponents List. + */ +public final class ConnectedEnvironmentsDaprComponentsListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironmentsDaprComponents_List.json + */ + /** + * Sample code: List Dapr Components. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listDaprComponents(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.connectedEnvironmentsDaprComponents() + .list("examplerg", "myenvironment", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectedEnvironmentsDaprComponents_ListSecrets + +```java +/** + * Samples for ConnectedEnvironmentsDaprComponents ListSecrets. + */ +public final class ConnectedEnvironmentsDaprComponentsListSecretsSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironmentsDaprComponents_ListSecrets.json + */ + /** + * Sample code: List Container Apps Secrets. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listContainerAppsSecrets(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.connectedEnvironmentsDaprComponents() + .listSecretsWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectedEnvironmentsStorages_CreateOrUpdate + +```java +import com.azure.resourcemanager.appcontainers.models.AccessMode; +import com.azure.resourcemanager.appcontainers.models.AzureFileProperties; +import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentStorageProperties; + +/** + * Samples for ConnectedEnvironmentsStorages CreateOrUpdate. + */ +public final class ConnectedEnvironmentsStoragesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironmentsStorages_CreateOrUpdate.json + */ + /** + * Sample code: Create or update environments storage. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + createOrUpdateEnvironmentsStorage(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.connectedEnvironmentsStorages() + .define("jlaw-demo1") + .withExistingConnectedEnvironment("examplerg", "env") + .withProperties(new ConnectedEnvironmentStorageProperties() + .withAzureFile(new AzureFileProperties().withAccountName("account1") + .withAccountKey("fakeTokenPlaceholder") + .withAccessMode(AccessMode.READ_ONLY) .withShareName("share1"))) .create(); } } ``` -### ConnectedEnvironmentsStorages_Delete +### ConnectedEnvironmentsStorages_Delete + +```java +/** + * Samples for ConnectedEnvironmentsStorages Delete. + */ +public final class ConnectedEnvironmentsStoragesDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironmentsStorages_Delete.json + */ + /** + * Sample code: List environments storages by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listEnvironmentsStoragesBySubscription( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.connectedEnvironmentsStorages() + .deleteWithResponse("examplerg", "env", "jlaw-demo1", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectedEnvironmentsStorages_Get + +```java +/** + * Samples for ConnectedEnvironmentsStorages Get. + */ +public final class ConnectedEnvironmentsStoragesGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironmentsStorages_Get.json + */ + /** + * Sample code: get a environments storage properties by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getAEnvironmentsStoragePropertiesBySubscription( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.connectedEnvironmentsStorages() + .getWithResponse("examplerg", "env", "jlaw-demo1", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectedEnvironmentsStorages_List + +```java +/** + * Samples for ConnectedEnvironmentsStorages List. + */ +public final class ConnectedEnvironmentsStoragesListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironmentsStorages_List.json + */ + /** + * Sample code: List environments storages by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listEnvironmentsStoragesBySubscription( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.connectedEnvironmentsStorages() + .listWithResponse("examplerg", "managedEnv", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerApps_CreateOrUpdate + +```java +import com.azure.resourcemanager.appcontainers.models.Action; +import com.azure.resourcemanager.appcontainers.models.ActiveRevisionsMode; +import com.azure.resourcemanager.appcontainers.models.Affinity; +import com.azure.resourcemanager.appcontainers.models.AppProtocol; +import com.azure.resourcemanager.appcontainers.models.BindingType; +import com.azure.resourcemanager.appcontainers.models.Configuration; +import com.azure.resourcemanager.appcontainers.models.Container; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeTcpSocket; +import com.azure.resourcemanager.appcontainers.models.ContainerAppPropertiesPatchingConfiguration; +import com.azure.resourcemanager.appcontainers.models.ContainerResources; +import com.azure.resourcemanager.appcontainers.models.CorsPolicy; +import com.azure.resourcemanager.appcontainers.models.CustomDomain; +import com.azure.resourcemanager.appcontainers.models.CustomScaleRule; +import com.azure.resourcemanager.appcontainers.models.Dapr; +import com.azure.resourcemanager.appcontainers.models.ExtendedLocation; +import com.azure.resourcemanager.appcontainers.models.ExtendedLocationTypes; +import com.azure.resourcemanager.appcontainers.models.IdentitySettings; +import com.azure.resourcemanager.appcontainers.models.IdentitySettingsLifeCycle; +import com.azure.resourcemanager.appcontainers.models.ImageType; +import com.azure.resourcemanager.appcontainers.models.Ingress; +import com.azure.resourcemanager.appcontainers.models.IngressClientCertificateMode; +import com.azure.resourcemanager.appcontainers.models.IngressPortMapping; +import com.azure.resourcemanager.appcontainers.models.IngressStickySessions; +import com.azure.resourcemanager.appcontainers.models.IngressTransportMethod; +import com.azure.resourcemanager.appcontainers.models.InitContainer; +import com.azure.resourcemanager.appcontainers.models.IpSecurityRestrictionRule; +import com.azure.resourcemanager.appcontainers.models.Kind; +import com.azure.resourcemanager.appcontainers.models.Level; +import com.azure.resourcemanager.appcontainers.models.LoggerSetting; +import com.azure.resourcemanager.appcontainers.models.LogLevel; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.appcontainers.models.PatchingMode; +import com.azure.resourcemanager.appcontainers.models.QueueScaleRule; +import com.azure.resourcemanager.appcontainers.models.Runtime; +import com.azure.resourcemanager.appcontainers.models.RuntimeDotnet; +import com.azure.resourcemanager.appcontainers.models.RuntimeJava; +import com.azure.resourcemanager.appcontainers.models.RuntimeJavaAgent; +import com.azure.resourcemanager.appcontainers.models.RuntimeJavaAgentLogging; +import com.azure.resourcemanager.appcontainers.models.Scale; +import com.azure.resourcemanager.appcontainers.models.ScaleRule; +import com.azure.resourcemanager.appcontainers.models.Service; +import com.azure.resourcemanager.appcontainers.models.ServiceBind; +import com.azure.resourcemanager.appcontainers.models.StorageType; +import com.azure.resourcemanager.appcontainers.models.TcpScaleRule; +import com.azure.resourcemanager.appcontainers.models.Template; +import com.azure.resourcemanager.appcontainers.models.TrafficWeight; +import com.azure.resourcemanager.appcontainers.models.Type; +import com.azure.resourcemanager.appcontainers.models.UserAssignedIdentity; +import com.azure.resourcemanager.appcontainers.models.Volume; +import com.azure.resourcemanager.appcontainers.models.VolumeMount; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ContainerApps CreateOrUpdate. + */ +public final class ContainerAppsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerApps_SourceToCloudApp_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update SourceToCloud App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + createOrUpdateSourceToCloudApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerApps() + .define("testcontainerApp0") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") + .withWorkloadProfileName("My-GP-01") + .withPatchingConfiguration( + new ContainerAppPropertiesPatchingConfiguration().withPatchingMode(PatchingMode.AUTOMATIC)) + .withConfiguration( + new Configuration() + .withIngress(new Ingress().withExternal(true) + .withTargetPort(3000) + .withTraffic(Arrays.asList(new TrafficWeight() + .withRevisionName("testcontainerApp0-ab1234") + .withWeight(100) + .withLabel("production"))) + .withCustomDomains(Arrays.asList(new CustomDomain() + .withName("www.my-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), + new CustomDomain().withName("www.my-other-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"))) + .withIpSecurityRestrictions( + Arrays + .asList( + new IpSecurityRestrictionRule().withName("Allow work IP A subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/32") + .withAction(Action.ALLOW), + new IpSecurityRestrictionRule().withName("Allow work IP B subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/8") + .withAction(Action.ALLOW))) + .withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY)) + .withClientCertificateMode(IngressClientCertificateMode.ACCEPT) + .withCorsPolicy(new CorsPolicy() + .withAllowedOrigins(Arrays.asList("https://a.test.com", "https://b.test.com")) + .withAllowedMethods(Arrays.asList("GET", "POST")) + .withAllowedHeaders(Arrays.asList("HEADER1", "HEADER2")) + .withExposeHeaders(Arrays.asList("HEADER3", "HEADER4")) + .withMaxAge(1234) + .withAllowCredentials(true)) + .withAdditionalPortMappings(Arrays.asList( + new IngressPortMapping().withExternal(true).withTargetPort(1234), + new IngressPortMapping().withExternal(false).withTargetPort(2345).withExposedPort(3456)))) + .withDapr(new Dapr().withEnabled(true) + .withAppProtocol(AppProtocol.HTTP) + .withAppPort(3000) + .withHttpReadBufferSize(30) + .withHttpMaxRequestSize(10) + .withLogLevel(LogLevel.DEBUG) + .withEnableApiLogging(true)) + .withMaxInactiveRevisions(10) + .withService(new Service().withType("redis"))) + .withTemplate(new Template() + .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerApp0:v4") + .withName("testinitcontainerApp0") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers(Arrays.asList(new Container() + .withImage("") + .withImageType(ImageType.CLOUD_BUILD) + .withName("testcontainerApp0") + .withVolumeMounts( + Arrays.asList( + new VolumeMount().withVolumeName("azurefile") + .withMountPath("/mnt/path1") + .withSubPath("subPath1"), + new VolumeMount() + .withVolumeName("nfsazurefile") + .withMountPath("/mnt/path2") + .withSubPath("subPath2"))) + .withProbes( + Arrays.asList(new ContainerAppProbe().withHttpGet(new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)).withInitialDelaySeconds(3).withPeriodSeconds(3).withType(Type.LIVENESS))))) + .withScale( + new Scale().withMinReplicas(1) + .withMaxReplicas(5) + .withCooldownPeriod(350) + .withPollingInterval(35) + .withRules(Arrays.asList(new ScaleRule().withName("httpscalingrule") + .withCustom(new CustomScaleRule().withType("http") + .withMetadata(mapOf("concurrentRequests", "50")))))) + .withVolumes(Arrays.asList( + new Volume().withName("azurefile") + .withStorageType(StorageType.AZURE_FILE) + .withStorageName("storage"), + new Volume().withName("nfsazurefile") + .withStorageType(StorageType.NFS_AZURE_FILE) + .withStorageName("nfsStorage"))) + .withServiceBinds(Arrays.asList(new ServiceBind().withServiceId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/redisService") + .withName("redisService") + .withClientType("dotnet") + .withCustomizedKeys(mapOf("DesiredKey", "fakeTokenPlaceholder"))))) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerApps_CreateOrUpdate_ConnectedEnvironment.json + */ + /** + * Sample code: Create or Update App On A Connected Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateAppOnAConnectedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerApps() + .define("testcontainerApp0") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube") + .withConfiguration( + new Configuration() + .withIngress(new Ingress().withExternal(true) + .withTargetPort(3000) + .withTraffic(Arrays.asList(new TrafficWeight() + .withRevisionName("testcontainerApp0-ab1234") + .withWeight(100) + .withLabel("production"))) + .withCustomDomains(Arrays.asList(new CustomDomain() + .withName("www.my-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), + new CustomDomain().withName("www.my-other-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"))) + .withIpSecurityRestrictions( + Arrays + .asList( + new IpSecurityRestrictionRule().withName("Allow work IP A subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/32") + .withAction(Action.ALLOW), + new IpSecurityRestrictionRule().withName("Allow work IP B subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/8") + .withAction(Action.ALLOW))) + .withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY)) + .withClientCertificateMode(IngressClientCertificateMode.ACCEPT) + .withCorsPolicy(new CorsPolicy() + .withAllowedOrigins(Arrays.asList("https://a.test.com", "https://b.test.com")) + .withAllowedMethods(Arrays.asList("GET", "POST")) + .withAllowedHeaders(Arrays.asList("HEADER1", "HEADER2")) + .withExposeHeaders(Arrays.asList("HEADER3", "HEADER4")) + .withMaxAge(1234) + .withAllowCredentials(true)) + .withAdditionalPortMappings(Arrays.asList( + new IngressPortMapping().withExternal(true).withTargetPort(1234), + new IngressPortMapping().withExternal(false).withTargetPort(2345).withExposedPort(3456)))) + .withDapr(new Dapr() + .withEnabled(true) + .withAppProtocol(AppProtocol.HTTP) + .withAppPort(3000) + .withHttpReadBufferSize(30) + .withHttpMaxRequestSize(10) + .withLogLevel(LogLevel.DEBUG) + .withEnableApiLogging(true)) + .withRuntime(new Runtime().withJava(new RuntimeJava().withEnableMetrics(true) + .withJavaAgent(new RuntimeJavaAgent().withEnabled(true) + .withLogging(new RuntimeJavaAgentLogging().withLoggerSettings(Arrays.asList( + new LoggerSetting().withLogger("org.springframework.boot").withLevel(Level.DEBUG)))))) + .withDotnet(new RuntimeDotnet().withAutoConfigureDataProtection(true))) + .withMaxInactiveRevisions(10)) + .withTemplate(new Template() + .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerApp0:v4") + .withName("testinitcontainerApp0") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers(Arrays.asList(new Container() + .withImage("repo/testcontainerApp0:v1") + .withName("testcontainerApp0") + .withProbes( + Arrays.asList(new ContainerAppProbe().withHttpGet(new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)).withInitialDelaySeconds(3).withPeriodSeconds(3).withType(Type.LIVENESS))))) + .withScale( + new Scale().withMinReplicas(1) + .withMaxReplicas(5) + .withCooldownPeriod(350) + .withPollingInterval(35) + .withRules(Arrays.asList(new ScaleRule().withName("httpscalingrule") + .withCustom(new CustomScaleRule().withType("http") + .withMetadata(mapOf("concurrentRequests", "50"))))))) + .create(); + } + + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_CreateOrUpdate + * .json + */ + /** + * Sample code: Create or Update Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + createOrUpdateContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerApps() + .define("testcontainerApp0") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withIdentity(new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity", + new UserAssignedIdentity()))) + .withEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") + .withWorkloadProfileName("My-GP-01") + .withConfiguration( + new Configuration() + .withIngress(new Ingress().withExternal(true) + .withTargetPort(3000) + .withTraffic(Arrays.asList(new TrafficWeight() + .withRevisionName("testcontainerApp0-ab1234") + .withWeight(100) + .withLabel("production"))) + .withCustomDomains(Arrays.asList(new CustomDomain() + .withName("www.my-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), + new CustomDomain().withName("www.my-other-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"))) + .withIpSecurityRestrictions( + Arrays + .asList( + new IpSecurityRestrictionRule().withName("Allow work IP A subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/32") + .withAction(Action.ALLOW), + new IpSecurityRestrictionRule().withName("Allow work IP B subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/8") + .withAction(Action.ALLOW))) + .withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY)) + .withClientCertificateMode(IngressClientCertificateMode.ACCEPT) + .withCorsPolicy(new CorsPolicy() + .withAllowedOrigins(Arrays.asList("https://a.test.com", "https://b.test.com")) + .withAllowedMethods(Arrays.asList("GET", "POST")) + .withAllowedHeaders(Arrays.asList("HEADER1", "HEADER2")) + .withExposeHeaders(Arrays.asList("HEADER3", "HEADER4")) + .withMaxAge(1234) + .withAllowCredentials(true)) + .withAdditionalPortMappings(Arrays.asList( + new IngressPortMapping().withExternal(true).withTargetPort(1234), + new IngressPortMapping().withExternal(false).withTargetPort(2345).withExposedPort(3456)))) + .withDapr(new Dapr() + .withEnabled(true) + .withAppProtocol(AppProtocol.HTTP) + .withAppPort(3000) + .withHttpReadBufferSize(30) + .withHttpMaxRequestSize(10) + .withLogLevel(LogLevel.DEBUG) + .withEnableApiLogging(true)) + .withRuntime(new Runtime().withJava(new RuntimeJava() + .withEnableMetrics(true) + .withJavaAgent(new RuntimeJavaAgent() + .withEnabled(true) + .withLogging(new RuntimeJavaAgentLogging().withLoggerSettings( + Arrays.asList(new LoggerSetting().withLogger("org.springframework.boot") + .withLevel(Level.DEBUG)))))) + .withDotnet(new RuntimeDotnet().withAutoConfigureDataProtection(true))) + .withMaxInactiveRevisions(10) + .withService(new Service().withType("redis")) + .withIdentitySettings(Arrays.asList(new IdentitySettings().withIdentity( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity") + .withLifecycle(IdentitySettingsLifeCycle.ALL), + new IdentitySettings().withIdentity("system").withLifecycle(IdentitySettingsLifeCycle.INIT)))) + .withTemplate(new Template() + .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerApp0:v4") + .withName("testinitcontainerApp0") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers(Arrays.asList(new Container() + .withImage("repo/testcontainerApp0:v1") + .withName("testcontainerApp0") + .withVolumeMounts( + Arrays.asList( + new VolumeMount().withVolumeName("azurefile") + .withMountPath("/mnt/path1") + .withSubPath("subPath1"), + new VolumeMount() + .withVolumeName("nfsazurefile") + .withMountPath("/mnt/path2") + .withSubPath("subPath2"))) + .withProbes( + Arrays.asList(new ContainerAppProbe().withHttpGet(new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)).withInitialDelaySeconds(3).withPeriodSeconds(3).withType(Type.LIVENESS))))) + .withScale(new Scale().withMinReplicas(1) + .withMaxReplicas(5) + .withCooldownPeriod(350) + .withPollingInterval(35) + .withRules(Arrays.asList( + new ScaleRule().withName("httpscalingrule") + .withCustom( + new CustomScaleRule().withType("http").withMetadata(mapOf("concurrentRequests", "50"))), + new ScaleRule().withName("servicebus") + .withCustom(new CustomScaleRule().withType("azure-servicebus") + .withMetadata( + mapOf("messageCount", "5", "namespace", "mynamespace", "queueName", "myqueue")) + .withIdentity( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity")), + new ScaleRule().withName("azure-queue") + .withAzureQueue(new QueueScaleRule().withAccountName("account1") + .withQueueName("queue1") + .withQueueLength(1) + .withIdentity("system"))))) + .withVolumes(Arrays.asList( + new Volume().withName("azurefile") + .withStorageType(StorageType.AZURE_FILE) + .withStorageName("storage"), + new Volume().withName("nfsazurefile") + .withStorageType(StorageType.NFS_AZURE_FILE) + .withStorageName("nfsStorage"))) + .withServiceBinds(Arrays.asList(new ServiceBind().withServiceId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/redisService") + .withName("redisService") + .withClientType("dotnet") + .withCustomizedKeys(mapOf("DesiredKey", "fakeTokenPlaceholder"))))) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerApps_TcpApp_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Tcp App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateTcpApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerApps() + .define("testcontainerAppTcp") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") + .withConfiguration( + new Configuration().withIngress(new Ingress().withExternal(true) + .withTargetPort(3000) + .withExposedPort(4000) + .withTransport(IngressTransportMethod.TCP) + .withTraffic(Arrays + .asList(new TrafficWeight().withRevisionName("testcontainerAppTcp-ab1234").withWeight(100))))) + .withTemplate(new Template() + .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerAppTcp:v1") + .withName("testcontainerAppTcp") + .withProbes(Arrays.asList(new ContainerAppProbe().withInitialDelaySeconds(3) + .withPeriodSeconds(3) + .withTcpSocket(new ContainerAppProbeTcpSocket().withPort(8080)) + .withType(Type.LIVENESS))))) + .withScale(new Scale().withMinReplicas(1) + .withMaxReplicas(5) + .withCooldownPeriod(350) + .withPollingInterval(35) + .withRules(Arrays.asList(new ScaleRule().withName("tcpscalingrule") + .withTcp(new TcpScaleRule().withMetadata(mapOf("concurrentConnections", "50"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerApps_Kind_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update App Kind. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateAppKind(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerApps() + .define("testcontainerAppKind") + .withRegion("East Us") + .withExistingResourceGroup("rg") + .withManagedBy( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppKind") + .withKind(Kind.WORKFLOWAPP) + .withManagedEnvironmentId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3") + .withConfiguration(new Configuration().withActiveRevisionsMode(ActiveRevisionsMode.SINGLE) + .withIngress(new Ingress().withExternal(true).withTargetPort(80).withAllowInsecure(true))) + .withTemplate(new Template() + .withContainers(Arrays.asList(new Container().withImage("default/logicapps-base:latest") + .withName("logicapps-container") + .withResources(new ContainerResources().withCpu(1.0D).withMemory("2.0Gi")))) + .withScale( + new Scale().withMinReplicas(1).withMaxReplicas(30).withCooldownPeriod(350).withPollingInterval(35))) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerApps_ManagedBy_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update ManagedBy App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + createOrUpdateManagedByApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerApps() + .define("testcontainerAppManagedBy") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withManagedBy( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.AppPlatform/Spring/springapp") + .withEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") + .withConfiguration(new Configuration().withIngress(new Ingress().withExternal(true) + .withTargetPort(3000) + .withExposedPort(4000) + .withTransport(IngressTransportMethod.TCP) + .withTraffic(Arrays + .asList(new TrafficWeight().withRevisionName("testcontainerAppManagedBy-ab1234").withWeight(100))))) + .withTemplate(new Template() + .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerAppManagedBy:v1") + .withName("testcontainerAppManagedBy") + .withProbes(Arrays.asList(new ContainerAppProbe().withInitialDelaySeconds(3) + .withPeriodSeconds(3) + .withTcpSocket(new ContainerAppProbeTcpSocket().withPort(8080)) + .withType(Type.LIVENESS))))) + .withScale(new Scale().withMinReplicas(1) + .withMaxReplicas(5) + .withCooldownPeriod(350) + .withPollingInterval(35) + .withRules(Arrays.asList(new ScaleRule().withName("tcpscalingrule") + .withTcp(new TcpScaleRule().withMetadata(mapOf("concurrentConnections", "50"))))))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ContainerApps_Delete + +```java +/** + * Samples for ContainerApps Delete. + */ +public final class ContainerAppsDeleteSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Delete.json + */ + /** + * Sample code: Delete Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerApps().delete("rg", "testWorkerApp0", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerApps_GetAuthToken + +```java +/** + * Samples for ContainerApps GetAuthToken. + */ +public final class ContainerAppsGetAuthTokenSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_GetAuthToken. + * json + */ + /** + * Sample code: Get Container App Auth Token. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + getContainerAppAuthToken(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerApps().getAuthTokenWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerApps_GetByResourceGroup + +```java +/** + * Samples for ContainerApps GetByResourceGroup. + */ +public final class ContainerAppsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Get.json + */ + /** + * Sample code: Get Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerApps() + .getByResourceGroupWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerApps_List + +```java +/** + * Samples for ContainerApps List. + */ +public final class ContainerAppsListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerApps_ListBySubscription.json + */ + /** + * Sample code: List Container Apps by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listContainerAppsBySubscription(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerApps().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerApps_ListByResourceGroup + +```java +/** + * Samples for ContainerApps ListByResourceGroup. + */ +public final class ContainerAppsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerApps_ListByResourceGroup.json + */ + /** + * Sample code: List Container Apps by resource group. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listContainerAppsByResourceGroup(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerApps().listByResourceGroup("rg", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerApps_ListCustomHostnameAnalysis + +```java +/** + * Samples for ContainerApps ListCustomHostnameAnalysis. + */ +public final class ContainerAppsListCustomHostnameAnalysisSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerApps_ListCustomHostNameAnalysis.json + */ + /** + * Sample code: Analyze Custom Hostname. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void analyzeCustomHostname(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerApps() + .listCustomHostnameAnalysisWithResponse("rg", "testcontainerApp0", "my.name.corp", + com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerApps_ListSecrets + +```java +/** + * Samples for ContainerApps ListSecrets. + */ +public final class ContainerAppsListSecretsSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_ListSecrets. + * json + */ + /** + * Sample code: List Container Apps Secrets. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listContainerAppsSecrets(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerApps().listSecretsWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerApps_Start + +```java +/** + * Samples for ContainerApps Start. + */ +public final class ContainerAppsStartSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Start.json + */ + /** + * Sample code: Start Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void startContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerApps().start("rg", "testWorkerApp0", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerApps_Stop + +```java +/** + * Samples for ContainerApps Stop. + */ +public final class ContainerAppsStopSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Stop.json + */ + /** + * Sample code: Stop Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void stopContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerApps().stop("rg", "testWorkerApp0", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerApps_Update + +```java +import com.azure.resourcemanager.appcontainers.models.Action; +import com.azure.resourcemanager.appcontainers.models.Affinity; +import com.azure.resourcemanager.appcontainers.models.AppProtocol; +import com.azure.resourcemanager.appcontainers.models.BindingType; +import com.azure.resourcemanager.appcontainers.models.Configuration; +import com.azure.resourcemanager.appcontainers.models.Container; +import com.azure.resourcemanager.appcontainers.models.ContainerApp; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; +import com.azure.resourcemanager.appcontainers.models.ContainerResources; +import com.azure.resourcemanager.appcontainers.models.CustomDomain; +import com.azure.resourcemanager.appcontainers.models.CustomScaleRule; +import com.azure.resourcemanager.appcontainers.models.Dapr; +import com.azure.resourcemanager.appcontainers.models.Ingress; +import com.azure.resourcemanager.appcontainers.models.IngressStickySessions; +import com.azure.resourcemanager.appcontainers.models.InitContainer; +import com.azure.resourcemanager.appcontainers.models.IpSecurityRestrictionRule; +import com.azure.resourcemanager.appcontainers.models.Level; +import com.azure.resourcemanager.appcontainers.models.LoggerSetting; +import com.azure.resourcemanager.appcontainers.models.LogLevel; +import com.azure.resourcemanager.appcontainers.models.Runtime; +import com.azure.resourcemanager.appcontainers.models.RuntimeDotnet; +import com.azure.resourcemanager.appcontainers.models.RuntimeJava; +import com.azure.resourcemanager.appcontainers.models.RuntimeJavaAgent; +import com.azure.resourcemanager.appcontainers.models.RuntimeJavaAgentLogging; +import com.azure.resourcemanager.appcontainers.models.Scale; +import com.azure.resourcemanager.appcontainers.models.ScaleRule; +import com.azure.resourcemanager.appcontainers.models.Service; +import com.azure.resourcemanager.appcontainers.models.ServiceBind; +import com.azure.resourcemanager.appcontainers.models.Template; +import com.azure.resourcemanager.appcontainers.models.TrafficWeight; +import com.azure.resourcemanager.appcontainers.models.Type; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ContainerApps Update. + */ +public final class ContainerAppsUpdateSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Patch.json + */ + /** + * Sample code: Patch Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void patchContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + ContainerApp resource = manager.containerApps() + .getByResourceGroupWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withConfiguration( + new Configuration() + .withIngress(new Ingress().withExternal(true) + .withTargetPort(3000) + .withTraffic(Arrays.asList(new TrafficWeight() + .withRevisionName("testcontainerApp0-ab1234") + .withWeight(100) + .withLabel("production"))) + .withCustomDomains(Arrays.asList(new CustomDomain() + .withName("www.my-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), + new CustomDomain().withName("www.my-other-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"))) + .withIpSecurityRestrictions( + Arrays + .asList( + new IpSecurityRestrictionRule().withName("Allow work IP A subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/32") + .withAction(Action.ALLOW), + new IpSecurityRestrictionRule().withName("Allow work IP B subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/8") + .withAction(Action.ALLOW))) + .withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY))) + .withDapr(new Dapr() + .withEnabled(true) + .withAppProtocol(AppProtocol.HTTP) + .withAppPort(3000) + .withHttpReadBufferSize(30) + .withHttpMaxRequestSize(10) + .withLogLevel(LogLevel.DEBUG) + .withEnableApiLogging(true)) + .withRuntime(new Runtime().withJava(new RuntimeJava().withEnableMetrics(true) + .withJavaAgent(new RuntimeJavaAgent().withEnabled(true) + .withLogging(new RuntimeJavaAgentLogging().withLoggerSettings(Arrays.asList( + new LoggerSetting().withLogger("org.springframework.boot").withLevel(Level.DEBUG)))))) + .withDotnet(new RuntimeDotnet().withAutoConfigureDataProtection(true))) + .withMaxInactiveRevisions(10) + .withService(new Service().withType("redis"))) + .withTemplate(new Template() + .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerApp0:v4") + .withName("testinitcontainerApp0") + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers(Arrays.asList(new Container() + .withImage("repo/testcontainerApp0:v1") + .withName("testcontainerApp0") + .withProbes( + Arrays.asList(new ContainerAppProbe().withHttpGet(new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)).withInitialDelaySeconds(3).withPeriodSeconds(3).withType(Type.LIVENESS))))) + .withScale( + new Scale().withMinReplicas(1) + .withMaxReplicas(5) + .withCooldownPeriod(350) + .withPollingInterval(35) + .withRules( + Arrays.asList(new ScaleRule().withName("httpscalingrule") + .withCustom(new CustomScaleRule().withType("http") + .withMetadata(mapOf("concurrentRequests", "50")))))) + .withServiceBinds(Arrays.asList(new ServiceBind().withServiceId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/service") + .withName("service") + .withClientType("dotnet") + .withCustomizedKeys(mapOf("DesiredKey", "fakeTokenPlaceholder"))))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ContainerAppsAuthConfigs_CreateOrUpdate + +```java +import com.azure.resourcemanager.appcontainers.models.AppRegistration; +import com.azure.resourcemanager.appcontainers.models.AuthPlatform; +import com.azure.resourcemanager.appcontainers.models.EncryptionSettings; +import com.azure.resourcemanager.appcontainers.models.Facebook; +import com.azure.resourcemanager.appcontainers.models.GlobalValidation; +import com.azure.resourcemanager.appcontainers.models.IdentityProviders; +import com.azure.resourcemanager.appcontainers.models.UnauthenticatedClientActionV2; + +/** + * Samples for ContainerAppsAuthConfigs CreateOrUpdate. + */ +public final class ContainerAppsAuthConfigsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AuthConfigs_CreateOrUpdate. + * json + */ + /** + * Sample code: Create or Update Container App AuthConfig. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + createOrUpdateContainerAppAuthConfig(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsAuthConfigs() + .define("current") + .withExistingContainerApp("workerapps-rg-xj", "testcanadacentral") + .withPlatform(new AuthPlatform().withEnabled(true)) + .withGlobalValidation( + new GlobalValidation().withUnauthenticatedClientAction(UnauthenticatedClientActionV2.ALLOW_ANONYMOUS)) + .withIdentityProviders(new IdentityProviders().withFacebook(new Facebook().withRegistration( + new AppRegistration().withAppId("123").withAppSecretSettingName("fakeTokenPlaceholder")))) + .withEncryptionSettings( + new EncryptionSettings().withContainerAppAuthEncryptionSecretName("fakeTokenPlaceholder") + .withContainerAppAuthSigningSecretName("fakeTokenPlaceholder")) + .create(); + } +} +``` + +### ContainerAppsAuthConfigs_Delete + +```java +/** + * Samples for ContainerAppsAuthConfigs Delete. + */ +public final class ContainerAppsAuthConfigsDeleteSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AuthConfigs_Delete.json + */ + /** + * Sample code: Delete Container App AuthConfig. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + deleteContainerAppAuthConfig(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsAuthConfigs() + .deleteWithResponse("workerapps-rg-xj", "testcanadacentral", "current", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsAuthConfigs_Get + +```java +/** + * Samples for ContainerAppsAuthConfigs Get. + */ +public final class ContainerAppsAuthConfigsGetSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AuthConfigs_Get.json + */ + /** + * Sample code: Get Container App's AuthConfig. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + getContainerAppSAuthConfig(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsAuthConfigs() + .getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsAuthConfigs_ListByContainerApp + +```java +/** + * Samples for ContainerAppsAuthConfigs ListByContainerApp. + */ +public final class ContainerAppsAuthConfigsListByContainerAppSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AuthConfigs_ListByContainer. + * json + */ + /** + * Sample code: List Auth Configs by Container Apps. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listAuthConfigsByContainerApps(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsAuthConfigs() + .listByContainerApp("workerapps-rg-xj", "testcanadacentral", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsBuilds_Delete + +```java +/** + * Samples for ContainerAppsBuilds Delete. + */ +public final class ContainerAppsBuildsDeleteSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsBuilds_Delete. + * json + */ + /** + * Sample code: ContainerAppsBuilds_Delete_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + containerAppsBuildsDelete0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsBuilds().delete("rg", "testCapp", "testBuild", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsBuilds_Get + +```java +/** + * Samples for ContainerAppsBuilds Get. + */ +public final class ContainerAppsBuildsGetSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsBuilds_Get.json + */ + /** + * Sample code: ContainerAppsBuilds_Get_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + containerAppsBuildsGet0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsBuilds().getWithResponse("rg", "testCapp", "testBuild", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsBuildsByContainerApp_List + +```java +/** + * Samples for ContainerAppsBuildsByContainerApp List. + */ +public final class ContainerAppsBuildsByContainerAppListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerAppsBuilds_ListByContainerApp.json + */ + /** + * Sample code: ContainerAppsBuilds_ListByContainerApp_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void containerAppsBuildsListByContainerApp0( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsBuildsByContainerApps().list("rg", "testCapp", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsDiagnostics_GetDetector + +```java +/** + * Samples for ContainerAppsDiagnostics GetDetector. + */ +public final class ContainerAppsDiagnosticsGetDetectorSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsDiagnostics_Get + * .json + */ + /** + * Sample code: Get Container App's diagnostics info. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + getContainerAppSDiagnosticsInfo(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsDiagnostics() + .getDetectorWithResponse("mikono-workerapp-test-rg", "mikono-capp-stage1", "cappcontainerappnetworkIO", + com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsDiagnostics_GetRevision + +```java +/** + * Samples for ContainerAppsDiagnostics GetRevision. + */ +public final class ContainerAppsDiagnosticsGetRevisionSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_Get.json + */ + /** + * Sample code: Get Container App's revision. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + getContainerAppSRevision(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsDiagnostics() + .getRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", + com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsDiagnostics_GetRoot + +```java +/** + * Samples for ContainerAppsDiagnostics GetRoot. + */ +public final class ContainerAppsDiagnosticsGetRootSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Get.json + */ + /** + * Sample code: Get Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsDiagnostics() + .getRootWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsDiagnostics_ListDetectors + +```java +/** + * Samples for ContainerAppsDiagnostics ListDetectors. + */ +public final class ContainerAppsDiagnosticsListDetectorsSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerAppsDiagnostics_List.json + */ + /** + * Sample code: Get the list of available diagnostics for a given Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getTheListOfAvailableDiagnosticsForAGivenContainerApp( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsDiagnostics() + .listDetectors("mikono-workerapp-test-rg", "mikono-capp-stage1", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsDiagnostics_ListRevisions + +```java +/** + * Samples for ContainerAppsDiagnostics ListRevisions. + */ +public final class ContainerAppsDiagnosticsListRevisionsSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_List.json + */ + /** + * Sample code: List Container App's revisions. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listContainerAppSRevisions(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsDiagnostics() + .listRevisions("rg", "testcontainerApp0", null, com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsPatches_Apply + +```java +/** + * Samples for ContainerAppsPatches Apply. + */ +public final class ContainerAppsPatchesApplySamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsPatches_Apply. + * json + */ + /** + * Sample code: ContainerAppsPatches_Apply_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + containerAppsPatchesApply0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsPatches().apply("rg", "test-app", "testPatch-25fe4b", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsPatches_Delete + +```java +/** + * Samples for ContainerAppsPatches Delete. + */ +public final class ContainerAppsPatchesDeleteSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsPatches_Delete. + * json + */ + /** + * Sample code: ContainerAppsPatches_Delete_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + containerAppsPatchesDelete0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsPatches().delete("rg", "test-app", "testPatch-25fe4b", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsPatches_Get + +```java +/** + * Samples for ContainerAppsPatches Get. + */ +public final class ContainerAppsPatchesGetSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsPatches_Get. + * json + */ + /** + * Sample code: ContainerAppsPatches_Get_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + containerAppsPatchesGet0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsPatches() + .getWithResponse("rg", "test-app", "testPatch-25fe4b", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsPatches_ListByContainerApp + +```java +/** + * Samples for ContainerAppsPatches ListByContainerApp. + */ +public final class ContainerAppsPatchesListByContainerAppSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerAppsPatches_ListByContainerApp.json + */ + /** + * Sample code: ContainerAppsPatches_ListByContainerApp_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void containerAppsPatchesListByContainerApp0( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsPatches().listByContainerApp("rg", "test-app", null, com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsPatches_SkipConfigure + +```java +import com.azure.resourcemanager.appcontainers.models.PatchSkipConfig; + +/** + * Samples for ContainerAppsPatches SkipConfigure. + */ +public final class ContainerAppsPatchesSkipConfigureSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerAppsPatches_Skip_Configure.json + */ + /** + * Sample code: ContainerAppsPatches_Skip_Configure_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + containerAppsPatchesSkipConfigure0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsPatches() + .skipConfigure("rg", "test-app", "testPatch-25fe4b", new PatchSkipConfig().withSkip(true), + com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsRevisionReplicas_GetReplica + +```java +/** + * Samples for ContainerAppsRevisionReplicas GetReplica. + */ +public final class ContainerAppsRevisionReplicasGetReplicaSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Replicas_Get.json + */ + /** + * Sample code: Get Container App's revision replica. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + getContainerAppSRevisionReplica(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsRevisionReplicas() + .getReplicaWithResponse("workerapps-rg-xj", "myapp", "myapp--0wlqy09", "myapp--0wlqy09-5d9774cff-5wnd8", + com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsRevisionReplicas_ListReplicas + +```java +/** + * Samples for ContainerAppsRevisionReplicas ListReplicas. + */ +public final class ContainerAppsRevisionReplicasListReplicasSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Replicas_List.json + */ + /** + * Sample code: List Container App's replicas. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listContainerAppSReplicas(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsRevisionReplicas() + .listReplicasWithResponse("workerapps-rg-xj", "myapp", "myapp--0wlqy09", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsRevisions_ActivateRevision + +```java +/** + * Samples for ContainerAppsRevisions ActivateRevision. + */ +public final class ContainerAppsRevisionsActivateRevisionSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_Activate.json + */ + /** + * Sample code: Activate Container App's revision. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + activateContainerAppSRevision(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsRevisions() + .activateRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", + com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsRevisions_DeactivateRevision + +```java +/** + * Samples for ContainerAppsRevisions DeactivateRevision. + */ +public final class ContainerAppsRevisionsDeactivateRevisionSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_Deactivate.json + */ + /** + * Sample code: Deactivate Container App's revision. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + deactivateContainerAppSRevision(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsRevisions() + .deactivateRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", + com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsRevisions_GetRevision + +```java +/** + * Samples for ContainerAppsRevisions GetRevision. + */ +public final class ContainerAppsRevisionsGetRevisionSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_Get.json + */ + /** + * Sample code: Get Container App's revision. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + getContainerAppSRevision(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsRevisions() + .getRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", + com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsRevisions_ListRevisions + +```java +/** + * Samples for ContainerAppsRevisions ListRevisions. + */ +public final class ContainerAppsRevisionsListRevisionsSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_List.json + */ + /** + * Sample code: List Container App's revisions. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listContainerAppSRevisions(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsRevisions() + .listRevisions("rg", "testcontainerApp0", null, com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsRevisions_RestartRevision + +```java +/** + * Samples for ContainerAppsRevisions RestartRevision. + */ +public final class ContainerAppsRevisionsRestartRevisionSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_Restart.json + */ + /** + * Sample code: Restart Container App's revision. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + restartContainerAppSRevision(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsRevisions() + .restartRevisionWithResponse("rg", "testStaticSite0", "testcontainerApp0-pjxhsye", + com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsSessionPools_CreateOrUpdate + +```java +import com.azure.resourcemanager.appcontainers.models.ContainerType; +import com.azure.resourcemanager.appcontainers.models.CustomContainerTemplate; +import com.azure.resourcemanager.appcontainers.models.DynamicPoolConfiguration; +import com.azure.resourcemanager.appcontainers.models.ExecutionType; +import com.azure.resourcemanager.appcontainers.models.PoolManagementType; +import com.azure.resourcemanager.appcontainers.models.ScaleConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionContainer; +import com.azure.resourcemanager.appcontainers.models.SessionContainerResources; +import com.azure.resourcemanager.appcontainers.models.SessionIngress; +import com.azure.resourcemanager.appcontainers.models.SessionNetworkConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionNetworkStatus; +import java.util.Arrays; + +/** + * Samples for ContainerAppsSessionPools CreateOrUpdate. + */ +public final class ContainerAppsSessionPoolsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_CreateOrUpdate. + * json + */ + /** + * Sample code: Create or Update Session Pool. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + createOrUpdateSessionPool(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsSessionPools() + .define("testsessionpool") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") + .withContainerType(ContainerType.CUSTOM_CONTAINER) + .withPoolManagementType(PoolManagementType.DYNAMIC) + .withScaleConfiguration( + new ScaleConfiguration().withMaxConcurrentSessions(500).withReadySessionInstances(100)) + .withDynamicPoolConfiguration( + new DynamicPoolConfiguration().withExecutionType(ExecutionType.TIMED).withCooldownPeriodInSeconds(600)) + .withCustomContainerTemplate(new CustomContainerTemplate() + .withContainers(Arrays.asList(new SessionContainer().withImage("repo/testcontainer:v4") + .withName("testinitcontainer") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new SessionContainerResources().withCpu(0.25D).withMemory("0.5Gi")))) + .withIngress(new SessionIngress().withTargetPort(80))) + .withSessionNetworkConfiguration( + new SessionNetworkConfiguration().withStatus(SessionNetworkStatus.EGRESS_ENABLED)) + .create(); + } +} +``` + +### ContainerAppsSessionPools_Delete + +```java +/** + * Samples for ContainerAppsSessionPools Delete. + */ +public final class ContainerAppsSessionPoolsDeleteSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_Delete.json + */ + /** + * Sample code: Delete Session Pool. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteSessionPool(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsSessionPools().delete("rg", "testsessionpool", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsSessionPools_GetByResourceGroup + +```java +/** + * Samples for ContainerAppsSessionPools GetByResourceGroup. + */ +public final class ContainerAppsSessionPoolsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_Get.json + */ + /** + * Sample code: Get Session Pool. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getSessionPool(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsSessionPools() + .getByResourceGroupWithResponse("rg", "testsessionpool", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsSessionPools_List + +```java +/** + * Samples for ContainerAppsSessionPools List. + */ +public final class ContainerAppsSessionPoolsListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * SessionPools_ListBySubscription.json + */ + /** + * Sample code: List Session Pools by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listSessionPoolsBySubscription(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsSessionPools().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsSessionPools_ListByResourceGroup + +```java +/** + * Samples for ContainerAppsSessionPools ListByResourceGroup. + */ +public final class ContainerAppsSessionPoolsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * SessionPools_ListByResourceGroup.json + */ + /** + * Sample code: List Session Pools by resource group. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listSessionPoolsByResourceGroup(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsSessionPools().listByResourceGroup("rg", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsSessionPools_Update + +```java +import com.azure.resourcemanager.appcontainers.models.CustomContainerTemplate; +import com.azure.resourcemanager.appcontainers.models.DynamicPoolConfiguration; +import com.azure.resourcemanager.appcontainers.models.ExecutionType; +import com.azure.resourcemanager.appcontainers.models.ScaleConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionContainer; +import com.azure.resourcemanager.appcontainers.models.SessionContainerResources; +import com.azure.resourcemanager.appcontainers.models.SessionIngress; +import com.azure.resourcemanager.appcontainers.models.SessionNetworkConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionNetworkStatus; +import com.azure.resourcemanager.appcontainers.models.SessionPool; +import java.util.Arrays; + +/** + * Samples for ContainerAppsSessionPools Update. + */ +public final class ContainerAppsSessionPoolsUpdateSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_Patch.json + */ + /** + * Sample code: Update Session Pool. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void updateSessionPool(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + SessionPool resource = manager.containerAppsSessionPools() + .getByResourceGroupWithResponse("rg", "testsessionpool", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withScaleConfiguration( + new ScaleConfiguration().withMaxConcurrentSessions(500).withReadySessionInstances(100)) + .withDynamicPoolConfiguration( + new DynamicPoolConfiguration().withExecutionType(ExecutionType.TIMED).withCooldownPeriodInSeconds(600)) + .withCustomContainerTemplate(new CustomContainerTemplate() + .withContainers(Arrays.asList(new SessionContainer().withImage("repo/testcontainer:v4") + .withName("testinitcontainer") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new SessionContainerResources().withCpu(0.25D).withMemory("0.5Gi")))) + .withIngress(new SessionIngress().withTargetPort(80))) + .withSessionNetworkConfiguration( + new SessionNetworkConfiguration().withStatus(SessionNetworkStatus.EGRESS_ENABLED)) + .apply(); + } +} +``` + +### ContainerAppsSourceControls_CreateOrUpdate + +```java +import com.azure.resourcemanager.appcontainers.models.AzureCredentials; +import com.azure.resourcemanager.appcontainers.models.EnvironmentVariable; +import com.azure.resourcemanager.appcontainers.models.GithubActionConfiguration; +import com.azure.resourcemanager.appcontainers.models.RegistryInfo; +import java.util.Arrays; + +/** + * Samples for ContainerAppsSourceControls CreateOrUpdate. + */ +public final class ContainerAppsSourceControlsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * SourceControls_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Container App SourceControl. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateContainerAppSourceControl( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsSourceControls() + .define("current") + .withExistingContainerApp("workerapps-rg-xj", "testcanadacentral") + .withRepoUrl("https://github.com/xwang971/ghatest") + .withBranch("master") + .withGithubActionConfiguration(new GithubActionConfiguration() + .withRegistryInfo(new RegistryInfo().withRegistryUrl("test-registry.azurecr.io") + .withRegistryUsername("test-registry") + .withRegistryPassword("fakeTokenPlaceholder")) + .withAzureCredentials(new AzureCredentials().withClientId("") + .withClientSecret("fakeTokenPlaceholder") + .withTenantId("") + .withKind("feaderated")) + .withContextPath("./") + .withDockerfilePath("./Dockerfile") + .withGithubPersonalAccessToken("fakeTokenPlaceholder") + .withImage("image/tag") + .withBuildEnvironmentVariables( + Arrays.asList(new EnvironmentVariable().withName("foo1").withValue("bar1"), + new EnvironmentVariable().withName("foo2").withValue("bar2")))) + .withXMsGithubAuxiliary("githubaccesstoken") + .create(); + } +} +``` + +### ContainerAppsSourceControls_Delete ```java /** - * Samples for ConnectedEnvironmentsStorages Delete. + * Samples for ContainerAppsSourceControls Delete. */ -public final class ConnectedEnvironmentsStoragesDeleteSamples { +public final class ContainerAppsSourceControlsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsStorages_Delete. - * json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SourceControls_Delete.json */ /** - * Sample code: List environments storages by subscription. + * Sample code: Delete Container App SourceControl. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void listEnvironmentsStoragesBySubscription( - com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsStorages() - .deleteWithResponse("examplerg", "env", "jlaw-demo1", com.azure.core.util.Context.NONE); + public static void + deleteContainerAppSourceControl(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsSourceControls() + .delete("workerapps-rg-xj", "testcanadacentral", "current", "githubaccesstoken", false, false, + com.azure.core.util.Context.NONE); } } ``` -### ConnectedEnvironmentsStorages_Get +### ContainerAppsSourceControls_Get ```java /** - * Samples for ConnectedEnvironmentsStorages Get. + * Samples for ContainerAppsSourceControls Get. */ -public final class ConnectedEnvironmentsStoragesGetSamples { +public final class ContainerAppsSourceControlsGetSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsStorages_Get. - * json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SourceControls_Get.json */ /** - * Sample code: get a environments storage properties by subscription. + * Sample code: Get Container App's SourceControl. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void getAEnvironmentsStoragePropertiesBySubscription( - com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsStorages() - .getWithResponse("examplerg", "env", "jlaw-demo1", com.azure.core.util.Context.NONE); + public static void + getContainerAppSSourceControl(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsSourceControls() + .getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", com.azure.core.util.Context.NONE); } } ``` -### ConnectedEnvironmentsStorages_List +### ContainerAppsSourceControls_ListByContainerApp ```java /** - * Samples for ConnectedEnvironmentsStorages List. + * Samples for ContainerAppsSourceControls ListByContainerApp. */ -public final class ConnectedEnvironmentsStoragesListSamples { +public final class ContainerAppsSourceControlsListByContainerAppSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsStorages_List. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * SourceControls_ListByContainer.json */ /** - * Sample code: List environments storages by subscription. + * Sample code: List App's Source Controls. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void listEnvironmentsStoragesBySubscription( - com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsStorages() - .listWithResponse("examplerg", "managedEnv", com.azure.core.util.Context.NONE); + public static void listAppSSourceControls(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsSourceControls() + .listByContainerApp("workerapps-rg-xj", "testcanadacentral", com.azure.core.util.Context.NONE); } } ``` -### ContainerApps_CreateOrUpdate +### DaprComponentResiliencyPolicies_CreateOrUpdate ```java -import com.azure.resourcemanager.appcontainers.models.Action; -import com.azure.resourcemanager.appcontainers.models.Affinity; -import com.azure.resourcemanager.appcontainers.models.AppProtocol; -import com.azure.resourcemanager.appcontainers.models.BindingType; -import com.azure.resourcemanager.appcontainers.models.Configuration; -import com.azure.resourcemanager.appcontainers.models.Container; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeTcpSocket; -import com.azure.resourcemanager.appcontainers.models.ContainerResources; -import com.azure.resourcemanager.appcontainers.models.CorsPolicy; -import com.azure.resourcemanager.appcontainers.models.CustomDomain; -import com.azure.resourcemanager.appcontainers.models.CustomScaleRule; -import com.azure.resourcemanager.appcontainers.models.Dapr; -import com.azure.resourcemanager.appcontainers.models.Ingress; -import com.azure.resourcemanager.appcontainers.models.IngressClientCertificateMode; -import com.azure.resourcemanager.appcontainers.models.IngressPortMapping; -import com.azure.resourcemanager.appcontainers.models.IngressStickySessions; -import com.azure.resourcemanager.appcontainers.models.IngressTransportMethod; -import com.azure.resourcemanager.appcontainers.models.InitContainer; -import com.azure.resourcemanager.appcontainers.models.IpSecurityRestrictionRule; -import com.azure.resourcemanager.appcontainers.models.LogLevel; -import com.azure.resourcemanager.appcontainers.models.Scale; -import com.azure.resourcemanager.appcontainers.models.ScaleRule; -import com.azure.resourcemanager.appcontainers.models.Service; -import com.azure.resourcemanager.appcontainers.models.ServiceBind; -import com.azure.resourcemanager.appcontainers.models.TcpScaleRule; -import com.azure.resourcemanager.appcontainers.models.Template; -import com.azure.resourcemanager.appcontainers.models.TrafficWeight; -import com.azure.resourcemanager.appcontainers.models.Type; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicyConfiguration; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration; /** - * Samples for ContainerApps CreateOrUpdate. + * Samples for DaprComponentResiliencyPolicies CreateOrUpdate. */ -public final class ContainerAppsCreateOrUpdateSamples { +public final class DaprComponentResiliencyPoliciesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprComponentResiliencyPolicy_CreateOrUpdate_OutboundOnly.json */ /** - * Sample code: Create or Update Container App. + * Sample code: Create or update dapr component resiliency policy with outbound policy only. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - createOrUpdateContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps() - .define("testcontainerapp0") - .withRegion("East US") - .withExistingResourceGroup("rg") - .withEnvironmentId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") - .withWorkloadProfileName("My-GP-01") - .withConfiguration( - new Configuration() - .withIngress(new Ingress().withExternal(true) - .withTargetPort(3000) - .withTraffic(Arrays.asList(new TrafficWeight() - .withRevisionName("testcontainerapp0-ab1234") - .withWeight(100) - .withLabel("production"))) - .withCustomDomains(Arrays.asList(new CustomDomain() - .withName("www.my-name.com") - .withBindingType(BindingType.SNI_ENABLED) - .withCertificateId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), - new CustomDomain().withName("www.my-other-name.com") - .withBindingType(BindingType.SNI_ENABLED) - .withCertificateId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"))) - .withIpSecurityRestrictions( - Arrays - .asList( - new IpSecurityRestrictionRule().withName("Allow work IP A subnet") - .withDescription( - "Allowing all IP's within the subnet below to access containerapp") - .withIpAddressRange("192.168.1.1/32") - .withAction(Action.ALLOW), - new IpSecurityRestrictionRule().withName("Allow work IP B subnet") - .withDescription( - "Allowing all IP's within the subnet below to access containerapp") - .withIpAddressRange("192.168.1.1/8") - .withAction(Action.ALLOW))) - .withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY)) - .withClientCertificateMode(IngressClientCertificateMode.ACCEPT) - .withCorsPolicy(new CorsPolicy() - .withAllowedOrigins(Arrays.asList("https://a.test.com", "https://b.test.com")) - .withAllowedMethods(Arrays.asList("GET", "POST")) - .withAllowedHeaders(Arrays.asList("HEADER1", "HEADER2")) - .withExposeHeaders(Arrays.asList("HEADER3", "HEADER4")) - .withMaxAge(1234) - .withAllowCredentials(true)) - .withAdditionalPortMappings(Arrays.asList( - new IngressPortMapping().withExternal(true).withTargetPort(1234), - new IngressPortMapping().withExternal(false).withTargetPort(2345).withExposedPort(3456)))) - .withDapr(new Dapr().withEnabled(true) - .withAppProtocol(AppProtocol.HTTP) - .withAppPort(3000) - .withHttpReadBufferSize(30) - .withHttpMaxRequestSize(10) - .withLogLevel(LogLevel.DEBUG) - .withEnableApiLogging(true)) - .withMaxInactiveRevisions(10) - .withService(new Service().withType("redis"))) - .withTemplate(new Template() - .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerapp0:v4") - .withName("testinitcontainerApp0") - .withCommand(Arrays.asList("/bin/sh")) - .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) - .withResources(new ContainerResources().withCpu(0.5D).withMemory("1Gi")))) - .withContainers(Arrays.asList(new Container() - .withImage("repo/testcontainerapp0:v1") - .withName("testcontainerapp0") - .withProbes( - Arrays.asList(new ContainerAppProbe().withHttpGet(new ContainerAppProbeHttpGet() - .withHttpHeaders( - Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("Custom-Header") - .withValue("Awesome"))) - .withPath("/health") - .withPort(8080)).withInitialDelaySeconds(3).withPeriodSeconds(3).withType(Type.LIVENESS))))) - .withScale( - new Scale().withMinReplicas(1) - .withMaxReplicas(5) - .withRules( - Arrays.asList(new ScaleRule().withName("httpscalingrule") - .withCustom(new CustomScaleRule().withType("http") - .withMetadata(mapOf("concurrentRequests", "50")))))) - .withServiceBinds(Arrays.asList(new ServiceBind().withServiceId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/redisService") - .withName("redisService")))) + public static void createOrUpdateDaprComponentResiliencyPolicyWithOutboundPolicyOnly( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprComponentResiliencyPolicies() + .define("myresiliencypolicy") + .withExistingDaprComponent("examplerg", "myenvironment", "mydaprcomponent") + .withOutboundPolicy(new DaprComponentResiliencyPolicyConfiguration() + .withHttpRetryPolicy(new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration().withMaxRetries(5) + .withRetryBackOff(new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() + .withInitialDelayInMilliseconds(100) + .withMaxIntervalInMilliseconds(30000))) + .withTimeoutPolicy( + new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration().withResponseTimeoutInSeconds(12)) + .withCircuitBreakerPolicy( + new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration().withConsecutiveErrors(3) + .withTimeoutInSeconds(20) + .withIntervalInSeconds(60))) .create(); } /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_TcpApp_CreateOrUpdate. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprComponentResiliencyPolicy_CreateOrUpdate_AllOptions.json */ /** - * Sample code: Create or Update Tcp App. + * Sample code: Create or update dapr component resiliency policy with all options. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void createOrUpdateTcpApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps() - .define("testcontainerapptcp") - .withRegion("East US") - .withExistingResourceGroup("rg") - .withEnvironmentId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") - .withConfiguration( - new Configuration().withIngress(new Ingress().withExternal(true) - .withTargetPort(3000) - .withExposedPort(4000) - .withTransport(IngressTransportMethod.TCP) - .withTraffic(Arrays - .asList(new TrafficWeight().withRevisionName("testcontainerapptcp-ab1234").withWeight(100))))) - .withTemplate(new Template() - .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerapptcp:v1") - .withName("testcontainerapptcp") - .withProbes(Arrays.asList(new ContainerAppProbe().withInitialDelaySeconds(3) - .withPeriodSeconds(3) - .withTcpSocket(new ContainerAppProbeTcpSocket().withPort(8080)) - .withType(Type.LIVENESS))))) - .withScale(new Scale().withMinReplicas(1) - .withMaxReplicas(5) - .withRules(Arrays.asList(new ScaleRule().withName("tcpscalingrule") - .withTcp(new TcpScaleRule().withMetadata(mapOf("concurrentConnections", "50"))))))) + public static void createOrUpdateDaprComponentResiliencyPolicyWithAllOptions( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprComponentResiliencyPolicies() + .define("myresiliencypolicy") + .withExistingDaprComponent("examplerg", "myenvironment", "mydaprcomponent") + .withInboundPolicy(new DaprComponentResiliencyPolicyConfiguration() + .withHttpRetryPolicy(new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration().withMaxRetries(15) + .withRetryBackOff(new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() + .withInitialDelayInMilliseconds(2000) + .withMaxIntervalInMilliseconds(5500))) + .withTimeoutPolicy( + new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration().withResponseTimeoutInSeconds(30)) + .withCircuitBreakerPolicy( + new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration().withConsecutiveErrors(5) + .withTimeoutInSeconds(10) + .withIntervalInSeconds(4))) + .withOutboundPolicy(new DaprComponentResiliencyPolicyConfiguration() + .withHttpRetryPolicy(new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration().withMaxRetries(5) + .withRetryBackOff(new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() + .withInitialDelayInMilliseconds(100) + .withMaxIntervalInMilliseconds(30000))) + .withTimeoutPolicy( + new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration().withResponseTimeoutInSeconds(12)) + .withCircuitBreakerPolicy( + new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration().withConsecutiveErrors(3) + .withTimeoutInSeconds(20) + .withIntervalInSeconds(60))) .create(); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ - * ContainerApps_ManagedBy_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprComponentResiliencyPolicy_CreateOrUpdate_SparseOptions.json */ /** - * Sample code: Create or Update ManagedBy App. + * Sample code: Create or update dapr component resiliency policy with sparse options. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - createOrUpdateManagedByApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps() - .define("testcontainerappmanagedby") - .withRegion("East US") - .withExistingResourceGroup("rg") - .withManagedBy( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.AppPlatform/Spring/springapp") - .withEnvironmentId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") - .withConfiguration(new Configuration().withIngress(new Ingress().withExternal(true) - .withTargetPort(3000) - .withExposedPort(4000) - .withTransport(IngressTransportMethod.TCP) - .withTraffic(Arrays - .asList(new TrafficWeight().withRevisionName("testcontainerappmanagedby-ab1234").withWeight(100))))) - .withTemplate(new Template() - .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerappmanagedby:v1") - .withName("testcontainerappmanagedby") - .withProbes(Arrays.asList(new ContainerAppProbe().withInitialDelaySeconds(3) - .withPeriodSeconds(3) - .withTcpSocket(new ContainerAppProbeTcpSocket().withPort(8080)) - .withType(Type.LIVENESS))))) - .withScale(new Scale().withMinReplicas(1) - .withMaxReplicas(5) - .withRules(Arrays.asList(new ScaleRule().withName("tcpscalingrule") - .withTcp(new TcpScaleRule().withMetadata(mapOf("concurrentConnections", "50"))))))) + public static void createOrUpdateDaprComponentResiliencyPolicyWithSparseOptions( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprComponentResiliencyPolicies() + .define("myresiliencypolicy") + .withExistingDaprComponent("examplerg", "myenvironment", "mydaprcomponent") + .withInboundPolicy(new DaprComponentResiliencyPolicyConfiguration() + .withHttpRetryPolicy(new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration().withMaxRetries(5) + .withRetryBackOff(new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() + .withInitialDelayInMilliseconds(2000) + .withMaxIntervalInMilliseconds(5500))) + .withCircuitBreakerPolicy( + new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration().withConsecutiveErrors(3) + .withTimeoutInSeconds(20))) + .withOutboundPolicy(new DaprComponentResiliencyPolicyConfiguration().withTimeoutPolicy( + new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration().withResponseTimeoutInSeconds(12))) .create(); } +} +``` - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; +### DaprComponentResiliencyPolicies_Delete + +```java +/** + * Samples for DaprComponentResiliencyPolicies Delete. + */ +public final class DaprComponentResiliencyPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprComponentResiliencyPolicies_Delete.json + */ + /** + * Sample code: Delete dapr component resiliency policy. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + deleteDaprComponentResiliencyPolicy(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprComponentResiliencyPolicies() + .deleteWithResponse("examplerg", "myenvironment", "mydaprcomponent", "myresiliencypolicy", + com.azure.core.util.Context.NONE); } } ``` -### ContainerApps_Delete +### DaprComponentResiliencyPolicies_Get ```java /** - * Samples for ContainerApps Delete. + * Samples for DaprComponentResiliencyPolicies Get. */ -public final class ContainerAppsDeleteSamples { +public final class DaprComponentResiliencyPoliciesGetSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprComponentResiliencyPolicies_Get.json */ /** - * Sample code: Delete Container App. + * Sample code: Get Dapr component resiliency policy. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void deleteContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().delete("rg", "testworkerapp0", com.azure.core.util.Context.NONE); + public static void + getDaprComponentResiliencyPolicy(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprComponentResiliencyPolicies() + .getWithResponse("examplerg", "myenvironment", "mydaprcomponent", "myresiliencypolicy", + com.azure.core.util.Context.NONE); } } ``` -### ContainerApps_GetAuthToken +### DaprComponentResiliencyPolicies_List ```java /** - * Samples for ContainerApps GetAuthToken. + * Samples for DaprComponentResiliencyPolicies List. */ -public final class ContainerAppsGetAuthTokenSamples { +public final class DaprComponentResiliencyPoliciesListSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_GetAuthToken.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprComponentResiliencyPolicies_List.json */ /** - * Sample code: Get Container App Auth Token. + * Sample code: List Dapr component resiliency policies. * * @param manager Entry point to ContainerAppsApiManager. */ public static void - getContainerAppAuthToken(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().getAuthTokenWithResponse("rg", "testcontainerapp0", com.azure.core.util.Context.NONE); + listDaprComponentResiliencyPolicies(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprComponentResiliencyPolicies() + .list("examplerg", "myenvironment", "mydaprcomponent", com.azure.core.util.Context.NONE); } } ``` -### ContainerApps_GetByResourceGroup +### DaprComponents_CreateOrUpdate ```java +import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentInner; +import com.azure.resourcemanager.appcontainers.models.DaprComponentServiceBinding; +import com.azure.resourcemanager.appcontainers.models.DaprMetadata; +import com.azure.resourcemanager.appcontainers.models.DaprServiceBindMetadata; +import com.azure.resourcemanager.appcontainers.models.Secret; +import java.util.Arrays; + /** - * Samples for ContainerApps GetByResourceGroup. + * Samples for DaprComponents CreateOrUpdate. */ -public final class ContainerAppsGetByResourceGroupSamples { +public final class DaprComponentsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprComponents_CreateOrUpdate_Secrets.json */ /** - * Sample code: Get Container App. + * Sample code: Create or update dapr component with secrets. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void getContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps() - .getByResourceGroupWithResponse("rg", "testcontainerapp0", com.azure.core.util.Context.NONE); + public static void createOrUpdateDaprComponentWithSecrets( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprComponents() + .createOrUpdateWithResponse("examplerg", "myenvironment", "reddog", + new DaprComponentInner().withComponentType("state.azure.cosmosdb") + .withVersion("v1") + .withIgnoreErrors(false) + .withInitTimeout("50s") + .withSecrets(Arrays.asList(new Secret().withName("masterkey").withValue("keyvalue"))) + .withMetadata(Arrays.asList(new DaprMetadata().withName("url").withValue(""), + new DaprMetadata().withName("database").withValue("itemsDB"), + new DaprMetadata().withName("collection").withValue("items"), + new DaprMetadata().withName("masterkey").withSecretRef("fakeTokenPlaceholder"))) + .withScopes(Arrays.asList("container-app-1", "container-app-2")) + .withServiceComponentBind(Arrays.asList(new DaprComponentServiceBinding().withName("statestore") + .withServiceId( + "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis") + .withMetadata( + new DaprServiceBindMetadata().withName("daprcomponentBind").withValue("redis-bind")))), + com.azure.core.util.Context.NONE); } -} -``` - -### ContainerApps_List -```java -/** - * Samples for ContainerApps List. - */ -public final class ContainerAppsListSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_ListBySubscription.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprComponents_CreateOrUpdate_SecretStoreComponent.json */ /** - * Sample code: List Container Apps by subscription. + * Sample code: Create or update dapr component with secret store component. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - listContainerAppsBySubscription(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().list(com.azure.core.util.Context.NONE); + public static void createOrUpdateDaprComponentWithSecretStoreComponent( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprComponents() + .createOrUpdateWithResponse("examplerg", "myenvironment", "reddog", + new DaprComponentInner().withComponentType("state.azure.cosmosdb") + .withVersion("v1") + .withIgnoreErrors(false) + .withInitTimeout("50s") + .withSecretStoreComponent("fakeTokenPlaceholder") + .withMetadata(Arrays.asList(new DaprMetadata().withName("url").withValue(""), + new DaprMetadata().withName("database").withValue("itemsDB"), + new DaprMetadata().withName("collection").withValue("items"), + new DaprMetadata().withName("masterkey").withSecretRef("fakeTokenPlaceholder"))) + .withScopes(Arrays.asList("container-app-1", "container-app-2")) + .withServiceComponentBind(Arrays.asList(new DaprComponentServiceBinding().withName("statestore") + .withServiceId( + "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis") + .withMetadata( + new DaprServiceBindMetadata().withName("daprcomponentBind").withValue("redis-bind")))), + com.azure.core.util.Context.NONE); } } ``` -### ContainerApps_ListByResourceGroup +### DaprComponents_Delete ```java /** - * Samples for ContainerApps ListByResourceGroup. + * Samples for DaprComponents Delete. */ -public final class ContainerAppsListByResourceGroupSamples { +public final class DaprComponentsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_ListByResourceGroup. - * json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_Delete.json */ /** - * Sample code: List Container Apps by resource group. + * Sample code: Delete dapr component. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - listContainerAppsByResourceGroup(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().listByResourceGroup("rg", com.azure.core.util.Context.NONE); + public static void deleteDaprComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprComponents() + .deleteWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } } ``` -### ContainerApps_ListCustomHostnameAnalysis +### DaprComponents_Get ```java /** - * Samples for ContainerApps ListCustomHostnameAnalysis. + * Samples for DaprComponents Get. */ -public final class ContainerAppsListCustomHostnameAnalysisSamples { +public final class DaprComponentsGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ - * ContainerApps_ListCustomHostNameAnalysis.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprComponents_Get_SecretStoreComponent.json */ /** - * Sample code: Analyze Custom Hostname. + * Sample code: Get Dapr Component with secret store component. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void analyzeCustomHostname(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps() - .listCustomHostnameAnalysisWithResponse("rg", "testcontainerapp0", "my.name.corp", - com.azure.core.util.Context.NONE); + public static void getDaprComponentWithSecretStoreComponent( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprComponents() + .getWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } -} -``` - -### ContainerApps_ListSecrets -```java -/** - * Samples for ContainerApps ListSecrets. - */ -public final class ContainerAppsListSecretsSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_ListSecrets.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_Get_Secrets. + * json */ /** - * Sample code: List Container Apps Secrets. + * Sample code: Get Dapr Component with secrets. * * @param manager Entry point to ContainerAppsApiManager. */ public static void - listContainerAppsSecrets(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().listSecretsWithResponse("rg", "testcontainerapp0", com.azure.core.util.Context.NONE); + getDaprComponentWithSecrets(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprComponents() + .getWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } } ``` -### ContainerApps_Start +### DaprComponents_List ```java /** - * Samples for ContainerApps Start. + * Samples for DaprComponents List. */ -public final class ContainerAppsStartSamples { +public final class DaprComponentsListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Start.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_List.json */ /** - * Sample code: Start Container App. + * Sample code: List Dapr Components. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void startContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().start("rg", "testworkerapp0", com.azure.core.util.Context.NONE); + public static void listDaprComponents(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprComponents().list("examplerg", "myenvironment", com.azure.core.util.Context.NONE); } } ``` -### ContainerApps_Stop +### DaprComponents_ListSecrets ```java /** - * Samples for ContainerApps Stop. + * Samples for DaprComponents ListSecrets. */ -public final class ContainerAppsStopSamples { +public final class DaprComponentsListSecretsSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Stop.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_ListSecrets. + * json */ /** - * Sample code: Stop Container App. + * Sample code: List Container Apps Secrets. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void stopContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().stop("rg", "testworkerApp0", com.azure.core.util.Context.NONE); + public static void + listContainerAppsSecrets(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprComponents() + .listSecretsWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } } ``` -### ContainerApps_Update +### DaprSubscriptions_CreateOrUpdate ```java -import com.azure.resourcemanager.appcontainers.models.Action; -import com.azure.resourcemanager.appcontainers.models.Affinity; -import com.azure.resourcemanager.appcontainers.models.AppProtocol; -import com.azure.resourcemanager.appcontainers.models.BindingType; -import com.azure.resourcemanager.appcontainers.models.Configuration; -import com.azure.resourcemanager.appcontainers.models.Container; -import com.azure.resourcemanager.appcontainers.models.ContainerApp; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; -import com.azure.resourcemanager.appcontainers.models.ContainerResources; -import com.azure.resourcemanager.appcontainers.models.CustomDomain; -import com.azure.resourcemanager.appcontainers.models.CustomScaleRule; -import com.azure.resourcemanager.appcontainers.models.Dapr; -import com.azure.resourcemanager.appcontainers.models.Ingress; -import com.azure.resourcemanager.appcontainers.models.IngressStickySessions; -import com.azure.resourcemanager.appcontainers.models.InitContainer; -import com.azure.resourcemanager.appcontainers.models.IpSecurityRestrictionRule; -import com.azure.resourcemanager.appcontainers.models.LogLevel; -import com.azure.resourcemanager.appcontainers.models.Scale; -import com.azure.resourcemanager.appcontainers.models.ScaleRule; -import com.azure.resourcemanager.appcontainers.models.Service; -import com.azure.resourcemanager.appcontainers.models.ServiceBind; -import com.azure.resourcemanager.appcontainers.models.Template; -import com.azure.resourcemanager.appcontainers.models.TrafficWeight; -import com.azure.resourcemanager.appcontainers.models.Type; +import com.azure.resourcemanager.appcontainers.models.DaprSubscriptionBulkSubscribeOptions; +import com.azure.resourcemanager.appcontainers.models.DaprSubscriptionRouteRule; +import com.azure.resourcemanager.appcontainers.models.DaprSubscriptionRoutes; import java.util.Arrays; import java.util.HashMap; import java.util.Map; /** - * Samples for ContainerApps Update. + * Samples for DaprSubscriptions CreateOrUpdate. */ -public final class ContainerAppsUpdateSamples { +public final class DaprSubscriptionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Patch.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprSubscriptions_CreateOrUpdate_RouteRulesAndMetadata.json */ /** - * Sample code: Patch Container App. + * Sample code: Create or update dapr subscription with route rules and metadata. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void patchContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - ContainerApp resource = manager.containerApps() - .getByResourceGroupWithResponse("rg", "testcontainerapp0", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withConfiguration( - new Configuration() - .withIngress(new Ingress().withExternal(true) - .withTargetPort(3000) - .withTraffic(Arrays.asList(new TrafficWeight() - .withRevisionName("testcontainerapp0-ab1234") - .withWeight(100) - .withLabel("production"))) - .withCustomDomains(Arrays.asList(new CustomDomain() - .withName("www.my-name.com") - .withBindingType(BindingType.SNI_ENABLED) - .withCertificateId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), - new CustomDomain().withName("www.my-other-name.com") - .withBindingType(BindingType.SNI_ENABLED) - .withCertificateId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"))) - .withIpSecurityRestrictions( - Arrays - .asList( - new IpSecurityRestrictionRule().withName("Allow work IP A subnet") - .withDescription( - "Allowing all IP's within the subnet below to access containerapp") - .withIpAddressRange("192.168.1.1/32") - .withAction(Action.ALLOW), - new IpSecurityRestrictionRule().withName("Allow work IP B subnet") - .withDescription( - "Allowing all IP's within the subnet below to access containerapp") - .withIpAddressRange("192.168.1.1/8") - .withAction(Action.ALLOW))) - .withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY))) - .withDapr(new Dapr().withEnabled(true) - .withAppProtocol(AppProtocol.HTTP) - .withAppPort(3000) - .withHttpReadBufferSize(30) - .withHttpMaxRequestSize(10) - .withLogLevel(LogLevel.DEBUG) - .withEnableApiLogging(true)) - .withMaxInactiveRevisions(10) - .withService(new Service().withType("redis"))) - .withTemplate(new Template() - .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerapp0:v4") - .withName("testinitcontainerApp0") - .withResources(new ContainerResources().withCpu(0.5D).withMemory("1Gi")))) - .withContainers(Arrays.asList(new Container() - .withImage("repo/testcontainerapp0:v1") - .withName("testcontainerapp0") - .withProbes( - Arrays.asList(new ContainerAppProbe().withHttpGet(new ContainerAppProbeHttpGet() - .withHttpHeaders( - Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("Custom-Header") - .withValue("Awesome"))) - .withPath("/health") - .withPort(8080)).withInitialDelaySeconds(3).withPeriodSeconds(3).withType(Type.LIVENESS))))) - .withScale( - new Scale().withMinReplicas(1) - .withMaxReplicas(5) - .withRules( - Arrays.asList(new ScaleRule().withName("httpscalingrule") - .withCustom(new CustomScaleRule().withType("http") - .withMetadata(mapOf("concurrentRequests", "50")))))) - .withServiceBinds(Arrays.asList(new ServiceBind().withServiceId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/service") - .withName("service")))) - .apply(); + public static void createOrUpdateDaprSubscriptionWithRouteRulesAndMetadata( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprSubscriptions() + .define("mysubscription") + .withExistingManagedEnvironment("examplerg", "myenvironment") + .withPubsubName("mypubsubcomponent") + .withTopic("inventory") + .withRoutes(new DaprSubscriptionRoutes() + .withRules(Arrays.asList( + new DaprSubscriptionRouteRule().withMatch("event.type == 'widget'").withPath("/widgets"), + new DaprSubscriptionRouteRule().withMatch("event.type == 'gadget'").withPath("/gadgets"))) + .withDefaultProperty("/products")) + .withMetadata(mapOf("foo", "bar", "hello", "world")) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprSubscriptions_CreateOrUpdate_DefaultRoute.json + */ + /** + * Sample code: Create or update dapr subscription with default route only. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateDaprSubscriptionWithDefaultRouteOnly( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprSubscriptions() + .define("mysubscription") + .withExistingManagedEnvironment("examplerg", "myenvironment") + .withPubsubName("mypubsubcomponent") + .withTopic("inventory") + .withRoutes(new DaprSubscriptionRoutes().withDefaultProperty("/products")) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprSubscriptions_CreateOrUpdate_BulkSubscribeAndScopes.json + */ + /** + * Sample code: Create or update dapr subscription with bulk subscribe configuration and scopes. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateDaprSubscriptionWithBulkSubscribeConfigurationAndScopes( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprSubscriptions() + .define("mysubscription") + .withExistingManagedEnvironment("examplerg", "myenvironment") + .withPubsubName("mypubsubcomponent") + .withTopic("inventory") + .withRoutes(new DaprSubscriptionRoutes().withDefaultProperty("/products")) + .withScopes(Arrays.asList("warehouseapp", "customersupportapp")) + .withBulkSubscribe(new DaprSubscriptionBulkSubscribeOptions().withEnabled(true) + .withMaxMessagesCount(123) + .withMaxAwaitDurationMs(500)) + .create(); } // Use "Map.of" if available @@ -1509,1160 +3894,1407 @@ public final class ContainerAppsUpdateSamples { } ``` -### ContainerAppsAuthConfigs_CreateOrUpdate +### DaprSubscriptions_Delete ```java -import com.azure.resourcemanager.appcontainers.models.AppRegistration; -import com.azure.resourcemanager.appcontainers.models.AuthPlatform; -import com.azure.resourcemanager.appcontainers.models.EncryptionSettings; -import com.azure.resourcemanager.appcontainers.models.Facebook; -import com.azure.resourcemanager.appcontainers.models.GlobalValidation; -import com.azure.resourcemanager.appcontainers.models.IdentityProviders; -import com.azure.resourcemanager.appcontainers.models.UnauthenticatedClientActionV2; - /** - * Samples for ContainerAppsAuthConfigs CreateOrUpdate. + * Samples for DaprSubscriptions Delete. */ -public final class ContainerAppsAuthConfigsCreateOrUpdateSamples { +public final class DaprSubscriptionsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/AuthConfigs_CreateOrUpdate.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprSubscriptions_Delete. + * json */ /** - * Sample code: Create or Update Container App AuthConfig. + * Sample code: Delete dapr subscription. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - createOrUpdateContainerAppAuthConfig(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsAuthConfigs() - .define("current") - .withExistingContainerApp("workerapps-rg-xj", "testcanadacentral") - .withPlatform(new AuthPlatform().withEnabled(true)) - .withGlobalValidation( - new GlobalValidation().withUnauthenticatedClientAction(UnauthenticatedClientActionV2.ALLOW_ANONYMOUS)) - .withIdentityProviders(new IdentityProviders().withFacebook(new Facebook().withRegistration( - new AppRegistration().withAppId("123").withAppSecretSettingName("fakeTokenPlaceholder")))) - .withEncryptionSettings( - new EncryptionSettings().withContainerAppAuthEncryptionSecretName("fakeTokenPlaceholder") - .withContainerAppAuthSigningSecretName("fakeTokenPlaceholder")) - .create(); + public static void deleteDaprSubscription(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprSubscriptions() + .deleteWithResponse("examplerg", "myenvironment", "mysubscription", com.azure.core.util.Context.NONE); } } ``` -### ContainerAppsAuthConfigs_Delete +### DaprSubscriptions_Get ```java /** - * Samples for ContainerAppsAuthConfigs Delete. + * Samples for DaprSubscriptions Get. */ -public final class ContainerAppsAuthConfigsDeleteSamples { +public final class DaprSubscriptionsGetSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/AuthConfigs_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprSubscriptions_Get_DefaultRoute.json */ /** - * Sample code: Delete Container App AuthConfig. + * Sample code: Get Dapr subscription with bulk subscribe configuration and scopes. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - deleteContainerAppAuthConfig(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsAuthConfigs() - .deleteWithResponse("workerapps-rg-xj", "testcanadacentral", "current", com.azure.core.util.Context.NONE); + public static void getDaprSubscriptionWithBulkSubscribeConfigurationAndScopes( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprSubscriptions() + .getWithResponse("examplerg", "myenvironment", "mypubsubcomponent", com.azure.core.util.Context.NONE); } -} -``` -### ContainerAppsAuthConfigs_Get + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprSubscriptions_Get_BulkSubscribeAndScopes.json + */ + /** + * Sample code: Get Dapr subscription with default route only. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getDaprSubscriptionWithDefaultRouteOnly( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprSubscriptions() + .getWithResponse("examplerg", "myenvironment", "mypubsubcomponent", com.azure.core.util.Context.NONE); + } -```java -/** - * Samples for ContainerAppsAuthConfigs Get. - */ -public final class ContainerAppsAuthConfigsGetSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/AuthConfigs_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprSubscriptions_Get_RouteRulesAndMetadata.json */ /** - * Sample code: Get Container App's AuthConfig. + * Sample code: GetDapr subscription with route rules and metadata. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - getContainerAppSAuthConfig(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsAuthConfigs() - .getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", com.azure.core.util.Context.NONE); + public static void getDaprSubscriptionWithRouteRulesAndMetadata( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprSubscriptions() + .getWithResponse("examplerg", "myenvironment", "mypubsubcomponent", com.azure.core.util.Context.NONE); } } ``` -### ContainerAppsAuthConfigs_ListByContainerApp +### DaprSubscriptions_List ```java /** - * Samples for ContainerAppsAuthConfigs ListByContainerApp. + * Samples for DaprSubscriptions List. */ -public final class ContainerAppsAuthConfigsListByContainerAppSamples { +public final class DaprSubscriptionsListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/AuthConfigs_ListByContainer.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprSubscriptions_List.json */ /** - * Sample code: List Auth Configs by Container Apps. + * Sample code: List Dapr subscriptions. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - listAuthConfigsByContainerApps(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsAuthConfigs() - .listByContainerApp("workerapps-rg-xj", "testcanadacentral", com.azure.core.util.Context.NONE); + public static void listDaprSubscriptions(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprSubscriptions().list("examplerg", "myenvironment", com.azure.core.util.Context.NONE); } } ``` -### ContainerAppsDiagnostics_GetDetector +### DotNetComponents_CreateOrUpdate ```java +import com.azure.resourcemanager.appcontainers.models.DotNetComponentConfigurationProperty; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentServiceBind; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentType; +import java.util.Arrays; + /** - * Samples for ContainerAppsDiagnostics GetDetector. + * Samples for DotNetComponents CreateOrUpdate. */ -public final class ContainerAppsDiagnosticsGetDetectorSamples { +public final class DotNetComponentsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerAppsDiagnostics_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DotNetComponents_CreateOrUpdate.json */ /** - * Sample code: Get Container App's diagnostics info. + * Sample code: Create or Update .NET Component. * * @param manager Entry point to ContainerAppsApiManager. */ public static void - getContainerAppSDiagnosticsInfo(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsDiagnostics() - .getDetectorWithResponse("mikono-workerapp-test-rg", "mikono-capp-stage1", "cappcontainerappnetworkIO", - com.azure.core.util.Context.NONE); + createOrUpdateNETComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.dotNetComponents() + .define("mydotnetcomponent") + .withExistingManagedEnvironment("examplerg", "myenvironment") + .withComponentType(DotNetComponentType.ASPIRE_DASHBOARD) + .withConfigurations(Arrays.asList( + new DotNetComponentConfigurationProperty().withPropertyName("dashboard-theme").withValue("dark"))) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DotNetComponents_CreateOrUpdate_ServiceBind.json + */ + /** + * Sample code: Create or Update .NET Component with ServiceBinds. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateNETComponentWithServiceBinds( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.dotNetComponents() + .define("mydotnetcomponent") + .withExistingManagedEnvironment("examplerg", "myenvironment") + .withComponentType(DotNetComponentType.ASPIRE_DASHBOARD) + .withConfigurations(Arrays.asList( + new DotNetComponentConfigurationProperty().withPropertyName("dashboard-theme").withValue("dark"))) + .withServiceBinds(Arrays.asList(new DotNetComponentServiceBind().withName("yellowcat") + .withServiceId( + "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat"))) + .create(); } } ``` -### ContainerAppsDiagnostics_GetRevision +### DotNetComponents_Delete ```java /** - * Samples for ContainerAppsDiagnostics GetRevision. + * Samples for DotNetComponents Delete. */ -public final class ContainerAppsDiagnosticsGetRevisionSamples { +public final class DotNetComponentsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_Delete.json */ /** - * Sample code: Get Container App's revision. + * Sample code: Delete .NET Component. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - getContainerAppSRevision(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsDiagnostics() - .getRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", - com.azure.core.util.Context.NONE); + public static void deleteNETComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.dotNetComponents() + .delete("examplerg", "myenvironment", "mydotnetcomponent", com.azure.core.util.Context.NONE); } } ``` -### ContainerAppsDiagnostics_GetRoot +### DotNetComponents_Get ```java /** - * Samples for ContainerAppsDiagnostics GetRoot. + * Samples for DotNetComponents Get. */ -public final class ContainerAppsDiagnosticsGetRootSamples { +public final class DotNetComponentsGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DotNetComponents_Get_ServiceBind.json + */ + /** + * Sample code: Get .NET Component with ServiceBinds. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + getNETComponentWithServiceBinds(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.dotNetComponents() + .getWithResponse("examplerg", "myenvironment", "mydotnetcomponent", com.azure.core.util.Context.NONE); + } + /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_Get.json */ /** - * Sample code: Get Container App. + * Sample code: Get .NET Component. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void getContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsDiagnostics() - .getRootWithResponse("rg", "testcontainerapp0", com.azure.core.util.Context.NONE); + public static void getNETComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.dotNetComponents() + .getWithResponse("examplerg", "myenvironment", "mydotnetcomponent", com.azure.core.util.Context.NONE); } } ``` -### ContainerAppsDiagnostics_ListDetectors +### DotNetComponents_List ```java /** - * Samples for ContainerAppsDiagnostics ListDetectors. + * Samples for DotNetComponents List. */ -public final class ContainerAppsDiagnosticsListDetectorsSamples { +public final class DotNetComponentsListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerAppsDiagnostics_List.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_List.json */ /** - * Sample code: Get the list of available diagnostics for a given Container App. + * Sample code: List .NET Components. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void getTheListOfAvailableDiagnosticsForAGivenContainerApp( - com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsDiagnostics() - .listDetectors("mikono-workerapp-test-rg", "mikono-capp-stage1", com.azure.core.util.Context.NONE); + public static void listNETComponents(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.dotNetComponents().list("examplerg", "myenvironment", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DotNetComponents_List_ServiceBind.json + */ + /** + * Sample code: List .NET Components with ServiceBinds. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listNETComponentsWithServiceBinds(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.dotNetComponents().list("examplerg", "myenvironment", com.azure.core.util.Context.NONE); } } ``` -### ContainerAppsDiagnostics_ListRevisions +### DotNetComponents_Update ```java +import com.azure.resourcemanager.appcontainers.models.DotNetComponent; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentConfigurationProperty; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentServiceBind; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentType; +import java.util.Arrays; + /** - * Samples for ContainerAppsDiagnostics ListRevisions. + * Samples for DotNetComponents Update. */ -public final class ContainerAppsDiagnosticsListRevisionsSamples { +public final class DotNetComponentsUpdateSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DotNetComponents_Patch_ServiceBind.json */ /** - * Sample code: List Container App's revisions. + * Sample code: Patch .NET Component with ServiceBinds. * * @param manager Entry point to ContainerAppsApiManager. */ public static void - listContainerAppSRevisions(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsDiagnostics() - .listRevisions("rg", "testcontainerApp0", null, com.azure.core.util.Context.NONE); + patchNETComponentWithServiceBinds(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + DotNetComponent resource = manager.dotNetComponents() + .getWithResponse("examplerg", "myenvironment", "mydotnetcomponent", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withComponentType(DotNetComponentType.ASPIRE_DASHBOARD) + .withConfigurations(Arrays.asList( + new DotNetComponentConfigurationProperty().withPropertyName("dashboard-theme").withValue("dark"))) + .withServiceBinds(Arrays.asList(new DotNetComponentServiceBind().withName("yellowcat") + .withServiceId( + "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat"))) + .apply(); + } + + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_Patch.json + */ + /** + * Sample code: Patch .NET Component. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void patchNETComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + DotNetComponent resource = manager.dotNetComponents() + .getWithResponse("examplerg", "myenvironment", "mydotnetcomponent", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withComponentType(DotNetComponentType.ASPIRE_DASHBOARD) + .withConfigurations(Arrays.asList( + new DotNetComponentConfigurationProperty().withPropertyName("dashboard-theme").withValue("dark"))) + .apply(); } } ``` -### ContainerAppsRevisionReplicas_GetReplica +### FunctionsExtension_InvokeFunctionsHost ```java /** - * Samples for ContainerAppsRevisionReplicas GetReplica. + * Samples for FunctionsExtension InvokeFunctionsHost. */ -public final class ContainerAppsRevisionReplicasGetReplicaSamples { +public final class FunctionsExtensionInvokeFunctionsHostSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Replicas_Get.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/FunctionsExtension_Post.json */ /** - * Sample code: Get Container App's revision replica. + * Sample code: Invoke Functions host using Functions Extension API. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - getContainerAppSRevisionReplica(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsRevisionReplicas() - .getReplicaWithResponse("workerapps-rg-xj", "myapp", "myapp--0wlqy09", "myapp--0wlqy09-5d9774cff-5wnd8", - com.azure.core.util.Context.NONE); + public static void invokeFunctionsHostUsingFunctionsExtensionAPI( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.functionsExtensions() + .invokeFunctionsHostWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", + "testcontainerApp0", com.azure.core.util.Context.NONE); } } ``` -### ContainerAppsRevisionReplicas_ListReplicas +### JavaComponents_CreateOrUpdate ```java +import com.azure.resourcemanager.appcontainers.models.JavaComponentConfigurationProperty; +import com.azure.resourcemanager.appcontainers.models.JavaComponentPropertiesScale; +import com.azure.resourcemanager.appcontainers.models.JavaComponentServiceBind; +import com.azure.resourcemanager.appcontainers.models.SpringBootAdminComponent; +import java.util.Arrays; + /** - * Samples for ContainerAppsRevisionReplicas ListReplicas. + * Samples for JavaComponents CreateOrUpdate. */ -public final class ContainerAppsRevisionReplicasListReplicasSamples { +public final class JavaComponentsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Replicas_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * JavaComponents_CreateOrUpdate_ServiceBind.json */ /** - * Sample code: List Container App's replicas. + * Sample code: Create or Update Java Component with ServiceBinds. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateJavaComponentWithServiceBinds( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.javaComponents() + .define("myjavacomponent") + .withExistingManagedEnvironment("examplerg", "myenvironment") + .withProperties(new SpringBootAdminComponent().withConfigurations(Arrays.asList( + new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.ui.enable-toasts") + .withValue("true"), + new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.monitor.status-interval") + .withValue("10000ms"))) + .withScale(new JavaComponentPropertiesScale().withMinReplicas(1).withMaxReplicas(1)) + .withServiceBinds(Arrays.asList(new JavaComponentServiceBind().withName("yellowcat") + .withServiceId( + "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/yellowcat")))) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * JavaComponents_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Java Component. * * @param manager Entry point to ContainerAppsApiManager. */ public static void - listContainerAppSReplicas(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsRevisionReplicas() - .listReplicasWithResponse("workerapps-rg-xj", "myapp", "myapp--0wlqy09", com.azure.core.util.Context.NONE); + createOrUpdateJavaComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.javaComponents() + .define("myjavacomponent") + .withExistingManagedEnvironment("examplerg", "myenvironment") + .withProperties(new SpringBootAdminComponent().withConfigurations(Arrays.asList( + new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.ui.enable-toasts") + .withValue("true"), + new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.monitor.status-interval") + .withValue("10000ms"))) + .withScale(new JavaComponentPropertiesScale().withMinReplicas(1).withMaxReplicas(1))) + .create(); } } ``` -### ContainerAppsRevisions_ActivateRevision +### JavaComponents_Delete ```java /** - * Samples for ContainerAppsRevisions ActivateRevision. + * Samples for JavaComponents Delete. */ -public final class ContainerAppsRevisionsActivateRevisionSamples { +public final class JavaComponentsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_Activate.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_Delete.json */ /** - * Sample code: Activate Container App's revision. + * Sample code: Delete Java Component. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - activateContainerAppSRevision(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsRevisions() - .activateRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", - com.azure.core.util.Context.NONE); + public static void deleteJavaComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.javaComponents() + .delete("examplerg", "myenvironment", "myjavacomponent", com.azure.core.util.Context.NONE); } } ``` -### ContainerAppsRevisions_DeactivateRevision +### JavaComponents_Get ```java /** - * Samples for ContainerAppsRevisions DeactivateRevision. + * Samples for JavaComponents Get. */ -public final class ContainerAppsRevisionsDeactivateRevisionSamples { +public final class JavaComponentsGetSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_Deactivate.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_Get.json */ /** - * Sample code: Deactivate Container App's revision. + * Sample code: Get Java Component. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getJavaComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.javaComponents() + .getWithResponse("examplerg", "myenvironment", "myjavacomponent", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * JavaComponents_Get_ServiceBind.json + */ + /** + * Sample code: Get Java Component with ServiceBinds. * * @param manager Entry point to ContainerAppsApiManager. */ public static void - deactivateContainerAppSRevision(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsRevisions() - .deactivateRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", - com.azure.core.util.Context.NONE); + getJavaComponentWithServiceBinds(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.javaComponents() + .getWithResponse("examplerg", "myenvironment", "myjavacomponent", com.azure.core.util.Context.NONE); } } ``` -### ContainerAppsRevisions_GetRevision +### JavaComponents_List ```java /** - * Samples for ContainerAppsRevisions GetRevision. + * Samples for JavaComponents List. */ -public final class ContainerAppsRevisionsGetRevisionSamples { +public final class JavaComponentsListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_List.json */ /** - * Sample code: Get Container App's revision. + * Sample code: List Java Components. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listJavaComponents(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.javaComponents().list("examplerg", "myenvironment", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * JavaComponents_List_ServiceBind.json + */ + /** + * Sample code: List Java Components with ServiceBinds. * * @param manager Entry point to ContainerAppsApiManager. */ public static void - getContainerAppSRevision(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsRevisions() - .getRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", - com.azure.core.util.Context.NONE); + listJavaComponentsWithServiceBinds(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.javaComponents().list("examplerg", "myenvironment", com.azure.core.util.Context.NONE); } } ``` -### ContainerAppsRevisions_ListRevisions +### JavaComponents_Update ```java +import com.azure.resourcemanager.appcontainers.models.JavaComponent; +import com.azure.resourcemanager.appcontainers.models.JavaComponentConfigurationProperty; +import com.azure.resourcemanager.appcontainers.models.JavaComponentPropertiesScale; +import com.azure.resourcemanager.appcontainers.models.JavaComponentServiceBind; +import com.azure.resourcemanager.appcontainers.models.SpringBootAdminComponent; +import java.util.Arrays; + /** - * Samples for ContainerAppsRevisions ListRevisions. + * Samples for JavaComponents Update. */ -public final class ContainerAppsRevisionsListRevisionsSamples { +public final class JavaComponentsUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_List.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_Patch.json */ /** - * Sample code: List Container App's revisions. + * Sample code: Patch Java Component. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - listContainerAppSRevisions(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsRevisions() - .listRevisions("rg", "testcontainerApp0", null, com.azure.core.util.Context.NONE); - } -} -``` - -### ContainerAppsRevisions_RestartRevision + public static void patchJavaComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + JavaComponent resource = manager.javaComponents() + .getWithResponse("examplerg", "myenvironment", "myjavacomponent", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new SpringBootAdminComponent().withConfigurations(Arrays.asList( + new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.ui.enable-toasts") + .withValue("true"), + new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.monitor.status-interval") + .withValue("10000ms"))) + .withScale(new JavaComponentPropertiesScale().withMinReplicas(1).withMaxReplicas(1))) + .apply(); + } -```java -/** - * Samples for ContainerAppsRevisions RestartRevision. - */ -public final class ContainerAppsRevisionsRestartRevisionSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_Restart.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * JavaComponents_Patch_ServiceBind.json */ /** - * Sample code: Restart Container App's revision. + * Sample code: Patch Java Component with ServiceBinds. * * @param manager Entry point to ContainerAppsApiManager. */ public static void - restartContainerAppSRevision(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsRevisions() - .restartRevisionWithResponse("rg", "testStaticSite0", "testcontainerApp0-pjxhsye", - com.azure.core.util.Context.NONE); + patchJavaComponentWithServiceBinds(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + JavaComponent resource = manager.javaComponents() + .getWithResponse("examplerg", "myenvironment", "myjavacomponent", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new SpringBootAdminComponent().withConfigurations(Arrays.asList( + new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.ui.enable-toasts") + .withValue("true"), + new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.monitor.status-interval") + .withValue("10000ms"))) + .withScale(new JavaComponentPropertiesScale().withMinReplicas(1).withMaxReplicas(1)) + .withServiceBinds(Arrays.asList(new JavaComponentServiceBind().withName("yellowcat") + .withServiceId( + "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/yellowcat")))) + .apply(); } } ``` -### ContainerAppsSourceControls_CreateOrUpdate +### Jobs_CreateOrUpdate ```java -import com.azure.resourcemanager.appcontainers.models.AzureCredentials; -import com.azure.resourcemanager.appcontainers.models.GithubActionConfiguration; -import com.azure.resourcemanager.appcontainers.models.RegistryInfo; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.appcontainers.models.Container; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; +import com.azure.resourcemanager.appcontainers.models.ContainerResources; +import com.azure.resourcemanager.appcontainers.models.ExtendedLocation; +import com.azure.resourcemanager.appcontainers.models.ExtendedLocationTypes; +import com.azure.resourcemanager.appcontainers.models.IdentitySettings; +import com.azure.resourcemanager.appcontainers.models.IdentitySettingsLifeCycle; +import com.azure.resourcemanager.appcontainers.models.InitContainer; +import com.azure.resourcemanager.appcontainers.models.JobConfiguration; +import com.azure.resourcemanager.appcontainers.models.JobConfigurationEventTriggerConfig; +import com.azure.resourcemanager.appcontainers.models.JobConfigurationManualTriggerConfig; +import com.azure.resourcemanager.appcontainers.models.JobScale; +import com.azure.resourcemanager.appcontainers.models.JobScaleRule; +import com.azure.resourcemanager.appcontainers.models.JobTemplate; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.appcontainers.models.TriggerType; +import com.azure.resourcemanager.appcontainers.models.Type; +import com.azure.resourcemanager.appcontainers.models.UserAssignedIdentity; +import com.azure.resourcemanager.appcontainers.models.VolumeMount; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; /** - * Samples for ContainerAppsSourceControls CreateOrUpdate. + * Samples for Jobs CreateOrUpdate. */ -public final class ContainerAppsSourceControlsCreateOrUpdateSamples { +public final class JobsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/SourceControls_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * Job_CreateorUpdate_ConnectedEnvironment.json */ /** - * Sample code: Create or Update Container App SourceControl. + * Sample code: Create or Update Container Apps Job On A Connected Environment. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void createOrUpdateContainerAppSourceControl( + public static void createOrUpdateContainerAppsJobOnAConnectedEnvironment( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsSourceControls() - .define("current") - .withExistingContainerApp("workerapps-rg-xj", "testcanadacentral") - .withRepoUrl("https://github.com/xwang971/ghatest") - .withBranch("master") - .withGithubActionConfiguration(new GithubActionConfiguration() - .withRegistryInfo(new RegistryInfo().withRegistryUrl("test-registry.azurecr.io") - .withRegistryUsername("test-registry") - .withRegistryPassword("fakeTokenPlaceholder")) - .withAzureCredentials(new AzureCredentials().withClientId("") - .withClientSecret("fakeTokenPlaceholder") - .withTenantId("") - .withKind("feaderated")) - .withContextPath("./") - .withGithubPersonalAccessToken("fakeTokenPlaceholder") - .withImage("image/tag")) + manager.jobs() + .define("testcontainerAppsJob0") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube") + .withConfiguration(new JobConfiguration().withTriggerType(TriggerType.MANUAL) + .withReplicaTimeout(10) + .withReplicaRetryLimit(10) + .withManualTriggerConfig( + new JobConfigurationManualTriggerConfig().withReplicaCompletionCount(1).withParallelism(4))) + .withTemplate(new JobTemplate() + .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerAppsJob0:v4") + .withName("testinitcontainerAppsJob0") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerAppsJob0:v1") + .withName("testcontainerAppsJob0") + .withProbes(Arrays.asList(new ContainerAppProbe() + .withHttpGet(new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)) + .withInitialDelaySeconds(5) + .withPeriodSeconds(3) + .withType(Type.LIVENESS)))))) .create(); } -} -``` -### ContainerAppsSourceControls_Delete + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * Job_CreateorUpdate_EventTrigger.json + */ + /** + * Sample code: Create or Update Container Apps Job With Event Driven Trigger. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateContainerAppsJobWithEventDrivenTrigger( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) throws IOException { + manager.jobs() + .define("testcontainerAppsJob0") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity", + new UserAssignedIdentity()))) + .withEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") + .withConfiguration(new JobConfiguration().withTriggerType(TriggerType.EVENT) + .withReplicaTimeout(10) + .withReplicaRetryLimit(10) + .withEventTriggerConfig(new JobConfigurationEventTriggerConfig().withReplicaCompletionCount(1) + .withParallelism(4) + .withScale(new JobScale().withPollingInterval(40) + .withMinExecutions(1) + .withMaxExecutions(5) + .withRules(Arrays.asList(new JobScaleRule().withName("servicebuscalingrule") + .withType("azure-servicebus") + .withMetadata(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"topicName\":\"my-topic\"}", Object.class, SerializerEncoding.JSON)) + .withIdentity( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity")))))) + .withTemplate(new JobTemplate() + .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerAppsJob0:v4") + .withName("testinitcontainerAppsJob0") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers(Arrays.asList( + new Container().withImage("repo/testcontainerAppsJob0:v1").withName("testcontainerAppsJob0")))) + .create(); + } -```java -/** - * Samples for ContainerAppsSourceControls Delete. - */ -public final class ContainerAppsSourceControlsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/SourceControls_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_CreateorUpdate.json */ /** - * Sample code: Delete Container App SourceControl. + * Sample code: Create or Update Container Apps Job. * * @param manager Entry point to ContainerAppsApiManager. */ public static void - deleteContainerAppSourceControl(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsSourceControls() - .delete("workerapps-rg-xj", "testcanadacentral", "current", com.azure.core.util.Context.NONE); + createOrUpdateContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs() + .define("testcontainerAppsJob0") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withIdentity(new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity", + new UserAssignedIdentity()))) + .withEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") + .withConfiguration(new JobConfiguration().withTriggerType(TriggerType.MANUAL) + .withReplicaTimeout(10) + .withReplicaRetryLimit(10) + .withManualTriggerConfig( + new JobConfigurationManualTriggerConfig().withReplicaCompletionCount(1).withParallelism(4)) + .withIdentitySettings(Arrays.asList(new IdentitySettings().withIdentity( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity") + .withLifecycle(IdentitySettingsLifeCycle.ALL), + new IdentitySettings().withIdentity("system").withLifecycle(IdentitySettingsLifeCycle.INIT)))) + .withTemplate(new JobTemplate() + .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerAppsJob0:v4") + .withName("testinitcontainerAppsJob0") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerAppsJob0:v1") + .withName("testcontainerAppsJob0") + .withVolumeMounts(Arrays.asList( + new VolumeMount().withVolumeName("azurefile") + .withMountPath("/mnt/path1") + .withSubPath("subPath1"), + new VolumeMount().withVolumeName("nfsazurefile") + .withMountPath("/mnt/path2") + .withSubPath("subPath2"))) + .withProbes(Arrays.asList(new ContainerAppProbe() + .withHttpGet(new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)) + .withInitialDelaySeconds(5) + .withPeriodSeconds(3) + .withType(Type.LIVENESS)))))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### ContainerAppsSourceControls_Get +### Jobs_Delete ```java /** - * Samples for ContainerAppsSourceControls Get. + * Samples for Jobs Delete. */ -public final class ContainerAppsSourceControlsGetSamples { +public final class JobsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/SourceControls_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Delete.json */ /** - * Sample code: Get Container App's SourceControl. + * Sample code: Delete Container Apps Job. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - getContainerAppSSourceControl(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsSourceControls() - .getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", com.azure.core.util.Context.NONE); + public static void deleteContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().delete("rg", "testWorkerContainerAppsJob0", com.azure.core.util.Context.NONE); } } ``` -### ContainerAppsSourceControls_ListByContainerApp +### Jobs_GetByResourceGroup ```java /** - * Samples for ContainerAppsSourceControls ListByContainerApp. + * Samples for Jobs GetByResourceGroup. */ -public final class ContainerAppsSourceControlsListByContainerAppSamples { +public final class JobsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/SourceControls_ListByContainer.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Get.json */ /** - * Sample code: List App's Source Controls. + * Sample code: Get Container Apps Job. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void listAppSSourceControls(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsSourceControls() - .listByContainerApp("workerapps-rg-xj", "testcanadacentral", com.azure.core.util.Context.NONE); + public static void getContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().getByResourceGroupWithResponse("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE); } } ``` -### DaprComponents_CreateOrUpdate +### Jobs_GetDetector ```java -import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentInner; -import com.azure.resourcemanager.appcontainers.models.DaprMetadata; -import com.azure.resourcemanager.appcontainers.models.Secret; -import java.util.Arrays; - /** - * Samples for DaprComponents CreateOrUpdate. + * Samples for Jobs GetDetector. */ -public final class DaprComponentsCreateOrUpdateSamples { +public final class JobsGetDetectorSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_CreateOrUpdate_Secrets - * .json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_GetDetector.json */ /** - * Sample code: Create or update dapr component with secrets. + * Sample code: Get diagnostic data for a Container App Job. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void createOrUpdateDaprComponentWithSecrets( - com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents() - .createOrUpdateWithResponse("examplerg", "myenvironment", "reddog", - new DaprComponentInner().withComponentType("state.azure.cosmosdb") - .withVersion("v1") - .withIgnoreErrors(false) - .withInitTimeout("50s") - .withSecrets(Arrays.asList(new Secret().withName("masterkey").withValue("keyvalue"))) - .withMetadata(Arrays.asList(new DaprMetadata().withName("url").withValue(""), - new DaprMetadata().withName("database").withValue("itemsDB"), - new DaprMetadata().withName("collection").withValue("items"), - new DaprMetadata().withName("masterkey").withSecretRef("fakeTokenPlaceholder"))) - .withScopes(Arrays.asList("container-app-1", "container-app-2")), + public static void + getDiagnosticDataForAContainerAppJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs() + .getDetectorWithResponse("mikono-workerapp-test-rg", "mikonojob1", "containerappjobnetworkIO", com.azure.core.util.Context.NONE); } +} +``` +### Jobs_List + +```java +/** + * Samples for Jobs List. + */ +public final class JobsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ - * DaprComponents_CreateOrUpdate_SecretStoreComponent.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Jobs_ListBySubscription.json */ /** - * Sample code: Create or update dapr component with secret store component. + * Sample code: List Container Apps Jobs by subscription. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void createOrUpdateDaprComponentWithSecretStoreComponent( - com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents() - .createOrUpdateWithResponse("examplerg", "myenvironment", "reddog", - new DaprComponentInner().withComponentType("state.azure.cosmosdb") - .withVersion("v1") - .withIgnoreErrors(false) - .withInitTimeout("50s") - .withSecretStoreComponent("fakeTokenPlaceholder") - .withMetadata(Arrays.asList(new DaprMetadata().withName("url").withValue(""), - new DaprMetadata().withName("database").withValue("itemsDB"), - new DaprMetadata().withName("collection").withValue("items"), - new DaprMetadata().withName("masterkey").withSecretRef("fakeTokenPlaceholder"))) - .withScopes(Arrays.asList("container-app-1", "container-app-2")), - com.azure.core.util.Context.NONE); + public static void + listContainerAppsJobsBySubscription(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().list(com.azure.core.util.Context.NONE); } } ``` -### DaprComponents_Delete +### Jobs_ListByResourceGroup ```java /** - * Samples for DaprComponents Delete. + * Samples for Jobs ListByResourceGroup. */ -public final class DaprComponentsDeleteSamples { +public final class JobsListByResourceGroupSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Jobs_ListByResourceGroup. + * json */ /** - * Sample code: Delete dapr component. + * Sample code: List Container Apps Jobs by resource group. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void deleteDaprComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents() - .deleteWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); + public static void + listContainerAppsJobsByResourceGroup(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().listByResourceGroup("rg", com.azure.core.util.Context.NONE); } } ``` -### DaprComponents_Get +### Jobs_ListDetectors ```java /** - * Samples for DaprComponents Get. + * Samples for Jobs ListDetectors. */ -public final class DaprComponentsGetSamples { +public final class JobsListDetectorsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ - * DaprComponents_Get_SecretStoreComponent.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_ListDetectors.json */ /** - * Sample code: Get Dapr Component with secret store component. + * Sample code: Get the list of available diagnostic data for a Container App Job. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void getDaprComponentWithSecretStoreComponent( + public static void getTheListOfAvailableDiagnosticDataForAContainerAppJob( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents() - .getWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); + manager.jobs().listDetectors("mikono-workerapp-test-rg", "mikonojob1", com.azure.core.util.Context.NONE); } +} +``` +### Jobs_ListSecrets + +```java +/** + * Samples for Jobs ListSecrets. + */ +public final class JobsListSecretsSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_Get_Secrets.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_ListSecrets.json */ /** - * Sample code: Get Dapr Component with secrets. + * Sample code: List Container Apps Job Secrets. * * @param manager Entry point to ContainerAppsApiManager. */ public static void - getDaprComponentWithSecrets(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents() - .getWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); + listContainerAppsJobSecrets(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().listSecretsWithResponse("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE); } } ``` -### DaprComponents_List +### Jobs_ProxyGet ```java /** - * Samples for DaprComponents List. + * Samples for Jobs ProxyGet. */ -public final class DaprComponentsListSamples { +public final class JobsProxyGetSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_List.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_ProxyGet.json */ /** - * Sample code: List Dapr Components. + * Sample code: Get Container App Job by name. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void listDaprComponents(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents().list("examplerg", "myenvironment", com.azure.core.util.Context.NONE); + public static void + getContainerAppJobByName(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().proxyGetWithResponse("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE); } } ``` -### DaprComponents_ListSecrets +### Jobs_Resume ```java /** - * Samples for DaprComponents ListSecrets. + * Samples for Jobs Resume. */ -public final class DaprComponentsListSecretsSamples { +public final class JobsResumeSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_ListSecrets.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Jobs_Resume.json */ /** - * Sample code: List Container Apps Secrets. + * Sample code: Resume Job. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - listContainerAppsSecrets(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents() - .listSecretsWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); + public static void resumeJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().resume("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE); } } ``` -### Jobs_CreateOrUpdate +### Jobs_Start ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.appcontainers.models.Container; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; import com.azure.resourcemanager.appcontainers.models.ContainerResources; -import com.azure.resourcemanager.appcontainers.models.InitContainer; -import com.azure.resourcemanager.appcontainers.models.JobConfiguration; -import com.azure.resourcemanager.appcontainers.models.JobConfigurationEventTriggerConfig; -import com.azure.resourcemanager.appcontainers.models.JobConfigurationManualTriggerConfig; -import com.azure.resourcemanager.appcontainers.models.JobScale; -import com.azure.resourcemanager.appcontainers.models.JobScaleRule; -import com.azure.resourcemanager.appcontainers.models.JobTemplate; -import com.azure.resourcemanager.appcontainers.models.TriggerType; -import com.azure.resourcemanager.appcontainers.models.Type; -import java.io.IOException; +import com.azure.resourcemanager.appcontainers.models.JobExecutionContainer; +import com.azure.resourcemanager.appcontainers.models.JobExecutionTemplate; import java.util.Arrays; /** - * Samples for Jobs CreateOrUpdate. + * Samples for Jobs Start. */ -public final class JobsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_CreateorUpdate_EventTrigger.json - */ - /** - * Sample code: Create or Update Container Apps Job With Event Driven Trigger. - * - * @param manager Entry point to ContainerAppsApiManager. - */ - public static void createOrUpdateContainerAppsJobWithEventDrivenTrigger( - com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) throws IOException { - manager.jobs() - .define("testcontainerappsjob0") - .withRegion("East US") - .withExistingResourceGroup("rg") - .withEnvironmentId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") - .withConfiguration(new JobConfiguration().withTriggerType(TriggerType.EVENT) - .withReplicaTimeout(10) - .withReplicaRetryLimit(10) - .withEventTriggerConfig(new JobConfigurationEventTriggerConfig().withReplicaCompletionCount(1) - .withParallelism(4) - .withScale(new JobScale().withPollingInterval(40) - .withMinExecutions(1) - .withMaxExecutions(5) - .withRules(Arrays.asList(new JobScaleRule().withName("servicebuscalingrule") - .withType("azure-servicebus") - .withMetadata(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize("{\"topicName\":\"my-topic\"}", Object.class, - SerializerEncoding.JSON))))))) - .withTemplate(new JobTemplate() - .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerappsjob0:v4") - .withName("testinitcontainerAppsJob0") - .withCommand(Arrays.asList("/bin/sh")) - .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) - .withResources(new ContainerResources().withCpu(0.5D).withMemory("1Gi")))) - .withContainers(Arrays.asList( - new Container().withImage("repo/testcontainerappsjob0:v1").withName("testcontainerappsjob0")))) - .create(); - } - +public final class JobsStartSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_CreateorUpdate.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Start.json */ /** - * Sample code: Create or Update Container Apps Job. + * Sample code: Run a Container Apps Job. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - createOrUpdateContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + public static void runAContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager.jobs() - .define("testcontainerappsjob0") - .withRegion("East US") - .withExistingResourceGroup("rg") - .withEnvironmentId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") - .withConfiguration(new JobConfiguration().withTriggerType(TriggerType.MANUAL) - .withReplicaTimeout(10) - .withReplicaRetryLimit(10) - .withManualTriggerConfig( - new JobConfigurationManualTriggerConfig().withReplicaCompletionCount(1).withParallelism(4))) - .withTemplate(new JobTemplate() - .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerappsjob0:v4") + .start("rg", "testcontainerAppsJob0", new JobExecutionTemplate() + .withContainers(Arrays.asList(new JobExecutionContainer().withImage("repo/testcontainerAppsJob0:v4") + .withName("testcontainerAppsJob0") + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withInitContainers(Arrays.asList(new JobExecutionContainer().withImage("repo/testcontainerAppsJob0:v4") .withName("testinitcontainerAppsJob0") .withCommand(Arrays.asList("/bin/sh")) .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) - .withResources(new ContainerResources().withCpu(0.5D).withMemory("1Gi")))) - .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerappsjob0:v1") - .withName("testcontainerappsjob0") - .withProbes(Arrays.asList(new ContainerAppProbe() - .withHttpGet(new ContainerAppProbeHttpGet() - .withHttpHeaders( - Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("Custom-Header") - .withValue("Awesome"))) - .withPath("/health") - .withPort(8080)) - .withInitialDelaySeconds(5) - .withPeriodSeconds(3) - .withType(Type.LIVENESS)))))) - .create(); + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))), + com.azure.core.util.Context.NONE); } } ``` -### Jobs_Delete +### Jobs_StopExecution ```java /** - * Samples for Jobs Delete. + * Samples for Jobs StopExecution. */ -public final class JobsDeleteSamples { +public final class JobsStopExecutionSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Delete.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Stop_Execution.json */ /** - * Sample code: Delete Container Apps Job. + * Sample code: Terminate a Container Apps Job. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void deleteContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs().delete("rg", "testworkercontainerappsjob0", com.azure.core.util.Context.NONE); + public static void + terminateAContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().stopExecution("rg", "testcontainerAppsJob0", "jobExecution1", com.azure.core.util.Context.NONE); } } ``` -### Jobs_GetByResourceGroup +### Jobs_StopMultipleExecutions ```java /** - * Samples for Jobs GetByResourceGroup. + * Samples for Jobs StopMultipleExecutions. */ -public final class JobsGetByResourceGroupSamples { +public final class JobsStopMultipleExecutionsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Get.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Stop_Multiple.json */ /** - * Sample code: Get Container Apps Job. + * Sample code: Terminate Multiple Container Apps Job. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void getContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs().getByResourceGroupWithResponse("rg", "testcontainerappsjob0", com.azure.core.util.Context.NONE); + public static void + terminateMultipleContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().stopMultipleExecutions("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE); } } ``` -### Jobs_GetDetector +### Jobs_Suspend ```java /** - * Samples for Jobs GetDetector. + * Samples for Jobs Suspend. */ -public final class JobsGetDetectorSamples { +public final class JobsSuspendSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_GetDetector.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Jobs_Suspend.json */ /** - * Sample code: Get diagnostic data for a Container App Job. + * Sample code: Suspend Job. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - getDiagnosticDataForAContainerAppJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs() - .getDetectorWithResponse("mikono-workerapp-test-rg", "mikonojob1", "containerappjobnetworkIO", - com.azure.core.util.Context.NONE); + public static void suspendJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().suspend("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE); } } ``` -### Jobs_List +### Jobs_Update ```java +import com.azure.resourcemanager.appcontainers.models.Container; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; +import com.azure.resourcemanager.appcontainers.models.ContainerResources; +import com.azure.resourcemanager.appcontainers.models.InitContainer; +import com.azure.resourcemanager.appcontainers.models.Job; +import com.azure.resourcemanager.appcontainers.models.JobConfiguration; +import com.azure.resourcemanager.appcontainers.models.JobConfigurationManualTriggerConfig; +import com.azure.resourcemanager.appcontainers.models.JobPatchPropertiesProperties; +import com.azure.resourcemanager.appcontainers.models.JobTemplate; +import com.azure.resourcemanager.appcontainers.models.TriggerType; +import com.azure.resourcemanager.appcontainers.models.Type; +import java.util.Arrays; + /** - * Samples for Jobs List. + * Samples for Jobs Update. */ -public final class JobsListSamples { +public final class JobsUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Jobs_ListBySubscription.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Patch.json */ /** - * Sample code: List Container Apps Jobs by subscription. + * Sample code: Patch Container Apps Job. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - listContainerAppsJobsBySubscription(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs().list(com.azure.core.util.Context.NONE); + public static void patchContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + Job resource = manager.jobs() + .getByResourceGroupWithResponse("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new JobPatchPropertiesProperties() + .withConfiguration(new JobConfiguration().withTriggerType(TriggerType.MANUAL) + .withReplicaTimeout(10) + .withReplicaRetryLimit(10) + .withManualTriggerConfig( + new JobConfigurationManualTriggerConfig().withReplicaCompletionCount(1).withParallelism(4))) + .withTemplate(new JobTemplate() + .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerAppsJob0:v4") + .withName("testinitcontainerAppsJob0") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerAppsJob0:v1") + .withName("testcontainerAppsJob0") + .withProbes(Arrays.asList(new ContainerAppProbe() + .withHttpGet(new ContainerAppProbeHttpGet() + .withHttpHeaders(Arrays + .asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)) + .withInitialDelaySeconds(3) + .withPeriodSeconds(3) + .withType(Type.LIVENESS))))))) + .apply(); } } ``` -### Jobs_ListByResourceGroup +### JobsExecutions_List ```java /** - * Samples for Jobs ListByResourceGroup. + * Samples for JobsExecutions List. */ -public final class JobsListByResourceGroupSamples { +public final class JobsExecutionsListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Jobs_ListByResourceGroup.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Executions_Get.json */ /** - * Sample code: List Container Apps Jobs by resource group. + * Sample code: Get a Container Apps Job Executions. * * @param manager Entry point to ContainerAppsApiManager. */ public static void - listContainerAppsJobsByResourceGroup(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs().listByResourceGroup("rg", com.azure.core.util.Context.NONE); + getAContainerAppsJobExecutions(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobsExecutions().list("rg", "testcontainerAppsJob0", null, com.azure.core.util.Context.NONE); } } ``` -### Jobs_ListDetectors +### LogicApps_CreateOrUpdate ```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + /** - * Samples for Jobs ListDetectors. + * Samples for LogicApps CreateOrUpdate. */ -public final class JobsListDetectorsSamples { +public final class LogicAppsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_ListDetectors.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_Create.json */ /** - * Sample code: Get the list of available diagnostic data for a Container App Job. + * Sample code: Create logic app extension. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void getTheListOfAvailableDiagnosticDataForAContainerAppJob( - com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs().listDetectors("mikono-workerapp-test-rg", "mikonojob1", com.azure.core.util.Context.NONE); + public static void createLogicAppExtension(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) + throws IOException { + manager.logicApps() + .define("testcontainerApp0") + .withExistingContainerApp("examplerg", "testcontainerApp0") + .withProperties(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .create(); } } ``` -### Jobs_ListSecrets +### LogicApps_Delete ```java /** - * Samples for Jobs ListSecrets. + * Samples for LogicApps Delete. */ -public final class JobsListSecretsSamples { +public final class LogicAppsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_ListSecrets.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_Delete.json */ /** - * Sample code: List Container Apps Job Secrets. + * Sample code: Create logic app extension. * * @param manager Entry point to ContainerAppsApiManager. */ public static void - listContainerAppsJobSecrets(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs().listSecretsWithResponse("rg", "testcontainerappsjob0", com.azure.core.util.Context.NONE); + createLogicAppExtension(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.logicApps() + .deleteWithResponse("examplerg", "testcontainerApp0", "testcontainerApp0", + com.azure.core.util.Context.NONE); } } ``` -### Jobs_ProxyGet +### LogicApps_DeployWorkflowArtifacts ```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.appcontainers.models.WorkflowArtifacts; +import java.io.IOException; +import java.util.Arrays; + /** - * Samples for Jobs ProxyGet. + * Samples for LogicApps DeployWorkflowArtifacts. */ -public final class JobsProxyGetSamples { +public final class LogicAppsDeployWorkflowArtifactsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_ProxyGet.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * LogicApps_PostDeployWorkflowArtifacts.json */ /** - * Sample code: Get Container App Job by name. + * Sample code: Deploys workflow artifacts. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deploysWorkflowArtifacts(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) + throws IOException { + manager.logicApps() + .deployWorkflowArtifactsWithResponse("testrg123", "testapp2", "testapp2", new WorkflowArtifacts() + .withAppSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"eventHub_connectionString\":\"Endpoint=sb://example.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=EXAMPLE1a2b3c4d5e6fEXAMPLE=\"}", + Object.class, SerializerEncoding.JSON)) + .withFiles(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"connections.json\":{\"managedApiConnections\":{},\"serviceProviderConnections\":{\"eventHub\":{\"displayName\":\"example1\",\"parameterValues\":{\"connectionString\":\"@appsetting('eventHub_connectionString')\"},\"serviceProvider\":{\"id\":\"/serviceProviders/eventHub\"}}}},\"test1/workflow.json\":{\"definition\":{\"$schema\":\"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#\",\"actions\":{},\"contentVersion\":\"1.0.0.0\",\"outputs\":{},\"triggers\":{\"When_events_are_available_in_Event_hub\":{\"type\":\"ServiceProvider\",\"inputs\":{\"parameters\":{\"eventHubName\":\"test123\"},\"serviceProviderConfiguration\":{\"operationId\":\"receiveEvents\",\"connectionName\":\"eventHub\",\"serviceProviderId\":\"/serviceProviders/eventHub\"}},\"splitOn\":\"@triggerOutputs()?['body']\"}}},\"kind\":\"Stateful\"}}", + Object.class, SerializerEncoding.JSON)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * LogicApps_DeleteDeployWorkflowArtifacts.json + */ + /** + * Sample code: Delete workflow artifacts. * * @param manager Entry point to ContainerAppsApiManager. */ public static void - getContainerAppJobByName(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs().proxyGetWithResponse("rg", "testcontainerappsjob0", "rootApi", com.azure.core.util.Context.NONE); + deleteWorkflowArtifacts(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.logicApps() + .deployWorkflowArtifactsWithResponse("testrg123", "testapp2", "testapp2", + new WorkflowArtifacts().withFilesToDelete(Arrays.asList("test/workflow.json", "test/")), + com.azure.core.util.Context.NONE); } } ``` -### Jobs_Start +### LogicApps_Get ```java -import com.azure.resourcemanager.appcontainers.models.ContainerResources; -import com.azure.resourcemanager.appcontainers.models.JobExecutionContainer; -import com.azure.resourcemanager.appcontainers.models.JobExecutionTemplate; -import java.util.Arrays; - /** - * Samples for Jobs Start. + * Samples for LogicApps Get. */ -public final class JobsStartSamples { +public final class LogicAppsGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Start.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_Get.json */ /** - * Sample code: Run a Container Apps Job. + * Sample code: Get logic app extension by name. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void runAContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs() - .start("rg", "testcontainerappsjob0", new JobExecutionTemplate() - .withContainers(Arrays.asList(new JobExecutionContainer().withImage("repo/testcontainerappsjob0:v4") - .withName("testcontainerappsjob0") - .withResources(new ContainerResources().withCpu(0.5D).withMemory("1Gi")))) - .withInitContainers(Arrays.asList(new JobExecutionContainer().withImage("repo/testcontainerappsjob0:v4") - .withName("testinitcontainerAppsJob0") - .withCommand(Arrays.asList("/bin/sh")) - .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) - .withResources(new ContainerResources().withCpu(0.5D).withMemory("1Gi")))), - com.azure.core.util.Context.NONE); + public static void + getLogicAppExtensionByName(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.logicApps() + .getWithResponse("examplerg", "testcontainerApp0", "testcontainerApp0", com.azure.core.util.Context.NONE); } } ``` -### Jobs_StopExecution +### LogicApps_GetWorkflow ```java /** - * Samples for Jobs StopExecution. + * Samples for LogicApps GetWorkflow. */ -public final class JobsStopExecutionSamples { +public final class LogicAppsGetWorkflowSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Stop_Execution.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_GetWorkflow.json */ /** - * Sample code: Terminate a Container Apps Job. + * Sample code: GET a workflow. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - terminateAContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs().stopExecution("rg", "testcontainerappsjob0", "jobExecution1", com.azure.core.util.Context.NONE); + public static void gETAWorkflow(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.logicApps() + .getWorkflowWithResponse("examplerg", "testcontainerApp0", "testcontainerApp0", "stateful1", + com.azure.core.util.Context.NONE); } } ``` -### Jobs_StopMultipleExecutions +### LogicApps_Invoke ```java +import com.azure.resourcemanager.appcontainers.models.LogicAppsProxyMethod; + /** - * Samples for Jobs StopMultipleExecutions. + * Samples for LogicApps Invoke. */ -public final class JobsStopMultipleExecutionsSamples { +public final class LogicAppsInvokeSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Stop_Multiple.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_ListCallbackURL. + * json */ /** - * Sample code: Terminate Multiple Container Apps Job. + * Sample code: Get workflow list call back URL. * * @param manager Entry point to ContainerAppsApiManager. */ public static void - terminateMultipleContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs().stopMultipleExecutions("rg", "testcontainerappsjob0", com.azure.core.util.Context.NONE); + getWorkflowListCallBackURL(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.logicApps() + .invokeWithResponse("testrg123", "testapp2", "testapp2", + "/runtime/webhooks/workflow/api/management/workflows/Stateful1/triggers/When_a_HTTP_request_is_received/listCallbackUrl", + LogicAppsProxyMethod.POST, com.azure.core.util.Context.NONE); } } ``` -### Jobs_Update +### LogicApps_ListWorkflows ```java -import com.azure.resourcemanager.appcontainers.models.Container; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; -import com.azure.resourcemanager.appcontainers.models.ContainerResources; -import com.azure.resourcemanager.appcontainers.models.InitContainer; -import com.azure.resourcemanager.appcontainers.models.Job; -import com.azure.resourcemanager.appcontainers.models.JobConfiguration; -import com.azure.resourcemanager.appcontainers.models.JobConfigurationManualTriggerConfig; -import com.azure.resourcemanager.appcontainers.models.JobPatchPropertiesProperties; -import com.azure.resourcemanager.appcontainers.models.JobTemplate; -import com.azure.resourcemanager.appcontainers.models.TriggerType; -import com.azure.resourcemanager.appcontainers.models.Type; -import java.util.Arrays; - /** - * Samples for Jobs Update. + * Samples for LogicApps ListWorkflows. */ -public final class JobsUpdateSamples { +public final class LogicAppsListWorkflowsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Patch.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_ListWorkflows.json */ /** - * Sample code: Patch Container Apps Job. + * Sample code: List the workflows. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void patchContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - Job resource = manager.jobs() - .getByResourceGroupWithResponse("rg", "testcontainerappsjob0", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withProperties(new JobPatchPropertiesProperties() - .withConfiguration(new JobConfiguration().withTriggerType(TriggerType.MANUAL) - .withReplicaTimeout(10) - .withReplicaRetryLimit(10) - .withManualTriggerConfig( - new JobConfigurationManualTriggerConfig().withReplicaCompletionCount(1).withParallelism(4))) - .withTemplate(new JobTemplate() - .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerappsjob0:v4") - .withName("testinitcontainerAppsJob0") - .withCommand(Arrays.asList("/bin/sh")) - .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) - .withResources(new ContainerResources().withCpu(0.5D).withMemory("1Gi")))) - .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerappsjob0:v1") - .withName("testcontainerappsjob0") - .withProbes(Arrays.asList(new ContainerAppProbe() - .withHttpGet(new ContainerAppProbeHttpGet() - .withHttpHeaders(Arrays - .asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("Custom-Header") - .withValue("Awesome"))) - .withPath("/health") - .withPort(8080)) - .withInitialDelaySeconds(3) - .withPeriodSeconds(3) - .withType(Type.LIVENESS))))))) - .apply(); + public static void listTheWorkflows(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.logicApps() + .listWorkflows("examplerg", "testcontainerApp0", "testcontainerApp0", com.azure.core.util.Context.NONE); } } ``` -### JobsExecutions_List +### LogicApps_ListWorkflowsConnections ```java /** - * Samples for JobsExecutions List. + * Samples for LogicApps ListWorkflowsConnections. */ -public final class JobsExecutionsListSamples { +public final class LogicAppsListWorkflowsConnectionsSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Executions_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_ListConnections. + * json */ /** - * Sample code: Get a Container Apps Job Executions. + * Sample code: List the Workflows Configuration Connections. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void - getAContainerAppsJobExecutions(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobsExecutions().list("rg", "testcontainerappsjob0", null, com.azure.core.util.Context.NONE); + public static void listTheWorkflowsConfigurationConnections( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.logicApps() + .listWorkflowsConnectionsWithResponse("testrg123", "testapp2", "testapp2", + com.azure.core.util.Context.NONE); } } ``` @@ -2678,9 +5310,8 @@ import com.azure.resourcemanager.appcontainers.models.ManagedCertificateProperti */ public final class ManagedCertificatesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedCertificate_CreateOrUpdate. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedCertificate_CreateOrUpdate.json */ /** * Sample code: Create or Update Certificate. @@ -2709,7 +5340,8 @@ public final class ManagedCertificatesCreateOrUpdateSamples { public final class ManagedCertificatesDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedCertificate_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedCertificate_Delete. + * json */ /** * Sample code: Delete Certificate. @@ -2733,7 +5365,7 @@ public final class ManagedCertificatesDeleteSamples { public final class ManagedCertificatesGetSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedCertificate_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedCertificate_Get.json */ /** * Sample code: Get Certificate. @@ -2756,7 +5388,7 @@ public final class ManagedCertificatesGetSamples { */ public final class ManagedCertificatesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ManagedCertificates_ListByManagedEnvironment.json */ /** @@ -2784,7 +5416,8 @@ import java.util.Map; public final class ManagedCertificatesUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedCertificates_Patch.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedCertificates_Patch. + * json */ /** * Sample code: Patch Managed Certificate. @@ -2822,9 +5455,8 @@ public final class ManagedCertificatesUpdateSamples { */ public final class ManagedEnvironmentDiagnosticsGetDetectorSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironmentDiagnostics_Get. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentDiagnostics_Get.json */ /** * Sample code: Get diagnostic data for a managed environments. @@ -2848,9 +5480,8 @@ public final class ManagedEnvironmentDiagnosticsGetDetectorSamples { */ public final class ManagedEnvironmentDiagnosticsListDetectorsSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironmentDiagnostics_List. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentDiagnostics_List.json */ /** * Sample code: Get the list of available diagnostic data for a managed environments. @@ -2865,6 +5496,136 @@ public final class ManagedEnvironmentDiagnosticsListDetectorsSamples { } ``` +### ManagedEnvironmentPrivateEndpointConnections_CreateOrUpdate + +```java +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointConnection; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.appcontainers.models.PrivateLinkServiceConnectionState; + +/** + * Samples for ManagedEnvironmentPrivateEndpointConnections CreateOrUpdate. + */ +public final class ManagedEnvironmentPrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentPrivateEndpointConnections_CreateOrUpdate.json + */ + /** + * Sample code: Update a Private Endpoint Connection by Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void updateAPrivateEndpointConnectionByManagedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + PrivateEndpointConnection resource = manager.managedEnvironmentPrivateEndpointConnections() + .getWithResponse("examplerg", "managedEnv", "jlaw-demo1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withActionsRequired("None")) + .apply(); + } +} +``` + +### ManagedEnvironmentPrivateEndpointConnections_Delete + +```java +/** + * Samples for ManagedEnvironmentPrivateEndpointConnections Delete. + */ +public final class ManagedEnvironmentPrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentPrivateEndpointConnections_Delete.json + */ + /** + * Sample code: Delete a Private Endpoint Connection by Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteAPrivateEndpointConnectionByManagedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.managedEnvironmentPrivateEndpointConnections() + .delete("examplerg", "managedEnv", "jlaw-demo1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedEnvironmentPrivateEndpointConnections_Get + +```java +/** + * Samples for ManagedEnvironmentPrivateEndpointConnections Get. + */ +public final class ManagedEnvironmentPrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentPrivateEndpointConnections_Get.json + */ + /** + * Sample code: Get a Private Endpoint Connection by Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getAPrivateEndpointConnectionByManagedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.managedEnvironmentPrivateEndpointConnections() + .getWithResponse("examplerg", "managedEnv", "jlaw-demo1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedEnvironmentPrivateEndpointConnections_List + +```java +/** + * Samples for ManagedEnvironmentPrivateEndpointConnections List. + */ +public final class ManagedEnvironmentPrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentPrivateEndpointConnections_List.json + */ + /** + * Sample code: List Private Endpoint Connections by Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listPrivateEndpointConnectionsByManagedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.managedEnvironmentPrivateEndpointConnections() + .list("examplerg", "managedEnv", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedEnvironmentPrivateLinkResources_List + +```java +/** + * Samples for ManagedEnvironmentPrivateLinkResources List. + */ +public final class ManagedEnvironmentPrivateLinkResourcesListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentPrivateLinkResources_List.json + */ + /** + * Sample code: List Private Link Resources by Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listPrivateLinkResourcesByManagedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.managedEnvironmentPrivateLinkResources() + .list("examplerg", "managedEnv", com.azure.core.util.Context.NONE); + } +} +``` + ### ManagedEnvironmentUsages_List ```java @@ -2873,8 +5634,8 @@ public final class ManagedEnvironmentDiagnosticsListDetectorsSamples { */ public final class ManagedEnvironmentUsagesListSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironmentUsages_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentUsages_List.json */ /** * Sample code: List managed environment usages. @@ -2891,23 +5652,37 @@ public final class ManagedEnvironmentUsagesListSamples { ### ManagedEnvironments_CreateOrUpdate ```java +import com.azure.resourcemanager.appcontainers.models.AppInsightsConfiguration; import com.azure.resourcemanager.appcontainers.models.AppLogsConfiguration; import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; +import com.azure.resourcemanager.appcontainers.models.DataDogConfiguration; +import com.azure.resourcemanager.appcontainers.models.DestinationsConfiguration; +import com.azure.resourcemanager.appcontainers.models.Header; import com.azure.resourcemanager.appcontainers.models.LogAnalyticsConfiguration; +import com.azure.resourcemanager.appcontainers.models.LogsConfiguration; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerAuthentication; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfiguration; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.appcontainers.models.MetricsConfiguration; import com.azure.resourcemanager.appcontainers.models.Mtls; +import com.azure.resourcemanager.appcontainers.models.OpenTelemetryConfiguration; +import com.azure.resourcemanager.appcontainers.models.OtlpConfiguration; +import com.azure.resourcemanager.appcontainers.models.TracesConfiguration; +import com.azure.resourcemanager.appcontainers.models.UserAssignedIdentity; import com.azure.resourcemanager.appcontainers.models.VnetConfiguration; import com.azure.resourcemanager.appcontainers.models.WorkloadProfile; import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; /** * Samples for ManagedEnvironments CreateOrUpdate. */ public final class ManagedEnvironmentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ManagedEnvironments_CustomInfrastructureResourceGroup_Create.json */ /** @@ -2933,6 +5708,7 @@ public final class ManagedEnvironmentsCreateOrUpdateSamples { .withCertificatePassword("fakeTokenPlaceholder")) .withWorkloadProfiles(Arrays.asList( new WorkloadProfile().withName("My-GP-01") + .withEnableFips(true) .withWorkloadProfileType("GeneralPurpose") .withMinimumCount(3) .withMaximumCount(12), @@ -2950,9 +5726,8 @@ public final class ManagedEnvironmentsCreateOrUpdateSamples { } /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironments_CreateOrUpdate. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironments_CreateOrUpdate.json */ /** * Sample code: Create environments. @@ -2964,18 +5739,44 @@ public final class ManagedEnvironmentsCreateOrUpdateSamples { .define("testcontainerenv") .withRegion("East US") .withExistingResourceGroup("examplerg") + .withIdentity(new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.fromString("SystemAssigned, UserAssigned")) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity", + new UserAssignedIdentity()))) .withDaprAIConnectionString( "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/") .withVnetConfiguration(new VnetConfiguration().withInfrastructureSubnetId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1")) - .withAppLogsConfiguration(new AppLogsConfiguration().withLogAnalyticsConfiguration( - new LogAnalyticsConfiguration().withCustomerId("string").withSharedKey("fakeTokenPlaceholder"))) + .withAppLogsConfiguration(new AppLogsConfiguration() + .withLogAnalyticsConfiguration(new LogAnalyticsConfiguration().withCustomerId("string") + .withSharedKey("fakeTokenPlaceholder") + .withDynamicJsonColumns(true))) + .withAppInsightsConfiguration(new AppInsightsConfiguration().withConnectionString( + "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://eastus-8.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/")) + .withOpenTelemetryConfiguration( + new OpenTelemetryConfiguration() + .withDestinationsConfiguration( + new DestinationsConfiguration() + .withDataDogConfiguration( + new DataDogConfiguration().withSite("string").withKey("fakeTokenPlaceholder")) + .withOtlpConfigurations(Arrays.asList(new OtlpConfiguration().withName("dashboard") + .withEndpoint("dashboard.k8s.region.azurecontainerapps.io:80") + .withInsecure(true) + .withHeaders(Arrays + .asList(new Header().withKey("fakeTokenPlaceholder").withValue("xxxxxxxxxxx")))))) + .withTracesConfiguration( + new TracesConfiguration().withIncludeDapr(true).withDestinations(Arrays.asList("appInsights"))) + .withLogsConfiguration(new LogsConfiguration().withDestinations(Arrays.asList("appInsights"))) + .withMetricsConfiguration( + new MetricsConfiguration().withIncludeKeda(true).withDestinations(Arrays.asList("dataDog")))) .withZoneRedundant(true) .withCustomDomainConfiguration(new CustomDomainConfiguration().withDnsSuffix("www.my-name.com") .withCertificateValue("Y2VydA==".getBytes()) .withCertificatePassword("fakeTokenPlaceholder")) .withWorkloadProfiles(Arrays.asList( new WorkloadProfile().withName("My-GP-01") + .withEnableFips(true) .withWorkloadProfileType("GeneralPurpose") .withMinimumCount(3) .withMaximumCount(12), @@ -2994,6 +5795,18 @@ public final class ManagedEnvironmentsCreateOrUpdateSamples { .withEncryption(new ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption().withEnabled(true))) .create(); } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } ``` @@ -3006,7 +5819,8 @@ public final class ManagedEnvironmentsCreateOrUpdateSamples { public final class ManagedEnvironmentsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironments_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_Delete. + * json */ /** * Sample code: Delete environment by name. @@ -3028,8 +5842,8 @@ public final class ManagedEnvironmentsDeleteSamples { */ public final class ManagedEnvironmentsGetAuthTokenSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironments_GetAuthToken.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironments_GetAuthToken.json */ /** * Sample code: Get Managed Environment Auth Token. @@ -3052,7 +5866,7 @@ public final class ManagedEnvironmentsGetAuthTokenSamples { public final class ManagedEnvironmentsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironments_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_Get.json */ /** * Sample code: Get environments by name. @@ -3074,7 +5888,7 @@ public final class ManagedEnvironmentsGetByResourceGroupSamples { */ public final class ManagedEnvironmentsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ManagedEnvironments_ListBySubscription.json */ /** @@ -3097,7 +5911,7 @@ public final class ManagedEnvironmentsListSamples { */ public final class ManagedEnvironmentsListByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ManagedEnvironments_ListByResourceGroup.json */ /** @@ -3120,7 +5934,7 @@ public final class ManagedEnvironmentsListByResourceGroupSamples { */ public final class ManagedEnvironmentsListWorkloadProfileStatesSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ManagedEnvironments_ListWorkloadProfileStates.json */ /** @@ -3149,7 +5963,8 @@ import java.util.Map; public final class ManagedEnvironmentsUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironments_Patch.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_Patch. + * json */ /** * Sample code: Patch Managed Environment. @@ -3187,7 +6002,7 @@ public final class ManagedEnvironmentsUpdateSamples { public final class ManagedEnvironmentsDiagnosticsGetRootSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironments_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_Get.json */ /** * Sample code: Get environments by name. @@ -3207,13 +6022,35 @@ public final class ManagedEnvironmentsDiagnosticsGetRootSamples { import com.azure.resourcemanager.appcontainers.models.AccessMode; import com.azure.resourcemanager.appcontainers.models.AzureFileProperties; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentStorageProperties; +import com.azure.resourcemanager.appcontainers.models.NfsAzureFileProperties; /** * Samples for ManagedEnvironmentsStorages CreateOrUpdate. */ public final class ManagedEnvironmentsStoragesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentsStorages_CreateOrUpdate_NfsAzureFile.json + */ + /** + * Sample code: Create or update environments storage for NFS Azure file. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateEnvironmentsStorageForNFSAzureFile( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.managedEnvironmentsStorages() + .define("jlaw-demo1") + .withExistingManagedEnvironment("examplerg", "managedEnv") + .withProperties(new ManagedEnvironmentStorageProperties() + .withNfsAzureFile(new NfsAzureFileProperties().withServer("server1") + .withAccessMode(AccessMode.READ_ONLY) + .withShareName("share1"))) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ManagedEnvironmentsStorages_CreateOrUpdate.json */ /** @@ -3244,9 +6081,8 @@ public final class ManagedEnvironmentsStoragesCreateOrUpdateSamples { */ public final class ManagedEnvironmentsStoragesDeleteSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironmentsStorages_Delete. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentsStorages_Delete.json */ /** * Sample code: List environments storages by subscription. @@ -3269,15 +6105,30 @@ public final class ManagedEnvironmentsStoragesDeleteSamples { */ public final class ManagedEnvironmentsStoragesGetSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironmentsStorages_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentsStorages_Get.json */ /** - * Sample code: get a environments storage properties by subscription. + * Sample code: get a environments storage. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void getAEnvironmentsStoragePropertiesBySubscription( + public static void + getAEnvironmentsStorage(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.managedEnvironmentsStorages() + .getWithResponse("examplerg", "managedEnv", "jlaw-demo1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentsStorages_Get_NfsAzureFile.json + */ + /** + * Sample code: get a environments storage for NFS Azure file. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getAEnvironmentsStorageForNFSAzureFile( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager.managedEnvironmentsStorages() .getWithResponse("examplerg", "managedEnv", "jlaw-demo1", com.azure.core.util.Context.NONE); @@ -3293,8 +6144,8 @@ public final class ManagedEnvironmentsStoragesGetSamples { */ public final class ManagedEnvironmentsStoragesListSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironmentsStorages_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentsStorages_List.json */ /** * Sample code: List environments storages by subscription. @@ -3319,9 +6170,8 @@ import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityReque */ public final class NamespacesCheckNameAvailabilitySamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificates_CheckNameAvailability. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * Certificates_CheckNameAvailability.json */ /** * Sample code: Certificates_CheckNameAvailability. @@ -3338,9 +6188,8 @@ public final class NamespacesCheckNameAvailabilitySamples { } /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_CheckNameAvailability. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerApps_CheckNameAvailability.json */ /** * Sample code: ContainerApps_CheckNameAvailability. @@ -3366,7 +6215,7 @@ public final class NamespacesCheckNameAvailabilitySamples { public final class OperationsListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Operations_List.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Operations_List.json */ /** * Sample code: List all operations. @@ -3387,7 +6236,7 @@ public final class OperationsListSamples { */ public final class ResourceProviderGetCustomDomainVerificationIdSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * Subscriptions_GetCustomDomainVerificationId.json */ /** @@ -3410,7 +6259,7 @@ public final class ResourceProviderGetCustomDomainVerificationIdSamples { public final class ResourceProviderJobExecutionSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Execution_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Execution_Get.json */ /** * Sample code: Get a single Job Execution. @@ -3419,7 +6268,7 @@ public final class ResourceProviderJobExecutionSamples { */ public static void getASingleJobExecution(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager.resourceProviders() - .jobExecutionWithResponse("rg", "testcontainerappsjob0", "jobExecution1", com.azure.core.util.Context.NONE); + .jobExecutionWithResponse("rg", "testcontainerAppsJob0", "jobExecution1", com.azure.core.util.Context.NONE); } } ``` @@ -3432,7 +6281,8 @@ public final class ResourceProviderJobExecutionSamples { */ public final class UsagesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Usages_List.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Usages_List.json */ /** * Sample code: List usages. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml b/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml index 06f028b47308f..f847eeb69db04 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for ContainerAppsApi Management - This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2024-03. + This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Functions is an extension resource to revisions and the api listed is used to proxy the call from Web RP to the function app's host process, this api is not exposed to users and only Web RP is allowed to invoke functions extension resource. Package tag package-preview-2024-08. https://github.com/Azure/azure-sdk-for-java @@ -45,6 +45,7 @@ UTF-8 0 0 + true diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/ContainerAppsApiManager.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/ContainerAppsApiManager.java index 3adad59609349..8685cca50b407 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/ContainerAppsApiManager.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/ContainerAppsApiManager.java @@ -24,8 +24,13 @@ import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsApiClient; +import com.azure.resourcemanager.appcontainers.implementation.AppResilienciesImpl; import com.azure.resourcemanager.appcontainers.implementation.AvailableWorkloadProfilesImpl; import com.azure.resourcemanager.appcontainers.implementation.BillingMetersImpl; +import com.azure.resourcemanager.appcontainers.implementation.BuildAuthTokensImpl; +import com.azure.resourcemanager.appcontainers.implementation.BuildersImpl; +import com.azure.resourcemanager.appcontainers.implementation.BuildsByBuilderResourcesImpl; +import com.azure.resourcemanager.appcontainers.implementation.BuildsImpl; import com.azure.resourcemanager.appcontainers.implementation.CertificatesImpl; import com.azure.resourcemanager.appcontainers.implementation.ConnectedEnvironmentsCertificatesImpl; import com.azure.resourcemanager.appcontainers.implementation.ConnectedEnvironmentsDaprComponentsImpl; @@ -33,16 +38,28 @@ import com.azure.resourcemanager.appcontainers.implementation.ConnectedEnvironmentsStoragesImpl; import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsApiClientBuilder; import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsAuthConfigsImpl; +import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsBuildsByContainerAppsImpl; +import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsBuildsImpl; import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsDiagnosticsImpl; import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsImpl; +import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsPatchesImpl; import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsRevisionReplicasImpl; import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsRevisionsImpl; +import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsSessionPoolsImpl; import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsSourceControlsImpl; +import com.azure.resourcemanager.appcontainers.implementation.DaprComponentResiliencyPoliciesImpl; import com.azure.resourcemanager.appcontainers.implementation.DaprComponentsImpl; +import com.azure.resourcemanager.appcontainers.implementation.DaprSubscriptionsImpl; +import com.azure.resourcemanager.appcontainers.implementation.DotNetComponentsImpl; +import com.azure.resourcemanager.appcontainers.implementation.FunctionsExtensionsImpl; +import com.azure.resourcemanager.appcontainers.implementation.JavaComponentsImpl; import com.azure.resourcemanager.appcontainers.implementation.JobsExecutionsImpl; import com.azure.resourcemanager.appcontainers.implementation.JobsImpl; +import com.azure.resourcemanager.appcontainers.implementation.LogicAppsImpl; import com.azure.resourcemanager.appcontainers.implementation.ManagedCertificatesImpl; import com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentDiagnosticsImpl; +import com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentPrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentPrivateLinkResourcesImpl; import com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentsDiagnosticsImpl; import com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentsImpl; import com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentsStoragesImpl; @@ -51,8 +68,13 @@ import com.azure.resourcemanager.appcontainers.implementation.OperationsImpl; import com.azure.resourcemanager.appcontainers.implementation.ResourceProvidersImpl; import com.azure.resourcemanager.appcontainers.implementation.UsagesImpl; +import com.azure.resourcemanager.appcontainers.models.AppResiliencies; import com.azure.resourcemanager.appcontainers.models.AvailableWorkloadProfiles; import com.azure.resourcemanager.appcontainers.models.BillingMeters; +import com.azure.resourcemanager.appcontainers.models.BuildAuthTokens; +import com.azure.resourcemanager.appcontainers.models.Builders; +import com.azure.resourcemanager.appcontainers.models.Builds; +import com.azure.resourcemanager.appcontainers.models.BuildsByBuilderResources; import com.azure.resourcemanager.appcontainers.models.Certificates; import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironments; import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentsCertificates; @@ -60,15 +82,27 @@ import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentsStorages; import com.azure.resourcemanager.appcontainers.models.ContainerApps; import com.azure.resourcemanager.appcontainers.models.ContainerAppsAuthConfigs; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsBuilds; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsBuildsByContainerApps; import com.azure.resourcemanager.appcontainers.models.ContainerAppsDiagnostics; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsPatches; import com.azure.resourcemanager.appcontainers.models.ContainerAppsRevisionReplicas; import com.azure.resourcemanager.appcontainers.models.ContainerAppsRevisions; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsSessionPools; import com.azure.resourcemanager.appcontainers.models.ContainerAppsSourceControls; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicies; import com.azure.resourcemanager.appcontainers.models.DaprComponents; +import com.azure.resourcemanager.appcontainers.models.DaprSubscriptions; +import com.azure.resourcemanager.appcontainers.models.DotNetComponents; +import com.azure.resourcemanager.appcontainers.models.FunctionsExtensions; +import com.azure.resourcemanager.appcontainers.models.JavaComponents; import com.azure.resourcemanager.appcontainers.models.Jobs; import com.azure.resourcemanager.appcontainers.models.JobsExecutions; +import com.azure.resourcemanager.appcontainers.models.LogicApps; import com.azure.resourcemanager.appcontainers.models.ManagedCertificates; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentDiagnostics; +import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPrivateEndpointConnections; +import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPrivateLinkResources; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironments; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentsDiagnostics; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentsStorages; @@ -86,14 +120,27 @@ /** * Entry point to ContainerAppsApiManager. + * Functions is an extension resource to revisions and the api listed is used to proxy the call from Web RP to the + * function app's host process, this api is not exposed to users and only Web RP is allowed to invoke functions + * extension resource. */ public final class ContainerAppsApiManager { + private AppResiliencies appResiliencies; + private ContainerAppsAuthConfigs containerAppsAuthConfigs; private AvailableWorkloadProfiles availableWorkloadProfiles; private BillingMeters billingMeters; + private Builders builders; + + private BuildsByBuilderResources buildsByBuilderResources; + + private Builds builds; + + private BuildAuthTokens buildAuthTokens; + private ConnectedEnvironments connectedEnvironments; private ConnectedEnvironmentsCertificates connectedEnvironmentsCertificates; @@ -104,6 +151,12 @@ public final class ContainerAppsApiManager { private ContainerApps containerApps; + private ContainerAppsBuildsByContainerApps containerAppsBuildsByContainerApps; + + private ContainerAppsBuilds containerAppsBuilds; + + private ContainerAppsPatches containerAppsPatches; + private ContainerAppsRevisions containerAppsRevisions; private ContainerAppsRevisionReplicas containerAppsRevisionReplicas; @@ -116,12 +169,20 @@ public final class ContainerAppsApiManager { private Jobs jobs; + private DotNetComponents dotNetComponents; + + private FunctionsExtensions functionsExtensions; + private Operations operations; + private JavaComponents javaComponents; + private JobsExecutions jobsExecutions; private ResourceProviders resourceProviders; + private LogicApps logicApps; + private ManagedEnvironments managedEnvironments; private Certificates certificates; @@ -130,10 +191,20 @@ public final class ContainerAppsApiManager { private Namespaces namespaces; + private ManagedEnvironmentPrivateEndpointConnections managedEnvironmentPrivateEndpointConnections; + + private ManagedEnvironmentPrivateLinkResources managedEnvironmentPrivateLinkResources; + + private DaprComponentResiliencyPolicies daprComponentResiliencyPolicies; + private DaprComponents daprComponents; + private DaprSubscriptions daprSubscriptions; + private ManagedEnvironmentsStorages managedEnvironmentsStorages; + private ContainerAppsSessionPools containerAppsSessionPools; + private ContainerAppsSourceControls containerAppsSourceControls; private Usages usages; @@ -304,7 +375,7 @@ public ContainerAppsApiManager authenticate(TokenCredential credential, AzurePro .append("-") .append("com.azure.resourcemanager.appcontainers") .append("/") - .append("1.0.0"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -350,6 +421,18 @@ public ContainerAppsApiManager authenticate(TokenCredential credential, AzurePro } } + /** + * Gets the resource collection API of AppResiliencies. It manages AppResiliency. + * + * @return Resource collection API of AppResiliencies. + */ + public AppResiliencies appResiliencies() { + if (this.appResiliencies == null) { + this.appResiliencies = new AppResilienciesImpl(clientObject.getAppResiliencies(), this); + } + return appResiliencies; + } + /** * Gets the resource collection API of ContainerAppsAuthConfigs. It manages AuthConfig. * @@ -388,6 +471,55 @@ public BillingMeters billingMeters() { return billingMeters; } + /** + * Gets the resource collection API of Builders. It manages BuilderResource. + * + * @return Resource collection API of Builders. + */ + public Builders builders() { + if (this.builders == null) { + this.builders = new BuildersImpl(clientObject.getBuilders(), this); + } + return builders; + } + + /** + * Gets the resource collection API of BuildsByBuilderResources. + * + * @return Resource collection API of BuildsByBuilderResources. + */ + public BuildsByBuilderResources buildsByBuilderResources() { + if (this.buildsByBuilderResources == null) { + this.buildsByBuilderResources + = new BuildsByBuilderResourcesImpl(clientObject.getBuildsByBuilderResources(), this); + } + return buildsByBuilderResources; + } + + /** + * Gets the resource collection API of Builds. It manages BuildResource. + * + * @return Resource collection API of Builds. + */ + public Builds builds() { + if (this.builds == null) { + this.builds = new BuildsImpl(clientObject.getBuilds(), this); + } + return builds; + } + + /** + * Gets the resource collection API of BuildAuthTokens. + * + * @return Resource collection API of BuildAuthTokens. + */ + public BuildAuthTokens buildAuthTokens() { + if (this.buildAuthTokens == null) { + this.buildAuthTokens = new BuildAuthTokensImpl(clientObject.getBuildAuthTokens(), this); + } + return buildAuthTokens; + } + /** * Gets the resource collection API of ConnectedEnvironments. It manages ConnectedEnvironment. * @@ -451,6 +583,43 @@ public ContainerApps containerApps() { return containerApps; } + /** + * Gets the resource collection API of ContainerAppsBuildsByContainerApps. + * + * @return Resource collection API of ContainerAppsBuildsByContainerApps. + */ + public ContainerAppsBuildsByContainerApps containerAppsBuildsByContainerApps() { + if (this.containerAppsBuildsByContainerApps == null) { + this.containerAppsBuildsByContainerApps = new ContainerAppsBuildsByContainerAppsImpl( + clientObject.getContainerAppsBuildsByContainerApps(), this); + } + return containerAppsBuildsByContainerApps; + } + + /** + * Gets the resource collection API of ContainerAppsBuilds. + * + * @return Resource collection API of ContainerAppsBuilds. + */ + public ContainerAppsBuilds containerAppsBuilds() { + if (this.containerAppsBuilds == null) { + this.containerAppsBuilds = new ContainerAppsBuildsImpl(clientObject.getContainerAppsBuilds(), this); + } + return containerAppsBuilds; + } + + /** + * Gets the resource collection API of ContainerAppsPatches. + * + * @return Resource collection API of ContainerAppsPatches. + */ + public ContainerAppsPatches containerAppsPatches() { + if (this.containerAppsPatches == null) { + this.containerAppsPatches = new ContainerAppsPatchesImpl(clientObject.getContainerAppsPatches(), this); + } + return containerAppsPatches; + } + /** * Gets the resource collection API of ContainerAppsRevisions. * @@ -528,6 +697,30 @@ public Jobs jobs() { return jobs; } + /** + * Gets the resource collection API of DotNetComponents. It manages DotNetComponent. + * + * @return Resource collection API of DotNetComponents. + */ + public DotNetComponents dotNetComponents() { + if (this.dotNetComponents == null) { + this.dotNetComponents = new DotNetComponentsImpl(clientObject.getDotNetComponents(), this); + } + return dotNetComponents; + } + + /** + * Gets the resource collection API of FunctionsExtensions. + * + * @return Resource collection API of FunctionsExtensions. + */ + public FunctionsExtensions functionsExtensions() { + if (this.functionsExtensions == null) { + this.functionsExtensions = new FunctionsExtensionsImpl(clientObject.getFunctionsExtensions(), this); + } + return functionsExtensions; + } + /** * Gets the resource collection API of Operations. * @@ -540,6 +733,18 @@ public Operations operations() { return operations; } + /** + * Gets the resource collection API of JavaComponents. It manages JavaComponent. + * + * @return Resource collection API of JavaComponents. + */ + public JavaComponents javaComponents() { + if (this.javaComponents == null) { + this.javaComponents = new JavaComponentsImpl(clientObject.getJavaComponents(), this); + } + return javaComponents; + } + /** * Gets the resource collection API of JobsExecutions. * @@ -564,6 +769,18 @@ public ResourceProviders resourceProviders() { return resourceProviders; } + /** + * Gets the resource collection API of LogicApps. It manages LogicApp. + * + * @return Resource collection API of LogicApps. + */ + public LogicApps logicApps() { + if (this.logicApps == null) { + this.logicApps = new LogicAppsImpl(clientObject.getLogicApps(), this); + } + return logicApps; + } + /** * Gets the resource collection API of ManagedEnvironments. It manages ManagedEnvironment. * @@ -612,6 +829,46 @@ public Namespaces namespaces() { return namespaces; } + /** + * Gets the resource collection API of ManagedEnvironmentPrivateEndpointConnections. It manages + * PrivateEndpointConnection. + * + * @return Resource collection API of ManagedEnvironmentPrivateEndpointConnections. + */ + public ManagedEnvironmentPrivateEndpointConnections managedEnvironmentPrivateEndpointConnections() { + if (this.managedEnvironmentPrivateEndpointConnections == null) { + this.managedEnvironmentPrivateEndpointConnections = new ManagedEnvironmentPrivateEndpointConnectionsImpl( + clientObject.getManagedEnvironmentPrivateEndpointConnections(), this); + } + return managedEnvironmentPrivateEndpointConnections; + } + + /** + * Gets the resource collection API of ManagedEnvironmentPrivateLinkResources. + * + * @return Resource collection API of ManagedEnvironmentPrivateLinkResources. + */ + public ManagedEnvironmentPrivateLinkResources managedEnvironmentPrivateLinkResources() { + if (this.managedEnvironmentPrivateLinkResources == null) { + this.managedEnvironmentPrivateLinkResources = new ManagedEnvironmentPrivateLinkResourcesImpl( + clientObject.getManagedEnvironmentPrivateLinkResources(), this); + } + return managedEnvironmentPrivateLinkResources; + } + + /** + * Gets the resource collection API of DaprComponentResiliencyPolicies. It manages DaprComponentResiliencyPolicy. + * + * @return Resource collection API of DaprComponentResiliencyPolicies. + */ + public DaprComponentResiliencyPolicies daprComponentResiliencyPolicies() { + if (this.daprComponentResiliencyPolicies == null) { + this.daprComponentResiliencyPolicies + = new DaprComponentResiliencyPoliciesImpl(clientObject.getDaprComponentResiliencyPolicies(), this); + } + return daprComponentResiliencyPolicies; + } + /** * Gets the resource collection API of DaprComponents. * @@ -624,6 +881,18 @@ public DaprComponents daprComponents() { return daprComponents; } + /** + * Gets the resource collection API of DaprSubscriptions. It manages DaprSubscription. + * + * @return Resource collection API of DaprSubscriptions. + */ + public DaprSubscriptions daprSubscriptions() { + if (this.daprSubscriptions == null) { + this.daprSubscriptions = new DaprSubscriptionsImpl(clientObject.getDaprSubscriptions(), this); + } + return daprSubscriptions; + } + /** * Gets the resource collection API of ManagedEnvironmentsStorages. It manages ManagedEnvironmentStorage. * @@ -637,6 +906,19 @@ public ManagedEnvironmentsStorages managedEnvironmentsStorages() { return managedEnvironmentsStorages; } + /** + * Gets the resource collection API of ContainerAppsSessionPools. It manages SessionPool. + * + * @return Resource collection API of ContainerAppsSessionPools. + */ + public ContainerAppsSessionPools containerAppsSessionPools() { + if (this.containerAppsSessionPools == null) { + this.containerAppsSessionPools + = new ContainerAppsSessionPoolsImpl(clientObject.getContainerAppsSessionPools(), this); + } + return containerAppsSessionPools; + } + /** * Gets the resource collection API of ContainerAppsSourceControls. It manages SourceControl. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/AppResilienciesClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/AppResilienciesClient.java new file mode 100644 index 0000000000000..1a40d64209978 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/AppResilienciesClient.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.AppResiliencyInner; + +/** + * An instance of this class provides access to all the operations defined in AppResilienciesClient. + */ +public interface AppResilienciesClient { + /** + * Create or update an application's resiliency policy. + * + * Create or update container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param resiliencyEnvelope The resiliency policy to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration to setup App Resiliency along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String appName, String name, + AppResiliencyInner resiliencyEnvelope, Context context); + + /** + * Create or update an application's resiliency policy. + * + * Create or update container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param resiliencyEnvelope The resiliency policy to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration to setup App Resiliency. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppResiliencyInner createOrUpdate(String resourceGroupName, String appName, String name, + AppResiliencyInner resiliencyEnvelope); + + /** + * Update an application's resiliency policy. + * + * Update container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param resiliencyEnvelope The resiliency policy to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration to setup App Resiliency along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String appName, String name, + AppResiliencyInner resiliencyEnvelope, Context context); + + /** + * Update an application's resiliency policy. + * + * Update container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param resiliencyEnvelope The resiliency policy to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration to setup App Resiliency. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppResiliencyInner update(String resourceGroupName, String appName, String name, + AppResiliencyInner resiliencyEnvelope); + + /** + * Delete an application's resiliency policy. + * + * Delete container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String appName, String name, Context context); + + /** + * Delete an application's resiliency policy. + * + * Delete container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String appName, String name); + + /** + * Get an application's resiliency policy. + * + * Get container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container app resiliency policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String appName, String name, + Context context); + + /** + * Get an application's resiliency policy. + * + * Get container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container app resiliency policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppResiliencyInner get(String resourceGroupName, String appName, String name); + + /** + * List an application's resiliency policies. + * + * List container app resiliency policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of AppResiliency policies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String appName); + + /** + * List an application's resiliency policies. + * + * List container app resiliency policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of AppResiliency policies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String appName, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/BuildAuthTokensClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/BuildAuthTokensClient.java new file mode 100644 index 0000000000000..c794c5f7277a6 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/BuildAuthTokensClient.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.BuildTokenInner; + +/** + * An instance of this class provides access to all the operations defined in BuildAuthTokensClient. + */ +public interface BuildAuthTokensClient { + /** + * Gets the token used to connect to the endpoint where source code can be uploaded for a build. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the token used to connect to the endpoint where source code can be uploaded for a build along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String builderName, String buildName, + Context context); + + /** + * Gets the token used to connect to the endpoint where source code can be uploaded for a build. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the token used to connect to the endpoint where source code can be uploaded for a build. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuildTokenInner list(String resourceGroupName, String builderName, String buildName); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/BuildersClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/BuildersClient.java new file mode 100644 index 0000000000000..65cd73fe23a40 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/BuildersClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appcontainers.fluent.models.BuilderResourceInner; +import com.azure.resourcemanager.appcontainers.models.BuilderResourceUpdate; + +/** + * An instance of this class provides access to all the operations defined in BuildersClient. + */ +public interface BuildersClient { + /** + * List BuilderResource resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List BuilderResource resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List BuilderResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List BuilderResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuilderResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String builderName, + Context context); + + /** + * Get a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuilderResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuilderResourceInner getByResourceGroup(String resourceGroupName, String builderName); + + /** + * Create or update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information about the SourceToCloud builder resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BuilderResourceInner> beginCreateOrUpdate(String resourceGroupName, + String builderName, BuilderResourceInner builderEnvelope); + + /** + * Create or update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information about the SourceToCloud builder resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BuilderResourceInner> beginCreateOrUpdate(String resourceGroupName, + String builderName, BuilderResourceInner builderEnvelope, Context context); + + /** + * Create or update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the SourceToCloud builder resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuilderResourceInner createOrUpdate(String resourceGroupName, String builderName, + BuilderResourceInner builderEnvelope); + + /** + * Create or update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the SourceToCloud builder resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuilderResourceInner createOrUpdate(String resourceGroupName, String builderName, + BuilderResourceInner builderEnvelope, Context context); + + /** + * Update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information about the SourceToCloud builder resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BuilderResourceInner> beginUpdate(String resourceGroupName, + String builderName, BuilderResourceUpdate builderEnvelope); + + /** + * Update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information about the SourceToCloud builder resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BuilderResourceInner> beginUpdate(String resourceGroupName, + String builderName, BuilderResourceUpdate builderEnvelope, Context context); + + /** + * Update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the SourceToCloud builder resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuilderResourceInner update(String resourceGroupName, String builderName, BuilderResourceUpdate builderEnvelope); + + /** + * Update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the SourceToCloud builder resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuilderResourceInner update(String resourceGroupName, String builderName, BuilderResourceUpdate builderEnvelope, + Context context); + + /** + * Delete a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String builderName); + + /** + * Delete a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String builderName, Context context); + + /** + * Delete a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String builderName); + + /** + * Delete a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String builderName, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/BuildsByBuilderResourcesClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/BuildsByBuilderResourcesClient.java new file mode 100644 index 0000000000000..a957f2df2405a --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/BuildsByBuilderResourcesClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.BuildResourceInner; + +/** + * An instance of this class provides access to all the operations defined in BuildsByBuilderResourcesClient. + */ +public interface BuildsByBuilderResourcesClient { + /** + * List BuildResource resources by BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuildResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String builderName); + + /** + * List BuildResource resources by BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuildResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String builderName, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/BuildsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/BuildsClient.java new file mode 100644 index 0000000000000..5cce1f950e181 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/BuildsClient.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appcontainers.fluent.models.BuildResourceInner; + +/** + * An instance of this class provides access to all the operations defined in BuildsClient. + */ +public interface BuildsClient { + /** + * Get a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuildResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String builderName, String buildName, + Context context); + + /** + * Get a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuildResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuildResourceInner get(String resourceGroupName, String builderName, String buildName); + + /** + * Create a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param buildEnvelope Resource create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information pertaining to an individual build. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BuildResourceInner> beginCreateOrUpdate(String resourceGroupName, + String builderName, String buildName, BuildResourceInner buildEnvelope); + + /** + * Create a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param buildEnvelope Resource create or update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information pertaining to an individual build. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BuildResourceInner> beginCreateOrUpdate(String resourceGroupName, + String builderName, String buildName, BuildResourceInner buildEnvelope, Context context); + + /** + * Create a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param buildEnvelope Resource create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information pertaining to an individual build. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuildResourceInner createOrUpdate(String resourceGroupName, String builderName, String buildName, + BuildResourceInner buildEnvelope); + + /** + * Create a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param buildEnvelope Resource create or update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information pertaining to an individual build. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuildResourceInner createOrUpdate(String resourceGroupName, String builderName, String buildName, + BuildResourceInner buildEnvelope, Context context); + + /** + * Delete a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String builderName, String buildName); + + /** + * Delete a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String builderName, String buildName, + Context context); + + /** + * Delete a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String builderName, String buildName); + + /** + * Delete a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String builderName, String buildName, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsApiClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsApiClient.java index fffffeb4ae3c4..dafb90840eb0b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsApiClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsApiClient.java @@ -12,7 +12,7 @@ */ public interface ContainerAppsApiClient { /** - * Gets The ID of the target subscription. + * Gets The ID of the target subscription. The value must be an UUID. * * @return the subscriptionId value. */ @@ -46,6 +46,13 @@ public interface ContainerAppsApiClient { */ Duration getDefaultPollInterval(); + /** + * Gets the AppResilienciesClient object to access its operations. + * + * @return the AppResilienciesClient object. + */ + AppResilienciesClient getAppResiliencies(); + /** * Gets the ContainerAppsAuthConfigsClient object to access its operations. * @@ -67,6 +74,34 @@ public interface ContainerAppsApiClient { */ BillingMetersClient getBillingMeters(); + /** + * Gets the BuildersClient object to access its operations. + * + * @return the BuildersClient object. + */ + BuildersClient getBuilders(); + + /** + * Gets the BuildsByBuilderResourcesClient object to access its operations. + * + * @return the BuildsByBuilderResourcesClient object. + */ + BuildsByBuilderResourcesClient getBuildsByBuilderResources(); + + /** + * Gets the BuildsClient object to access its operations. + * + * @return the BuildsClient object. + */ + BuildsClient getBuilds(); + + /** + * Gets the BuildAuthTokensClient object to access its operations. + * + * @return the BuildAuthTokensClient object. + */ + BuildAuthTokensClient getBuildAuthTokens(); + /** * Gets the ConnectedEnvironmentsClient object to access its operations. * @@ -102,6 +137,27 @@ public interface ContainerAppsApiClient { */ ContainerAppsClient getContainerApps(); + /** + * Gets the ContainerAppsBuildsByContainerAppsClient object to access its operations. + * + * @return the ContainerAppsBuildsByContainerAppsClient object. + */ + ContainerAppsBuildsByContainerAppsClient getContainerAppsBuildsByContainerApps(); + + /** + * Gets the ContainerAppsBuildsClient object to access its operations. + * + * @return the ContainerAppsBuildsClient object. + */ + ContainerAppsBuildsClient getContainerAppsBuilds(); + + /** + * Gets the ContainerAppsPatchesClient object to access its operations. + * + * @return the ContainerAppsPatchesClient object. + */ + ContainerAppsPatchesClient getContainerAppsPatches(); + /** * Gets the ContainerAppsRevisionsClient object to access its operations. * @@ -144,6 +200,20 @@ public interface ContainerAppsApiClient { */ JobsClient getJobs(); + /** + * Gets the DotNetComponentsClient object to access its operations. + * + * @return the DotNetComponentsClient object. + */ + DotNetComponentsClient getDotNetComponents(); + + /** + * Gets the FunctionsExtensionsClient object to access its operations. + * + * @return the FunctionsExtensionsClient object. + */ + FunctionsExtensionsClient getFunctionsExtensions(); + /** * Gets the OperationsClient object to access its operations. * @@ -151,6 +221,13 @@ public interface ContainerAppsApiClient { */ OperationsClient getOperations(); + /** + * Gets the JavaComponentsClient object to access its operations. + * + * @return the JavaComponentsClient object. + */ + JavaComponentsClient getJavaComponents(); + /** * Gets the JobsExecutionsClient object to access its operations. * @@ -165,6 +242,13 @@ public interface ContainerAppsApiClient { */ ResourceProvidersClient getResourceProviders(); + /** + * Gets the LogicAppsClient object to access its operations. + * + * @return the LogicAppsClient object. + */ + LogicAppsClient getLogicApps(); + /** * Gets the ManagedEnvironmentsClient object to access its operations. * @@ -193,6 +277,27 @@ public interface ContainerAppsApiClient { */ NamespacesClient getNamespaces(); + /** + * Gets the ManagedEnvironmentPrivateEndpointConnectionsClient object to access its operations. + * + * @return the ManagedEnvironmentPrivateEndpointConnectionsClient object. + */ + ManagedEnvironmentPrivateEndpointConnectionsClient getManagedEnvironmentPrivateEndpointConnections(); + + /** + * Gets the ManagedEnvironmentPrivateLinkResourcesClient object to access its operations. + * + * @return the ManagedEnvironmentPrivateLinkResourcesClient object. + */ + ManagedEnvironmentPrivateLinkResourcesClient getManagedEnvironmentPrivateLinkResources(); + + /** + * Gets the DaprComponentResiliencyPoliciesClient object to access its operations. + * + * @return the DaprComponentResiliencyPoliciesClient object. + */ + DaprComponentResiliencyPoliciesClient getDaprComponentResiliencyPolicies(); + /** * Gets the DaprComponentsClient object to access its operations. * @@ -200,6 +305,13 @@ public interface ContainerAppsApiClient { */ DaprComponentsClient getDaprComponents(); + /** + * Gets the DaprSubscriptionsClient object to access its operations. + * + * @return the DaprSubscriptionsClient object. + */ + DaprSubscriptionsClient getDaprSubscriptions(); + /** * Gets the ManagedEnvironmentsStoragesClient object to access its operations. * @@ -207,6 +319,13 @@ public interface ContainerAppsApiClient { */ ManagedEnvironmentsStoragesClient getManagedEnvironmentsStorages(); + /** + * Gets the ContainerAppsSessionPoolsClient object to access its operations. + * + * @return the ContainerAppsSessionPoolsClient object. + */ + ContainerAppsSessionPoolsClient getContainerAppsSessionPools(); + /** * Gets the ContainerAppsSourceControlsClient object to access its operations. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsBuildsByContainerAppsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsBuildsByContainerAppsClient.java new file mode 100644 index 0000000000000..258e621ecb996 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsBuildsByContainerAppsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsBuildResourceInner; + +/** + * An instance of this class provides access to all the operations defined in ContainerAppsBuildsByContainerAppsClient. + */ +public interface ContainerAppsBuildsByContainerAppsClient { + /** + * List Container Apps Build resources by Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String containerAppName); + + /** + * List Container Apps Build resources by Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String containerAppName, + Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsBuildsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsBuildsClient.java new file mode 100644 index 0000000000000..7d3c288df126d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsBuildsClient.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsBuildResourceInner; + +/** + * An instance of this class provides access to all the operations defined in ContainerAppsBuildsClient. + */ +public interface ContainerAppsBuildsClient { + /** + * Get a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Build resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String containerAppName, + String buildName, Context context); + + /** + * Get a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Build resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerAppsBuildResourceInner get(String resourceGroupName, String containerAppName, String buildName); + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String containerAppName, String buildName); + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String containerAppName, String buildName, + Context context); + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String containerAppName, String buildName); + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String containerAppName, String buildName, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsPatchesClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsPatchesClient.java new file mode 100644 index 0000000000000..12ce9706f0b7f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsPatchesClient.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsPatchResourceInner; +import com.azure.resourcemanager.appcontainers.models.PatchSkipConfig; + +/** + * An instance of this class provides access to all the operations defined in ContainerAppsPatchesClient. + */ +public interface ContainerAppsPatchesClient { + /** + * List Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByContainerApp(String resourceGroupName, + String containerAppName); + + /** + * List Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param filter The filter to apply on the operation. For example, $filter=properties/patchApplyStatus eq + * 'Succeeded'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, + String filter, Context context); + + /** + * Get details for specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details for specific Container Apps Patch by patch name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String containerAppName, + String patchName, Context context); + + /** + * Get details for specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details for specific Container Apps Patch by patch name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerAppsPatchResourceInner get(String resourceGroupName, String containerAppName, String patchName); + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String containerAppName, String patchName); + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String containerAppName, String patchName, + Context context); + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String containerAppName, String patchName); + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String containerAppName, String patchName, Context context); + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginSkipConfigure(String resourceGroupName, String containerAppName, + String patchName, PatchSkipConfig patchSkipConfig); + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginSkipConfigure(String resourceGroupName, String containerAppName, + String patchName, PatchSkipConfig patchSkipConfig, Context context); + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void skipConfigure(String resourceGroupName, String containerAppName, String patchName, + PatchSkipConfig patchSkipConfig); + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void skipConfigure(String resourceGroupName, String containerAppName, String patchName, + PatchSkipConfig patchSkipConfig, Context context); + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Patch. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerAppsPatchResourceInner> + beginApply(String resourceGroupName, String containerAppName, String patchName); + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Patch. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerAppsPatchResourceInner> + beginApply(String resourceGroupName, String containerAppName, String patchName, Context context); + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Patch. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerAppsPatchResourceInner apply(String resourceGroupName, String containerAppName, String patchName); + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Patch. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerAppsPatchResourceInner apply(String resourceGroupName, String containerAppName, String patchName, + Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsSessionPoolsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsSessionPoolsClient.java new file mode 100644 index 0000000000000..78e691488e7d3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsSessionPoolsClient.java @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appcontainers.fluent.models.SessionPoolInner; +import com.azure.resourcemanager.appcontainers.models.SessionPoolUpdatableProperties; + +/** + * An instance of this class provides access to all the operations defined in ContainerAppsSessionPoolsClient. + */ +public interface ContainerAppsSessionPoolsClient { + /** + * Get the session pools in a given subscription. + * + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get the session pools in a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get the session pools in a given resource group of a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given resource group of a subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get the session pools in a given resource group of a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given resource group of a subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get the properties of a session pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String sessionPoolName, + Context context); + + /** + * Get the properties of a session pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionPoolInner getByResourceGroup(String resourceGroupName, String sessionPoolName); + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SessionPoolInner> beginCreateOrUpdate(String resourceGroupName, + String sessionPoolName, SessionPoolInner sessionPoolEnvelope); + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SessionPoolInner> beginCreateOrUpdate(String resourceGroupName, + String sessionPoolName, SessionPoolInner sessionPoolEnvelope, Context context); + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionPoolInner createOrUpdate(String resourceGroupName, String sessionPoolName, + SessionPoolInner sessionPoolEnvelope); + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionPoolInner createOrUpdate(String resourceGroupName, String sessionPoolName, + SessionPoolInner sessionPoolEnvelope, Context context); + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SessionPoolInner> beginUpdate(String resourceGroupName, + String sessionPoolName, SessionPoolUpdatableProperties sessionPoolEnvelope); + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SessionPoolInner> beginUpdate(String resourceGroupName, + String sessionPoolName, SessionPoolUpdatableProperties sessionPoolEnvelope, Context context); + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionPoolInner update(String resourceGroupName, String sessionPoolName, + SessionPoolUpdatableProperties sessionPoolEnvelope); + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SessionPoolInner update(String resourceGroupName, String sessionPoolName, + SessionPoolUpdatableProperties sessionPoolEnvelope, Context context); + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String sessionPoolName); + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String sessionPoolName, Context context); + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sessionPoolName); + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sessionPoolName, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsSourceControlsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsSourceControlsClient.java index 1d972a0620042..a0cd2b836d370 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsSourceControlsClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsSourceControlsClient.java @@ -105,6 +105,7 @@ SyncPoller, SourceControlInner> beginCreateOrUpda * @param containerAppName Name of the Container App. * @param sourceControlName Name of the Container App SourceControl. * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request @@ -114,7 +115,8 @@ SyncPoller, SourceControlInner> beginCreateOrUpda */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, SourceControlInner> beginCreateOrUpdate(String resourceGroupName, - String containerAppName, String sourceControlName, SourceControlInner sourceControlEnvelope, Context context); + String containerAppName, String sourceControlName, SourceControlInner sourceControlEnvelope, + String xMsGithubAuxiliary, Context context); /** * Create or update the SourceControl for a Container App. @@ -140,6 +142,7 @@ SourceControlInner createOrUpdate(String resourceGroupName, String containerAppN * @param containerAppName Name of the Container App. * @param sourceControlName Name of the Container App SourceControl. * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request @@ -149,7 +152,7 @@ SourceControlInner createOrUpdate(String resourceGroupName, String containerAppN */ @ServiceMethod(returns = ReturnType.SINGLE) SourceControlInner createOrUpdate(String resourceGroupName, String containerAppName, String sourceControlName, - SourceControlInner sourceControlEnvelope, Context context); + SourceControlInner sourceControlEnvelope, String xMsGithubAuxiliary, Context context); /** * Delete a Container App SourceControl. @@ -173,6 +176,9 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @param sourceControlName Name of the Container App SourceControl. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. + * @param ignoreWorkflowDeletionFailure Ignore Workflow Deletion Failure. + * @param deleteWorkflow Delete workflow. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request @@ -182,7 +188,8 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String containerAppName, - String sourceControlName, Context context); + String sourceControlName, String xMsGithubAuxiliary, Boolean ignoreWorkflowDeletionFailure, + Boolean deleteWorkflow, Context context); /** * Delete a Container App SourceControl. @@ -204,6 +211,9 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @param sourceControlName Name of the Container App SourceControl. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. + * @param ignoreWorkflowDeletionFailure Ignore Workflow Deletion Failure. + * @param deleteWorkflow Delete workflow. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request @@ -211,5 +221,6 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String containerAppName, String sourceControlName, Context context); + void delete(String resourceGroupName, String containerAppName, String sourceControlName, String xMsGithubAuxiliary, + Boolean ignoreWorkflowDeletionFailure, Boolean deleteWorkflow, Context context); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/DaprComponentResiliencyPoliciesClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/DaprComponentResiliencyPoliciesClient.java new file mode 100644 index 0000000000000..c057e69e3e88f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/DaprComponentResiliencyPoliciesClient.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentResiliencyPolicyInner; + +/** + * An instance of this class provides access to all the operations defined in DaprComponentResiliencyPoliciesClient. + */ +public interface DaprComponentResiliencyPoliciesClient { + /** + * Get the resiliency policies for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resiliency policies for a Dapr component as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName, + String componentName); + + /** + * Get the resiliency policies for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resiliency policies for a Dapr component as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName, + String componentName, Context context); + + /** + * Get a Dapr component resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Dapr component resiliency policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String environmentName, + String componentName, String name, Context context); + + /** + * Get a Dapr component resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Dapr component resiliency policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DaprComponentResiliencyPolicyInner get(String resourceGroupName, String environmentName, String componentName, + String name); + + /** + * Creates or updates a Dapr component resiliency policy. + * + * Creates or updates a resiliency policy for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @param daprComponentResiliencyPolicyEnvelope Configuration details of the Dapr Component Resiliency Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dapr Component Resiliency Policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, + String environmentName, String componentName, String name, + DaprComponentResiliencyPolicyInner daprComponentResiliencyPolicyEnvelope, Context context); + + /** + * Creates or updates a Dapr component resiliency policy. + * + * Creates or updates a resiliency policy for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @param daprComponentResiliencyPolicyEnvelope Configuration details of the Dapr Component Resiliency Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dapr Component Resiliency Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DaprComponentResiliencyPolicyInner createOrUpdate(String resourceGroupName, String environmentName, + String componentName, String name, DaprComponentResiliencyPolicyInner daprComponentResiliencyPolicyEnvelope); + + /** + * Delete a Dapr component resiliency policy. + * + * Delete a resiliency policy for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String environmentName, String componentName, + String name, Context context); + + /** + * Delete a Dapr component resiliency policy. + * + * Delete a resiliency policy for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String environmentName, String componentName, String name); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/DaprSubscriptionsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/DaprSubscriptionsClient.java new file mode 100644 index 0000000000000..363e068ef7e3e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/DaprSubscriptionsClient.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.DaprSubscriptionInner; + +/** + * An instance of this class provides access to all the operations defined in DaprSubscriptionsClient. + */ +public interface DaprSubscriptionsClient { + /** + * Get the Dapr subscriptions for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Dapr subscriptions for a managed environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName); + + /** + * Get the Dapr subscriptions for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Dapr subscriptions for a managed environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName, Context context); + + /** + * Get a dapr subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a dapr subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String environmentName, String name, + Context context); + + /** + * Get a dapr subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a dapr subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DaprSubscriptionInner get(String resourceGroupName, String environmentName, String name); + + /** + * Creates or updates a Dapr subscription. + * + * Creates or updates a Dapr subscription in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @param daprSubscriptionEnvelope Configuration details of the Dapr subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dapr PubSub Event Subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, + String name, DaprSubscriptionInner daprSubscriptionEnvelope, Context context); + + /** + * Creates or updates a Dapr subscription. + * + * Creates or updates a Dapr subscription in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @param daprSubscriptionEnvelope Configuration details of the Dapr subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dapr PubSub Event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DaprSubscriptionInner createOrUpdate(String resourceGroupName, String environmentName, String name, + DaprSubscriptionInner daprSubscriptionEnvelope); + + /** + * Delete a Dapr subscription. + * + * Delete a Dapr subscription from a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String environmentName, String name, Context context); + + /** + * Delete a Dapr subscription. + * + * Delete a Dapr subscription from a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String environmentName, String name); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/DotNetComponentsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/DotNetComponentsClient.java new file mode 100644 index 0000000000000..f321e882b169b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/DotNetComponentsClient.java @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appcontainers.fluent.models.DotNetComponentInner; + +/** + * An instance of this class provides access to all the operations defined in DotNetComponentsClient. + */ +public interface DotNetComponentsClient { + /** + * Get the .NET Components for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the .NET Components for a managed environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName); + + /** + * Get the .NET Components for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the .NET Components for a managed environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName, Context context); + + /** + * Get a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a .NET Component along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String environmentName, String name, + Context context); + + /** + * Get a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a .NET Component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DotNetComponentInner get(String resourceGroupName, String environmentName, String name); + + /** + * Creates or updates a .NET Component. + * + * Creates or updates a .NET Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of .NET Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DotNetComponentInner> beginCreateOrUpdate(String resourceGroupName, + String environmentName, String name, DotNetComponentInner dotNetComponentEnvelope); + + /** + * Creates or updates a .NET Component. + * + * Creates or updates a .NET Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of .NET Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DotNetComponentInner> beginCreateOrUpdate(String resourceGroupName, + String environmentName, String name, DotNetComponentInner dotNetComponentEnvelope, Context context); + + /** + * Creates or updates a .NET Component. + * + * Creates or updates a .NET Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return .NET Component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DotNetComponentInner createOrUpdate(String resourceGroupName, String environmentName, String name, + DotNetComponentInner dotNetComponentEnvelope); + + /** + * Creates or updates a .NET Component. + * + * Creates or updates a .NET Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return .NET Component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DotNetComponentInner createOrUpdate(String resourceGroupName, String environmentName, String name, + DotNetComponentInner dotNetComponentEnvelope, Context context); + + /** + * Update properties of a .NET Component + * + * Patches a .NET Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of .NET Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DotNetComponentInner> beginUpdate(String resourceGroupName, + String environmentName, String name, DotNetComponentInner dotNetComponentEnvelope); + + /** + * Update properties of a .NET Component + * + * Patches a .NET Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of .NET Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DotNetComponentInner> beginUpdate(String resourceGroupName, + String environmentName, String name, DotNetComponentInner dotNetComponentEnvelope, Context context); + + /** + * Update properties of a .NET Component + * + * Patches a .NET Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return .NET Component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DotNetComponentInner update(String resourceGroupName, String environmentName, String name, + DotNetComponentInner dotNetComponentEnvelope); + + /** + * Update properties of a .NET Component + * + * Patches a .NET Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return .NET Component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DotNetComponentInner update(String resourceGroupName, String environmentName, String name, + DotNetComponentInner dotNetComponentEnvelope, Context context); + + /** + * Delete a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String environmentName, String name); + + /** + * Delete a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String environmentName, String name, + Context context); + + /** + * Delete a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String environmentName, String name); + + /** + * Delete a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String environmentName, String name, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/FunctionsExtensionsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/FunctionsExtensionsClient.java new file mode 100644 index 0000000000000..45732c3aac77e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/FunctionsExtensionsClient.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * An instance of this class provides access to all the operations defined in FunctionsExtensionsClient. + */ +public interface FunctionsExtensionsClient { + /** + * Proxies a Functions host call to the function app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision, the parent resource. + * @param functionAppName Name of the Function App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response invokeFunctionsHostWithResponse(String resourceGroupName, String containerAppName, + String revisionName, String functionAppName, Context context); + + /** + * Proxies a Functions host call to the function app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision, the parent resource. + * @param functionAppName Name of the Function App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + String invokeFunctionsHost(String resourceGroupName, String containerAppName, String revisionName, + String functionAppName); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/JavaComponentsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/JavaComponentsClient.java new file mode 100644 index 0000000000000..160ff1772826e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/JavaComponentsClient.java @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appcontainers.fluent.models.JavaComponentInner; + +/** + * An instance of this class provides access to all the operations defined in JavaComponentsClient. + */ +public interface JavaComponentsClient { + /** + * Get the Java Components for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Java Components for a managed environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName); + + /** + * Get the Java Components for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Java Components for a managed environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName, Context context); + + /** + * Get a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Java Component along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String environmentName, String name, + Context context); + + /** + * Get a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Java Component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JavaComponentInner get(String resourceGroupName, String environmentName, String name); + + /** + * Creates or updates a Java Component. + * + * Creates or updates a Java Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of java Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JavaComponentInner> beginCreateOrUpdate(String resourceGroupName, + String environmentName, String name, JavaComponentInner javaComponentEnvelope); + + /** + * Creates or updates a Java Component. + * + * Creates or updates a Java Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of java Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JavaComponentInner> beginCreateOrUpdate(String resourceGroupName, + String environmentName, String name, JavaComponentInner javaComponentEnvelope, Context context); + + /** + * Creates or updates a Java Component. + * + * Creates or updates a Java Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return java Component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JavaComponentInner createOrUpdate(String resourceGroupName, String environmentName, String name, + JavaComponentInner javaComponentEnvelope); + + /** + * Creates or updates a Java Component. + * + * Creates or updates a Java Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return java Component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JavaComponentInner createOrUpdate(String resourceGroupName, String environmentName, String name, + JavaComponentInner javaComponentEnvelope, Context context); + + /** + * Update properties of a Java Component + * + * Patches a Java Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of java Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JavaComponentInner> beginUpdate(String resourceGroupName, + String environmentName, String name, JavaComponentInner javaComponentEnvelope); + + /** + * Update properties of a Java Component + * + * Patches a Java Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of java Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JavaComponentInner> beginUpdate(String resourceGroupName, + String environmentName, String name, JavaComponentInner javaComponentEnvelope, Context context); + + /** + * Update properties of a Java Component + * + * Patches a Java Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return java Component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JavaComponentInner update(String resourceGroupName, String environmentName, String name, + JavaComponentInner javaComponentEnvelope); + + /** + * Update properties of a Java Component + * + * Patches a Java Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return java Component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JavaComponentInner update(String resourceGroupName, String environmentName, String name, + JavaComponentInner javaComponentEnvelope, Context context); + + /** + * Delete a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String environmentName, String name); + + /** + * Delete a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String environmentName, String name, + Context context); + + /** + * Delete a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String environmentName, String name); + + /** + * Delete a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String environmentName, String name, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/JobsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/JobsClient.java index e7a0a11a78356..4961c7603b1de 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/JobsClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/JobsClient.java @@ -93,11 +93,12 @@ Response getDetectorWithResponse(String resourceGroupName, Str DiagnosticsInner getDetector(String resourceGroupName, String jobName, String detectorName); /** + * Get the properties for a given Container App Job. + * * Get the properties of a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param apiName Proxy API Name for Container App Job. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request @@ -106,14 +107,15 @@ Response getDetectorWithResponse(String resourceGroupName, Str * @return the properties of a Container App Job along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response proxyGetWithResponse(String resourceGroupName, String jobName, String apiName, Context context); + Response proxyGetWithResponse(String resourceGroupName, String jobName, Context context); /** + * Get the properties for a given Container App Job. + * * Get the properties of a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param apiName Proxy API Name for Container App Job. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. @@ -121,7 +123,7 @@ Response getDetectorWithResponse(String resourceGroupName, Str * @return the properties of a Container App Job. */ @ServiceMethod(returns = ReturnType.SINGLE) - JobInner proxyGet(String resourceGroupName, String jobName, String apiName); + JobInner proxyGet(String resourceGroupName, String jobName); /** * Get the Container Apps Jobs in a given subscription. @@ -609,4 +611,112 @@ Response listSecretsWithResponse(String resourceGroup */ @ServiceMethod(returns = ReturnType.SINGLE) JobSecretsCollectionInner listSecrets(String resourceGroupName, String jobName); + + /** + * Resumes a suspended job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobInner> beginResume(String resourceGroupName, String jobName); + + /** + * Resumes a suspended job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobInner> beginResume(String resourceGroupName, String jobName, Context context); + + /** + * Resumes a suspended job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner resume(String resourceGroupName, String jobName); + + /** + * Resumes a suspended job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner resume(String resourceGroupName, String jobName, Context context); + + /** + * Suspends a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobInner> beginSuspend(String resourceGroupName, String jobName); + + /** + * Suspends a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobInner> beginSuspend(String resourceGroupName, String jobName, Context context); + + /** + * Suspends a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner suspend(String resourceGroupName, String jobName); + + /** + * Suspends a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner suspend(String resourceGroupName, String jobName, Context context); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/LogicAppsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/LogicAppsClient.java new file mode 100644 index 0000000000000..1ee60bcd1b3c8 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/LogicAppsClient.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.LogicAppInner; +import com.azure.resourcemanager.appcontainers.fluent.models.WorkflowEnvelopeInner; +import com.azure.resourcemanager.appcontainers.models.LogicAppsProxyMethod; +import com.azure.resourcemanager.appcontainers.models.WorkflowArtifacts; + +/** + * An instance of this class provides access to all the operations defined in LogicAppsClient. + */ +public interface LogicAppsClient { + /** + * Gets a logic app extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + Context context); + + /** + * Gets a logic app extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogicAppInner get(String resourceGroupName, String containerAppName, String logicAppName); + + /** + * Create or update a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param resource Logic app resource properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, LogicAppInner resource, Context context); + + /** + * Create or update a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param resource Logic app resource properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogicAppInner createOrUpdate(String resourceGroupName, String containerAppName, String logicAppName, + LogicAppInner resource); + + /** + * Deletes a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + Context context); + + /** + * Deletes a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String containerAppName, String logicAppName); + + /** + * List the workflows for a logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + String logicAppName); + + /** + * List the workflows for a logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + String logicAppName, Context context); + + /** + * Get workflow information by its name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowName Workflow name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflow information by its name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWorkflowWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, String workflowName, Context context); + + /** + * Get workflow information by its name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowName Workflow name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflow information by its name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkflowEnvelopeInner getWorkflow(String resourceGroupName, String containerAppName, String logicAppName, + String workflowName); + + /** + * Creates or updates the artifacts for the logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowArtifacts Application settings and files of the workflow. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deployWorkflowArtifactsWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, WorkflowArtifacts workflowArtifacts, Context context); + + /** + * Creates or updates the artifacts for the logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deployWorkflowArtifacts(String resourceGroupName, String containerAppName, String logicAppName); + + /** + * Gets logic app's connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWorkflowsConnectionsWithResponse(String resourceGroupName, + String containerAppName, String logicAppName, Context context); + + /** + * Gets logic app's connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkflowEnvelopeInner listWorkflowsConnections(String resourceGroupName, String containerAppName, + String logicAppName); + + /** + * Proxies a the API call to the logic app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the LogicApp App, the extension resource. + * @param xMsLogicAppsProxyPath The proxy path for the API call. + * @param xMsLogicAppsProxyMethod The proxy method for the API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response invokeWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + String xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod, Context context); + + /** + * Proxies a the API call to the logic app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the LogicApp App, the extension resource. + * @param xMsLogicAppsProxyPath The proxy path for the API call. + * @param xMsLogicAppsProxyMethod The proxy method for the API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Object invoke(String resourceGroupName, String containerAppName, String logicAppName, String xMsLogicAppsProxyPath, + LogicAppsProxyMethod xMsLogicAppsProxyMethod); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentPrivateEndpointConnectionsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentPrivateEndpointConnectionsClient.java new file mode 100644 index 0000000000000..37a4ed33fe035 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentPrivateEndpointConnectionsClient.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateEndpointConnectionInner; + +/** + * An instance of this class provides access to all the operations defined in + * ManagedEnvironmentPrivateEndpointConnectionsClient. + */ +public interface ManagedEnvironmentPrivateEndpointConnectionsClient { + /** + * List private endpoint connections for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName); + + /** + * List private endpoint connections for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName, + Context context); + + /** + * Get a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection for a given managed environment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, Context context); + + /** + * Get a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection for a given managed environment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get(String resourceGroupName, String environmentName, + String privateEndpointConnectionName); + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String environmentName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnectionEnvelope); + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String environmentName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, Context context); + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope); + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, + Context context); + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String environmentName, + String privateEndpointConnectionName); + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, Context context); + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String environmentName, String privateEndpointConnectionName); + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String environmentName, String privateEndpointConnectionName, + Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentPrivateLinkResourcesClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentPrivateLinkResourcesClient.java new file mode 100644 index 0000000000000..7235c21740e7c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentPrivateLinkResourcesClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateLinkResourceInner; + +/** + * An instance of this class provides access to all the operations defined in + * ManagedEnvironmentPrivateLinkResourcesClient. + */ +public interface ManagedEnvironmentPrivateLinkResourcesClient { + /** + * List private link resources for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName); + + /** + * List private link resources for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AppResiliencyInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AppResiliencyInner.java new file mode 100644 index 0000000000000..b214f81d1c979 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AppResiliencyInner.java @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.CircuitBreakerPolicy; +import com.azure.resourcemanager.appcontainers.models.HttpConnectionPool; +import com.azure.resourcemanager.appcontainers.models.HttpRetryPolicy; +import com.azure.resourcemanager.appcontainers.models.TcpConnectionPool; +import com.azure.resourcemanager.appcontainers.models.TcpRetryPolicy; +import com.azure.resourcemanager.appcontainers.models.TimeoutPolicy; +import java.io.IOException; + +/** + * Configuration to setup App Resiliency. + */ +@Fluent +public final class AppResiliencyInner extends ProxyResource { + /* + * App Resiliency resource specific properties + */ + private AppResiliencyProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AppResiliencyInner class. + */ + public AppResiliencyInner() { + } + + /** + * Get the innerProperties property: App Resiliency resource specific properties. + * + * @return the innerProperties value. + */ + private AppResiliencyProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the timeoutPolicy property: Policy to set request timeouts. + * + * @return the timeoutPolicy value. + */ + public TimeoutPolicy timeoutPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().timeoutPolicy(); + } + + /** + * Set the timeoutPolicy property: Policy to set request timeouts. + * + * @param timeoutPolicy the timeoutPolicy value to set. + * @return the AppResiliencyInner object itself. + */ + public AppResiliencyInner withTimeoutPolicy(TimeoutPolicy timeoutPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new AppResiliencyProperties(); + } + this.innerProperties().withTimeoutPolicy(timeoutPolicy); + return this; + } + + /** + * Get the httpRetryPolicy property: Policy that defines http request retry conditions. + * + * @return the httpRetryPolicy value. + */ + public HttpRetryPolicy httpRetryPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().httpRetryPolicy(); + } + + /** + * Set the httpRetryPolicy property: Policy that defines http request retry conditions. + * + * @param httpRetryPolicy the httpRetryPolicy value to set. + * @return the AppResiliencyInner object itself. + */ + public AppResiliencyInner withHttpRetryPolicy(HttpRetryPolicy httpRetryPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new AppResiliencyProperties(); + } + this.innerProperties().withHttpRetryPolicy(httpRetryPolicy); + return this; + } + + /** + * Get the tcpRetryPolicy property: Policy that defines tcp request retry conditions. + * + * @return the tcpRetryPolicy value. + */ + public TcpRetryPolicy tcpRetryPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().tcpRetryPolicy(); + } + + /** + * Set the tcpRetryPolicy property: Policy that defines tcp request retry conditions. + * + * @param tcpRetryPolicy the tcpRetryPolicy value to set. + * @return the AppResiliencyInner object itself. + */ + public AppResiliencyInner withTcpRetryPolicy(TcpRetryPolicy tcpRetryPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new AppResiliencyProperties(); + } + this.innerProperties().withTcpRetryPolicy(tcpRetryPolicy); + return this; + } + + /** + * Get the circuitBreakerPolicy property: Policy that defines circuit breaker conditions. + * + * @return the circuitBreakerPolicy value. + */ + public CircuitBreakerPolicy circuitBreakerPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().circuitBreakerPolicy(); + } + + /** + * Set the circuitBreakerPolicy property: Policy that defines circuit breaker conditions. + * + * @param circuitBreakerPolicy the circuitBreakerPolicy value to set. + * @return the AppResiliencyInner object itself. + */ + public AppResiliencyInner withCircuitBreakerPolicy(CircuitBreakerPolicy circuitBreakerPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new AppResiliencyProperties(); + } + this.innerProperties().withCircuitBreakerPolicy(circuitBreakerPolicy); + return this; + } + + /** + * Get the httpConnectionPool property: Defines parameters for http connection pooling. + * + * @return the httpConnectionPool value. + */ + public HttpConnectionPool httpConnectionPool() { + return this.innerProperties() == null ? null : this.innerProperties().httpConnectionPool(); + } + + /** + * Set the httpConnectionPool property: Defines parameters for http connection pooling. + * + * @param httpConnectionPool the httpConnectionPool value to set. + * @return the AppResiliencyInner object itself. + */ + public AppResiliencyInner withHttpConnectionPool(HttpConnectionPool httpConnectionPool) { + if (this.innerProperties() == null) { + this.innerProperties = new AppResiliencyProperties(); + } + this.innerProperties().withHttpConnectionPool(httpConnectionPool); + return this; + } + + /** + * Get the tcpConnectionPool property: Defines parameters for tcp connection pooling. + * + * @return the tcpConnectionPool value. + */ + public TcpConnectionPool tcpConnectionPool() { + return this.innerProperties() == null ? null : this.innerProperties().tcpConnectionPool(); + } + + /** + * Set the tcpConnectionPool property: Defines parameters for tcp connection pooling. + * + * @param tcpConnectionPool the tcpConnectionPool value to set. + * @return the AppResiliencyInner object itself. + */ + public AppResiliencyInner withTcpConnectionPool(TcpConnectionPool tcpConnectionPool) { + if (this.innerProperties() == null) { + this.innerProperties = new AppResiliencyProperties(); + } + this.innerProperties().withTcpConnectionPool(tcpConnectionPool); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppResiliencyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppResiliencyInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AppResiliencyInner. + */ + public static AppResiliencyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppResiliencyInner deserializedAppResiliencyInner = new AppResiliencyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAppResiliencyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAppResiliencyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAppResiliencyInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAppResiliencyInner.innerProperties = AppResiliencyProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAppResiliencyInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAppResiliencyInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AppResiliencyProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AppResiliencyProperties.java new file mode 100644 index 0000000000000..83da18920e658 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AppResiliencyProperties.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.CircuitBreakerPolicy; +import com.azure.resourcemanager.appcontainers.models.HttpConnectionPool; +import com.azure.resourcemanager.appcontainers.models.HttpRetryPolicy; +import com.azure.resourcemanager.appcontainers.models.TcpConnectionPool; +import com.azure.resourcemanager.appcontainers.models.TcpRetryPolicy; +import com.azure.resourcemanager.appcontainers.models.TimeoutPolicy; +import java.io.IOException; + +/** + * App Resiliency resource specific properties. + */ +@Fluent +public final class AppResiliencyProperties implements JsonSerializable { + /* + * Policy to set request timeouts + */ + private TimeoutPolicy timeoutPolicy; + + /* + * Policy that defines http request retry conditions + */ + private HttpRetryPolicy httpRetryPolicy; + + /* + * Policy that defines tcp request retry conditions + */ + private TcpRetryPolicy tcpRetryPolicy; + + /* + * Policy that defines circuit breaker conditions + */ + private CircuitBreakerPolicy circuitBreakerPolicy; + + /* + * Defines parameters for http connection pooling + */ + private HttpConnectionPool httpConnectionPool; + + /* + * Defines parameters for tcp connection pooling + */ + private TcpConnectionPool tcpConnectionPool; + + /** + * Creates an instance of AppResiliencyProperties class. + */ + public AppResiliencyProperties() { + } + + /** + * Get the timeoutPolicy property: Policy to set request timeouts. + * + * @return the timeoutPolicy value. + */ + public TimeoutPolicy timeoutPolicy() { + return this.timeoutPolicy; + } + + /** + * Set the timeoutPolicy property: Policy to set request timeouts. + * + * @param timeoutPolicy the timeoutPolicy value to set. + * @return the AppResiliencyProperties object itself. + */ + public AppResiliencyProperties withTimeoutPolicy(TimeoutPolicy timeoutPolicy) { + this.timeoutPolicy = timeoutPolicy; + return this; + } + + /** + * Get the httpRetryPolicy property: Policy that defines http request retry conditions. + * + * @return the httpRetryPolicy value. + */ + public HttpRetryPolicy httpRetryPolicy() { + return this.httpRetryPolicy; + } + + /** + * Set the httpRetryPolicy property: Policy that defines http request retry conditions. + * + * @param httpRetryPolicy the httpRetryPolicy value to set. + * @return the AppResiliencyProperties object itself. + */ + public AppResiliencyProperties withHttpRetryPolicy(HttpRetryPolicy httpRetryPolicy) { + this.httpRetryPolicy = httpRetryPolicy; + return this; + } + + /** + * Get the tcpRetryPolicy property: Policy that defines tcp request retry conditions. + * + * @return the tcpRetryPolicy value. + */ + public TcpRetryPolicy tcpRetryPolicy() { + return this.tcpRetryPolicy; + } + + /** + * Set the tcpRetryPolicy property: Policy that defines tcp request retry conditions. + * + * @param tcpRetryPolicy the tcpRetryPolicy value to set. + * @return the AppResiliencyProperties object itself. + */ + public AppResiliencyProperties withTcpRetryPolicy(TcpRetryPolicy tcpRetryPolicy) { + this.tcpRetryPolicy = tcpRetryPolicy; + return this; + } + + /** + * Get the circuitBreakerPolicy property: Policy that defines circuit breaker conditions. + * + * @return the circuitBreakerPolicy value. + */ + public CircuitBreakerPolicy circuitBreakerPolicy() { + return this.circuitBreakerPolicy; + } + + /** + * Set the circuitBreakerPolicy property: Policy that defines circuit breaker conditions. + * + * @param circuitBreakerPolicy the circuitBreakerPolicy value to set. + * @return the AppResiliencyProperties object itself. + */ + public AppResiliencyProperties withCircuitBreakerPolicy(CircuitBreakerPolicy circuitBreakerPolicy) { + this.circuitBreakerPolicy = circuitBreakerPolicy; + return this; + } + + /** + * Get the httpConnectionPool property: Defines parameters for http connection pooling. + * + * @return the httpConnectionPool value. + */ + public HttpConnectionPool httpConnectionPool() { + return this.httpConnectionPool; + } + + /** + * Set the httpConnectionPool property: Defines parameters for http connection pooling. + * + * @param httpConnectionPool the httpConnectionPool value to set. + * @return the AppResiliencyProperties object itself. + */ + public AppResiliencyProperties withHttpConnectionPool(HttpConnectionPool httpConnectionPool) { + this.httpConnectionPool = httpConnectionPool; + return this; + } + + /** + * Get the tcpConnectionPool property: Defines parameters for tcp connection pooling. + * + * @return the tcpConnectionPool value. + */ + public TcpConnectionPool tcpConnectionPool() { + return this.tcpConnectionPool; + } + + /** + * Set the tcpConnectionPool property: Defines parameters for tcp connection pooling. + * + * @param tcpConnectionPool the tcpConnectionPool value to set. + * @return the AppResiliencyProperties object itself. + */ + public AppResiliencyProperties withTcpConnectionPool(TcpConnectionPool tcpConnectionPool) { + this.tcpConnectionPool = tcpConnectionPool; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (timeoutPolicy() != null) { + timeoutPolicy().validate(); + } + if (httpRetryPolicy() != null) { + httpRetryPolicy().validate(); + } + if (tcpRetryPolicy() != null) { + tcpRetryPolicy().validate(); + } + if (circuitBreakerPolicy() != null) { + circuitBreakerPolicy().validate(); + } + if (httpConnectionPool() != null) { + httpConnectionPool().validate(); + } + if (tcpConnectionPool() != null) { + tcpConnectionPool().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("timeoutPolicy", this.timeoutPolicy); + jsonWriter.writeJsonField("httpRetryPolicy", this.httpRetryPolicy); + jsonWriter.writeJsonField("tcpRetryPolicy", this.tcpRetryPolicy); + jsonWriter.writeJsonField("circuitBreakerPolicy", this.circuitBreakerPolicy); + jsonWriter.writeJsonField("httpConnectionPool", this.httpConnectionPool); + jsonWriter.writeJsonField("tcpConnectionPool", this.tcpConnectionPool); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppResiliencyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppResiliencyProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AppResiliencyProperties. + */ + public static AppResiliencyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppResiliencyProperties deserializedAppResiliencyProperties = new AppResiliencyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("timeoutPolicy".equals(fieldName)) { + deserializedAppResiliencyProperties.timeoutPolicy = TimeoutPolicy.fromJson(reader); + } else if ("httpRetryPolicy".equals(fieldName)) { + deserializedAppResiliencyProperties.httpRetryPolicy = HttpRetryPolicy.fromJson(reader); + } else if ("tcpRetryPolicy".equals(fieldName)) { + deserializedAppResiliencyProperties.tcpRetryPolicy = TcpRetryPolicy.fromJson(reader); + } else if ("circuitBreakerPolicy".equals(fieldName)) { + deserializedAppResiliencyProperties.circuitBreakerPolicy = CircuitBreakerPolicy.fromJson(reader); + } else if ("httpConnectionPool".equals(fieldName)) { + deserializedAppResiliencyProperties.httpConnectionPool = HttpConnectionPool.fromJson(reader); + } else if ("tcpConnectionPool".equals(fieldName)) { + deserializedAppResiliencyProperties.tcpConnectionPool = TcpConnectionPool.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAppResiliencyProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AuthConfigInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AuthConfigInner.java index b16686e6a0ba9..5272539ad16f1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AuthConfigInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AuthConfigInner.java @@ -34,9 +34,9 @@ public final class AuthConfigInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -44,9 +44,9 @@ public final class AuthConfigInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of AuthConfigInner class. @@ -73,13 +73,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -93,13 +93,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AvailableWorkloadProfileInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AvailableWorkloadProfileInner.java index f9310eeee8420..4b7558ab82a25 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AvailableWorkloadProfileInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AvailableWorkloadProfileInner.java @@ -34,9 +34,9 @@ public final class AvailableWorkloadProfileInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -44,9 +44,9 @@ public final class AvailableWorkloadProfileInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of AvailableWorkloadProfileInner class. @@ -104,13 +104,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -124,13 +124,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuildProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuildProperties.java new file mode 100644 index 0000000000000..64c39b9e155d5 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuildProperties.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.BuildConfiguration; +import com.azure.resourcemanager.appcontainers.models.BuildProvisioningState; +import com.azure.resourcemanager.appcontainers.models.BuildStatus; +import com.azure.resourcemanager.appcontainers.models.ContainerRegistryWithCustomImage; +import java.io.IOException; + +/** + * The build properties. + */ +@Fluent +public final class BuildProperties implements JsonSerializable { + /* + * Build provisioning state. + */ + private BuildProvisioningState provisioningState; + + /* + * Status of the build once it has been provisioned. + */ + private BuildStatus buildStatus; + + /* + * Container registry that the final image will be uploaded to. + */ + private ContainerRegistryWithCustomImage destinationContainerRegistry; + + /* + * Configuration of the build. + */ + private BuildConfiguration configuration; + + /* + * Endpoint to which the source code should be uploaded. + */ + private String uploadEndpoint; + + /* + * Endpoint from which the build logs can be streamed. + */ + private String logStreamEndpoint; + + /* + * Endpoint to use to retrieve an authentication token for log streaming and uploading source code. + */ + private String tokenEndpoint; + + /** + * Creates an instance of BuildProperties class. + */ + public BuildProperties() { + } + + /** + * Get the provisioningState property: Build provisioning state. + * + * @return the provisioningState value. + */ + public BuildProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the buildStatus property: Status of the build once it has been provisioned. + * + * @return the buildStatus value. + */ + public BuildStatus buildStatus() { + return this.buildStatus; + } + + /** + * Get the destinationContainerRegistry property: Container registry that the final image will be uploaded to. + * + * @return the destinationContainerRegistry value. + */ + public ContainerRegistryWithCustomImage destinationContainerRegistry() { + return this.destinationContainerRegistry; + } + + /** + * Set the destinationContainerRegistry property: Container registry that the final image will be uploaded to. + * + * @param destinationContainerRegistry the destinationContainerRegistry value to set. + * @return the BuildProperties object itself. + */ + public BuildProperties + withDestinationContainerRegistry(ContainerRegistryWithCustomImage destinationContainerRegistry) { + this.destinationContainerRegistry = destinationContainerRegistry; + return this; + } + + /** + * Get the configuration property: Configuration of the build. + * + * @return the configuration value. + */ + public BuildConfiguration configuration() { + return this.configuration; + } + + /** + * Set the configuration property: Configuration of the build. + * + * @param configuration the configuration value to set. + * @return the BuildProperties object itself. + */ + public BuildProperties withConfiguration(BuildConfiguration configuration) { + this.configuration = configuration; + return this; + } + + /** + * Get the uploadEndpoint property: Endpoint to which the source code should be uploaded. + * + * @return the uploadEndpoint value. + */ + public String uploadEndpoint() { + return this.uploadEndpoint; + } + + /** + * Get the logStreamEndpoint property: Endpoint from which the build logs can be streamed. + * + * @return the logStreamEndpoint value. + */ + public String logStreamEndpoint() { + return this.logStreamEndpoint; + } + + /** + * Get the tokenEndpoint property: Endpoint to use to retrieve an authentication token for log streaming and + * uploading source code. + * + * @return the tokenEndpoint value. + */ + public String tokenEndpoint() { + return this.tokenEndpoint; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (destinationContainerRegistry() != null) { + destinationContainerRegistry().validate(); + } + if (configuration() != null) { + configuration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("destinationContainerRegistry", this.destinationContainerRegistry); + jsonWriter.writeJsonField("configuration", this.configuration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BuildProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuildProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BuildProperties. + */ + public static BuildProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuildProperties deserializedBuildProperties = new BuildProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedBuildProperties.provisioningState + = BuildProvisioningState.fromString(reader.getString()); + } else if ("buildStatus".equals(fieldName)) { + deserializedBuildProperties.buildStatus = BuildStatus.fromString(reader.getString()); + } else if ("destinationContainerRegistry".equals(fieldName)) { + deserializedBuildProperties.destinationContainerRegistry + = ContainerRegistryWithCustomImage.fromJson(reader); + } else if ("configuration".equals(fieldName)) { + deserializedBuildProperties.configuration = BuildConfiguration.fromJson(reader); + } else if ("uploadEndpoint".equals(fieldName)) { + deserializedBuildProperties.uploadEndpoint = reader.getString(); + } else if ("logStreamEndpoint".equals(fieldName)) { + deserializedBuildProperties.logStreamEndpoint = reader.getString(); + } else if ("tokenEndpoint".equals(fieldName)) { + deserializedBuildProperties.tokenEndpoint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBuildProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuildResourceInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuildResourceInner.java new file mode 100644 index 0000000000000..6bbc11f9856b7 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuildResourceInner.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.BuildConfiguration; +import com.azure.resourcemanager.appcontainers.models.BuildProvisioningState; +import com.azure.resourcemanager.appcontainers.models.BuildStatus; +import com.azure.resourcemanager.appcontainers.models.ContainerRegistryWithCustomImage; +import java.io.IOException; + +/** + * Information pertaining to an individual build. + */ +@Fluent +public final class BuildResourceInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private BuildProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of BuildResourceInner class. + */ + public BuildResourceInner() { + } + + /** + * Get the innerProperties property: The resource-specific properties for this resource. + * + * @return the innerProperties value. + */ + private BuildProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the provisioningState property: Build provisioning state. + * + * @return the provisioningState value. + */ + public BuildProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the buildStatus property: Status of the build once it has been provisioned. + * + * @return the buildStatus value. + */ + public BuildStatus buildStatus() { + return this.innerProperties() == null ? null : this.innerProperties().buildStatus(); + } + + /** + * Get the destinationContainerRegistry property: Container registry that the final image will be uploaded to. + * + * @return the destinationContainerRegistry value. + */ + public ContainerRegistryWithCustomImage destinationContainerRegistry() { + return this.innerProperties() == null ? null : this.innerProperties().destinationContainerRegistry(); + } + + /** + * Set the destinationContainerRegistry property: Container registry that the final image will be uploaded to. + * + * @param destinationContainerRegistry the destinationContainerRegistry value to set. + * @return the BuildResourceInner object itself. + */ + public BuildResourceInner + withDestinationContainerRegistry(ContainerRegistryWithCustomImage destinationContainerRegistry) { + if (this.innerProperties() == null) { + this.innerProperties = new BuildProperties(); + } + this.innerProperties().withDestinationContainerRegistry(destinationContainerRegistry); + return this; + } + + /** + * Get the configuration property: Configuration of the build. + * + * @return the configuration value. + */ + public BuildConfiguration configuration() { + return this.innerProperties() == null ? null : this.innerProperties().configuration(); + } + + /** + * Set the configuration property: Configuration of the build. + * + * @param configuration the configuration value to set. + * @return the BuildResourceInner object itself. + */ + public BuildResourceInner withConfiguration(BuildConfiguration configuration) { + if (this.innerProperties() == null) { + this.innerProperties = new BuildProperties(); + } + this.innerProperties().withConfiguration(configuration); + return this; + } + + /** + * Get the uploadEndpoint property: Endpoint to which the source code should be uploaded. + * + * @return the uploadEndpoint value. + */ + public String uploadEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().uploadEndpoint(); + } + + /** + * Get the logStreamEndpoint property: Endpoint from which the build logs can be streamed. + * + * @return the logStreamEndpoint value. + */ + public String logStreamEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().logStreamEndpoint(); + } + + /** + * Get the tokenEndpoint property: Endpoint to use to retrieve an authentication token for log streaming and + * uploading source code. + * + * @return the tokenEndpoint value. + */ + public String tokenEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().tokenEndpoint(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BuildResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuildResourceInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BuildResourceInner. + */ + public static BuildResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuildResourceInner deserializedBuildResourceInner = new BuildResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBuildResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBuildResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBuildResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedBuildResourceInner.innerProperties = BuildProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedBuildResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBuildResourceInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuildTokenInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuildTokenInner.java new file mode 100644 index 0000000000000..d3488fefeb984 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuildTokenInner.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Build Auth Token. + */ +@Immutable +public final class BuildTokenInner implements JsonSerializable { + /* + * Authentication token. + */ + private String token; + + /* + * Token expiration date. + */ + private OffsetDateTime expires; + + /** + * Creates an instance of BuildTokenInner class. + */ + public BuildTokenInner() { + } + + /** + * Get the token property: Authentication token. + * + * @return the token value. + */ + public String token() { + return this.token; + } + + /** + * Get the expires property: Token expiration date. + * + * @return the expires value. + */ + public OffsetDateTime expires() { + return this.expires; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BuildTokenInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuildTokenInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BuildTokenInner. + */ + public static BuildTokenInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuildTokenInner deserializedBuildTokenInner = new BuildTokenInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("token".equals(fieldName)) { + deserializedBuildTokenInner.token = reader.getString(); + } else if ("expires".equals(fieldName)) { + deserializedBuildTokenInner.expires = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedBuildTokenInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuilderProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuilderProperties.java new file mode 100644 index 0000000000000..b1e954cd7a76a --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuilderProperties.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.BuilderProvisioningState; +import com.azure.resourcemanager.appcontainers.models.ContainerRegistry; +import java.io.IOException; +import java.util.List; + +/** + * The builder properties. + */ +@Fluent +public final class BuilderProperties implements JsonSerializable { + /* + * Provisioning state of a builder resource. + */ + private BuilderProvisioningState provisioningState; + + /* + * Resource ID of the container apps environment that the builder is associated with. + */ + private String environmentId; + + /* + * List of mappings of container registries and the managed identity used to connect to it. + */ + private List containerRegistries; + + /** + * Creates an instance of BuilderProperties class. + */ + public BuilderProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of a builder resource. + * + * @return the provisioningState value. + */ + public BuilderProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the environmentId property: Resource ID of the container apps environment that the builder is associated + * with. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set the environmentId property: Resource ID of the container apps environment that the builder is associated + * with. + * + * @param environmentId the environmentId value to set. + * @return the BuilderProperties object itself. + */ + public BuilderProperties withEnvironmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Get the containerRegistries property: List of mappings of container registries and the managed identity used to + * connect to it. + * + * @return the containerRegistries value. + */ + public List containerRegistries() { + return this.containerRegistries; + } + + /** + * Set the containerRegistries property: List of mappings of container registries and the managed identity used to + * connect to it. + * + * @param containerRegistries the containerRegistries value to set. + * @return the BuilderProperties object itself. + */ + public BuilderProperties withContainerRegistries(List containerRegistries) { + this.containerRegistries = containerRegistries; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (environmentId() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property environmentId in model BuilderProperties")); + } + if (containerRegistries() != null) { + containerRegistries().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BuilderProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("environmentId", this.environmentId); + jsonWriter.writeArrayField("containerRegistries", this.containerRegistries, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BuilderProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuilderProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BuilderProperties. + */ + public static BuilderProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuilderProperties deserializedBuilderProperties = new BuilderProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("environmentId".equals(fieldName)) { + deserializedBuilderProperties.environmentId = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedBuilderProperties.provisioningState + = BuilderProvisioningState.fromString(reader.getString()); + } else if ("containerRegistries".equals(fieldName)) { + List containerRegistries + = reader.readArray(reader1 -> ContainerRegistry.fromJson(reader1)); + deserializedBuilderProperties.containerRegistries = containerRegistries; + } else { + reader.skipChildren(); + } + } + + return deserializedBuilderProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuilderResourceInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuilderResourceInner.java new file mode 100644 index 0000000000000..0ec2b3c5853e2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuilderResourceInner.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.BuilderProvisioningState; +import com.azure.resourcemanager.appcontainers.models.ContainerRegistry; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Information about the SourceToCloud builder resource. + */ +@Fluent +public final class BuilderResourceInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private BuilderProperties innerProperties; + + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of BuilderResourceInner class. + */ + public BuilderResourceInner() { + } + + /** + * Get the innerProperties property: The resource-specific properties for this resource. + * + * @return the innerProperties value. + */ + private BuilderProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the BuilderResourceInner object itself. + */ + public BuilderResourceInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public BuilderResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public BuilderResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of a builder resource. + * + * @return the provisioningState value. + */ + public BuilderProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the environmentId property: Resource ID of the container apps environment that the builder is associated + * with. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.innerProperties() == null ? null : this.innerProperties().environmentId(); + } + + /** + * Set the environmentId property: Resource ID of the container apps environment that the builder is associated + * with. + * + * @param environmentId the environmentId value to set. + * @return the BuilderResourceInner object itself. + */ + public BuilderResourceInner withEnvironmentId(String environmentId) { + if (this.innerProperties() == null) { + this.innerProperties = new BuilderProperties(); + } + this.innerProperties().withEnvironmentId(environmentId); + return this; + } + + /** + * Get the containerRegistries property: List of mappings of container registries and the managed identity used to + * connect to it. + * + * @return the containerRegistries value. + */ + public List containerRegistries() { + return this.innerProperties() == null ? null : this.innerProperties().containerRegistries(); + } + + /** + * Set the containerRegistries property: List of mappings of container registries and the managed identity used to + * connect to it. + * + * @param containerRegistries the containerRegistries value to set. + * @return the BuilderResourceInner object itself. + */ + public BuilderResourceInner withContainerRegistries(List containerRegistries) { + if (this.innerProperties() == null) { + this.innerProperties = new BuilderProperties(); + } + this.innerProperties().withContainerRegistries(containerRegistries); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BuilderResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuilderResourceInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BuilderResourceInner. + */ + public static BuilderResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuilderResourceInner deserializedBuilderResourceInner = new BuilderResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBuilderResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBuilderResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBuilderResourceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedBuilderResourceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedBuilderResourceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedBuilderResourceInner.innerProperties = BuilderProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedBuilderResourceInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedBuilderResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBuilderResourceInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuilderResourceUpdateProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuilderResourceUpdateProperties.java new file mode 100644 index 0000000000000..6e9a2c27bee20 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BuilderResourceUpdateProperties.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The updatable properties of the BuilderResource. + */ +@Fluent +public final class BuilderResourceUpdateProperties implements JsonSerializable { + /* + * Resource ID of the container apps environment that the builder is associated with. + */ + private String environmentId; + + /** + * Creates an instance of BuilderResourceUpdateProperties class. + */ + public BuilderResourceUpdateProperties() { + } + + /** + * Get the environmentId property: Resource ID of the container apps environment that the builder is associated + * with. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set the environmentId property: Resource ID of the container apps environment that the builder is associated + * with. + * + * @param environmentId the environmentId value to set. + * @return the BuilderResourceUpdateProperties object itself. + */ + public BuilderResourceUpdateProperties withEnvironmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("environmentId", this.environmentId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BuilderResourceUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuilderResourceUpdateProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BuilderResourceUpdateProperties. + */ + public static BuilderResourceUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuilderResourceUpdateProperties deserializedBuilderResourceUpdateProperties + = new BuilderResourceUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("environmentId".equals(fieldName)) { + deserializedBuilderResourceUpdateProperties.environmentId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBuilderResourceUpdateProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CertificateInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CertificateInner.java index 01cf61b4834dd..7d3c6768dd296 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CertificateInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CertificateInner.java @@ -30,9 +30,9 @@ public final class CertificateInner extends Resource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -40,9 +40,9 @@ public final class CertificateInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of CertificateInner class. @@ -80,13 +80,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -100,13 +100,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentInner.java index bc953e917c097..df547fc713731 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentInner.java @@ -37,9 +37,9 @@ public final class ConnectedEnvironmentInner extends Resource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -47,9 +47,9 @@ public final class ConnectedEnvironmentInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of ConnectedEnvironmentInner class. @@ -96,13 +96,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -116,13 +116,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentStorageInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentStorageInner.java index f943b169576b2..b65ffd6911471 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentStorageInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentStorageInner.java @@ -29,9 +29,9 @@ public final class ConnectedEnvironmentStorageInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -39,9 +39,9 @@ public final class ConnectedEnvironmentStorageInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of ConnectedEnvironmentStorageInner class. @@ -79,13 +79,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -99,13 +99,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppAuthTokenInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppAuthTokenInner.java index 8a7c302a3104c..41f852b593007 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppAuthTokenInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppAuthTokenInner.java @@ -30,9 +30,9 @@ public final class ContainerAppAuthTokenInner extends Resource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -40,9 +40,9 @@ public final class ContainerAppAuthTokenInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of ContainerAppAuthTokenInner class. @@ -69,13 +69,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -89,13 +89,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppInner.java index 83d5d2bd3583c..7f2042e11bdf9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppInner.java @@ -11,8 +11,10 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.appcontainers.models.Configuration; +import com.azure.resourcemanager.appcontainers.models.ContainerAppPropertiesPatchingConfiguration; import com.azure.resourcemanager.appcontainers.models.ContainerAppProvisioningState; import com.azure.resourcemanager.appcontainers.models.ExtendedLocation; +import com.azure.resourcemanager.appcontainers.models.Kind; import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; import com.azure.resourcemanager.appcontainers.models.Template; import java.io.IOException; @@ -42,6 +44,12 @@ public final class ContainerAppInner extends Resource { */ private String managedBy; + /* + * Metadata used to render different experiences for resources of the same type; e.g. WorkflowApp is a kind of + * Microsoft.App/ContainerApps type. If supported, the resource provider must validate and persist this value. + */ + private Kind kind; + /* * ContainerApp resource specific properties */ @@ -53,9 +61,9 @@ public final class ContainerAppInner extends Resource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -63,9 +71,9 @@ public final class ContainerAppInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of ContainerAppInner class. @@ -139,6 +147,30 @@ public ContainerAppInner withManagedBy(String managedBy) { return this; } + /** + * Get the kind property: Metadata used to render different experiences for resources of the same type; e.g. + * WorkflowApp is a kind of Microsoft.App/ContainerApps type. If supported, the resource provider must validate and + * persist this value. + * + * @return the kind value. + */ + public Kind kind() { + return this.kind; + } + + /** + * Set the kind property: Metadata used to render different experiences for resources of the same type; e.g. + * WorkflowApp is a kind of Microsoft.App/ContainerApps type. If supported, the resource provider must validate and + * persist this value. + * + * @param kind the kind value to set. + * @return the ContainerAppInner object itself. + */ + public ContainerAppInner withKind(Kind kind) { + this.kind = kind; + return this; + } + /** * Get the innerProperties property: ContainerApp resource specific properties. * @@ -158,13 +190,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -178,13 +210,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** @@ -214,6 +246,15 @@ public ContainerAppProvisioningState provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } + /** + * Get the deploymentErrors property: Any errors that occurred during deployment. + * + * @return the deploymentErrors value. + */ + public String deploymentErrors() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentErrors(); + } + /** * Get the managedEnvironmentId property: Deprecated. Resource ID of the Container App's environment. * @@ -283,6 +324,30 @@ public ContainerAppInner withWorkloadProfileName(String workloadProfileName) { return this; } + /** + * Get the patchingConfiguration property: Container App auto patch configuration. + * + * @return the patchingConfiguration value. + */ + public ContainerAppPropertiesPatchingConfiguration patchingConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().patchingConfiguration(); + } + + /** + * Set the patchingConfiguration property: Container App auto patch configuration. + * + * @param patchingConfiguration the patchingConfiguration value to set. + * @return the ContainerAppInner object itself. + */ + public ContainerAppInner + withPatchingConfiguration(ContainerAppPropertiesPatchingConfiguration patchingConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerAppProperties(); + } + this.innerProperties().withPatchingConfiguration(patchingConfiguration); + return this; + } + /** * Get the latestRevisionName property: Name of the latest revision of the Container App. * @@ -411,6 +476,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); jsonWriter.writeJsonField("identity", this.identity); jsonWriter.writeStringField("managedBy", this.managedBy); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -448,6 +514,8 @@ public static ContainerAppInner fromJson(JsonReader jsonReader) throws IOExcepti deserializedContainerAppInner.identity = ManagedServiceIdentity.fromJson(reader); } else if ("managedBy".equals(fieldName)) { deserializedContainerAppInner.managedBy = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedContainerAppInner.kind = Kind.fromString(reader.getString()); } else if ("properties".equals(fieldName)) { deserializedContainerAppInner.innerProperties = ContainerAppProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppProperties.java index d48fb667c8b24..1cf2f5032fc69 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppProperties.java @@ -10,6 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.appcontainers.models.Configuration; +import com.azure.resourcemanager.appcontainers.models.ContainerAppPropertiesPatchingConfiguration; import com.azure.resourcemanager.appcontainers.models.ContainerAppProvisioningState; import com.azure.resourcemanager.appcontainers.models.Template; import java.io.IOException; @@ -25,6 +26,11 @@ public final class ContainerAppProperties implements JsonSerializable { + /* + * Build provisioning state. + */ + private BuildProvisioningState provisioningState; + + /* + * Status of the build once it has been provisioned. + */ + private BuildStatus buildStatus; + + /* + * Container registry that the final image will be uploaded to. + */ + private ContainerRegistryWithCustomImage destinationContainerRegistry; + + /* + * Configuration of the build. + */ + private ContainerAppsBuildConfiguration configuration; + + /* + * Endpoint from which the build logs can be streamed. + */ + private String logStreamEndpoint; + + /** + * Creates an instance of ContainerAppsBuildProperties class. + */ + public ContainerAppsBuildProperties() { + } + + /** + * Get the provisioningState property: Build provisioning state. + * + * @return the provisioningState value. + */ + public BuildProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the buildStatus property: Status of the build once it has been provisioned. + * + * @return the buildStatus value. + */ + public BuildStatus buildStatus() { + return this.buildStatus; + } + + /** + * Get the destinationContainerRegistry property: Container registry that the final image will be uploaded to. + * + * @return the destinationContainerRegistry value. + */ + public ContainerRegistryWithCustomImage destinationContainerRegistry() { + return this.destinationContainerRegistry; + } + + /** + * Get the configuration property: Configuration of the build. + * + * @return the configuration value. + */ + public ContainerAppsBuildConfiguration configuration() { + return this.configuration; + } + + /** + * Get the logStreamEndpoint property: Endpoint from which the build logs can be streamed. + * + * @return the logStreamEndpoint value. + */ + public String logStreamEndpoint() { + return this.logStreamEndpoint; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (destinationContainerRegistry() != null) { + destinationContainerRegistry().validate(); + } + if (configuration() != null) { + configuration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppsBuildProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppsBuildProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerAppsBuildProperties. + */ + public static ContainerAppsBuildProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppsBuildProperties deserializedContainerAppsBuildProperties = new ContainerAppsBuildProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedContainerAppsBuildProperties.provisioningState + = BuildProvisioningState.fromString(reader.getString()); + } else if ("buildStatus".equals(fieldName)) { + deserializedContainerAppsBuildProperties.buildStatus = BuildStatus.fromString(reader.getString()); + } else if ("destinationContainerRegistry".equals(fieldName)) { + deserializedContainerAppsBuildProperties.destinationContainerRegistry + = ContainerRegistryWithCustomImage.fromJson(reader); + } else if ("configuration".equals(fieldName)) { + deserializedContainerAppsBuildProperties.configuration + = ContainerAppsBuildConfiguration.fromJson(reader); + } else if ("logStreamEndpoint".equals(fieldName)) { + deserializedContainerAppsBuildProperties.logStreamEndpoint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppsBuildProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppsBuildResourceInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppsBuildResourceInner.java new file mode 100644 index 0000000000000..bebda57ec0dac --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppsBuildResourceInner.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.BuildProvisioningState; +import com.azure.resourcemanager.appcontainers.models.BuildStatus; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsBuildConfiguration; +import com.azure.resourcemanager.appcontainers.models.ContainerRegistryWithCustomImage; +import java.io.IOException; + +/** + * Information pertaining to an individual build. + */ +@Immutable +public final class ContainerAppsBuildResourceInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private ContainerAppsBuildProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ContainerAppsBuildResourceInner class. + */ + public ContainerAppsBuildResourceInner() { + } + + /** + * Get the innerProperties property: The resource-specific properties for this resource. + * + * @return the innerProperties value. + */ + private ContainerAppsBuildProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the provisioningState property: Build provisioning state. + * + * @return the provisioningState value. + */ + public BuildProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the buildStatus property: Status of the build once it has been provisioned. + * + * @return the buildStatus value. + */ + public BuildStatus buildStatus() { + return this.innerProperties() == null ? null : this.innerProperties().buildStatus(); + } + + /** + * Get the destinationContainerRegistry property: Container registry that the final image will be uploaded to. + * + * @return the destinationContainerRegistry value. + */ + public ContainerRegistryWithCustomImage destinationContainerRegistry() { + return this.innerProperties() == null ? null : this.innerProperties().destinationContainerRegistry(); + } + + /** + * Get the configuration property: Configuration of the build. + * + * @return the configuration value. + */ + public ContainerAppsBuildConfiguration configuration() { + return this.innerProperties() == null ? null : this.innerProperties().configuration(); + } + + /** + * Get the logStreamEndpoint property: Endpoint from which the build logs can be streamed. + * + * @return the logStreamEndpoint value. + */ + public String logStreamEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().logStreamEndpoint(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppsBuildResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppsBuildResourceInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContainerAppsBuildResourceInner. + */ + public static ContainerAppsBuildResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppsBuildResourceInner deserializedContainerAppsBuildResourceInner + = new ContainerAppsBuildResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedContainerAppsBuildResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedContainerAppsBuildResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedContainerAppsBuildResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedContainerAppsBuildResourceInner.innerProperties + = ContainerAppsBuildProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedContainerAppsBuildResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppsBuildResourceInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppsPatchResourceInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppsPatchResourceInner.java new file mode 100644 index 0000000000000..eb0ce921ef433 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppsPatchResourceInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.PatchProperties; +import java.io.IOException; + +/** + * Container App Patch. + */ +@Immutable +public final class ContainerAppsPatchResourceInner extends ProxyResource { + /* + * Properties that describes current states of the patch resource. + */ + private PatchProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ContainerAppsPatchResourceInner class. + */ + public ContainerAppsPatchResourceInner() { + } + + /** + * Get the properties property: Properties that describes current states of the patch resource. + * + * @return the properties value. + */ + public PatchProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppsPatchResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppsPatchResourceInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContainerAppsPatchResourceInner. + */ + public static ContainerAppsPatchResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppsPatchResourceInner deserializedContainerAppsPatchResourceInner + = new ContainerAppsPatchResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedContainerAppsPatchResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedContainerAppsPatchResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedContainerAppsPatchResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedContainerAppsPatchResourceInner.properties = PatchProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedContainerAppsPatchResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppsPatchResourceInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentInner.java index 04430c5ff711a..efd72c8da287b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentInner.java @@ -10,6 +10,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.DaprComponentServiceBinding; import com.azure.resourcemanager.appcontainers.models.DaprMetadata; import com.azure.resourcemanager.appcontainers.models.Secret; import java.io.IOException; @@ -31,9 +32,9 @@ public final class DaprComponentInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -41,9 +42,9 @@ public final class DaprComponentInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of DaprComponentInner class. @@ -70,13 +71,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -90,13 +91,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** @@ -283,6 +284,29 @@ public DaprComponentInner withScopes(List scopes) { return this; } + /** + * Get the serviceComponentBind property: List of container app services that are bound to the Dapr component. + * + * @return the serviceComponentBind value. + */ + public List serviceComponentBind() { + return this.innerProperties() == null ? null : this.innerProperties().serviceComponentBind(); + } + + /** + * Set the serviceComponentBind property: List of container app services that are bound to the Dapr component. + * + * @param serviceComponentBind the serviceComponentBind value to set. + * @return the DaprComponentInner object itself. + */ + public DaprComponentInner withServiceComponentBind(List serviceComponentBind) { + if (this.innerProperties() == null) { + this.innerProperties = new DaprComponentProperties(); + } + this.innerProperties().withServiceComponentBind(serviceComponentBind); + return this; + } + /** * Validates the instance. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentProperties.java index 889c6b7bd48b7..2ea651f923a45 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentProperties.java @@ -9,6 +9,7 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.DaprComponentServiceBinding; import com.azure.resourcemanager.appcontainers.models.DaprMetadata; import com.azure.resourcemanager.appcontainers.models.Secret; import java.io.IOException; @@ -59,6 +60,11 @@ public final class DaprComponentProperties implements JsonSerializable scopes; + /* + * List of container app services that are bound to the Dapr component + */ + private List serviceComponentBind; + /** * Creates an instance of DaprComponentProperties class. */ @@ -225,6 +231,26 @@ public DaprComponentProperties withScopes(List scopes) { return this; } + /** + * Get the serviceComponentBind property: List of container app services that are bound to the Dapr component. + * + * @return the serviceComponentBind value. + */ + public List serviceComponentBind() { + return this.serviceComponentBind; + } + + /** + * Set the serviceComponentBind property: List of container app services that are bound to the Dapr component. + * + * @param serviceComponentBind the serviceComponentBind value to set. + * @return the DaprComponentProperties object itself. + */ + public DaprComponentProperties withServiceComponentBind(List serviceComponentBind) { + this.serviceComponentBind = serviceComponentBind; + return this; + } + /** * Validates the instance. * @@ -237,6 +263,9 @@ public void validate() { if (metadata() != null) { metadata().forEach(e -> e.validate()); } + if (serviceComponentBind() != null) { + serviceComponentBind().forEach(e -> e.validate()); + } } /** @@ -253,6 +282,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("secretStoreComponent", this.secretStoreComponent); jsonWriter.writeArrayField("metadata", this.metadata, (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("scopes", this.scopes, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("serviceComponentBind", this.serviceComponentBind, + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -290,6 +321,10 @@ public static DaprComponentProperties fromJson(JsonReader jsonReader) throws IOE } else if ("scopes".equals(fieldName)) { List scopes = reader.readArray(reader1 -> reader1.getString()); deserializedDaprComponentProperties.scopes = scopes; + } else if ("serviceComponentBind".equals(fieldName)) { + List serviceComponentBind + = reader.readArray(reader1 -> DaprComponentServiceBinding.fromJson(reader1)); + deserializedDaprComponentProperties.serviceComponentBind = serviceComponentBind; } else { reader.skipChildren(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentResiliencyPolicyInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentResiliencyPolicyInner.java new file mode 100644 index 0000000000000..6d4303b56664c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentResiliencyPolicyInner.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicyConfiguration; +import java.io.IOException; + +/** + * Dapr Component Resiliency Policy. + */ +@Fluent +public final class DaprComponentResiliencyPolicyInner extends ProxyResource { + /* + * Dapr Component Resiliency Policy resource specific properties + */ + private DaprComponentResiliencyPolicyProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DaprComponentResiliencyPolicyInner class. + */ + public DaprComponentResiliencyPolicyInner() { + } + + /** + * Get the innerProperties property: Dapr Component Resiliency Policy resource specific properties. + * + * @return the innerProperties value. + */ + private DaprComponentResiliencyPolicyProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the inboundPolicy property: The optional inbound component resiliency policy configuration. + * + * @return the inboundPolicy value. + */ + public DaprComponentResiliencyPolicyConfiguration inboundPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().inboundPolicy(); + } + + /** + * Set the inboundPolicy property: The optional inbound component resiliency policy configuration. + * + * @param inboundPolicy the inboundPolicy value to set. + * @return the DaprComponentResiliencyPolicyInner object itself. + */ + public DaprComponentResiliencyPolicyInner + withInboundPolicy(DaprComponentResiliencyPolicyConfiguration inboundPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new DaprComponentResiliencyPolicyProperties(); + } + this.innerProperties().withInboundPolicy(inboundPolicy); + return this; + } + + /** + * Get the outboundPolicy property: The optional outbound component resiliency policy configuration. + * + * @return the outboundPolicy value. + */ + public DaprComponentResiliencyPolicyConfiguration outboundPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().outboundPolicy(); + } + + /** + * Set the outboundPolicy property: The optional outbound component resiliency policy configuration. + * + * @param outboundPolicy the outboundPolicy value to set. + * @return the DaprComponentResiliencyPolicyInner object itself. + */ + public DaprComponentResiliencyPolicyInner + withOutboundPolicy(DaprComponentResiliencyPolicyConfiguration outboundPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new DaprComponentResiliencyPolicyProperties(); + } + this.innerProperties().withOutboundPolicy(outboundPolicy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprComponentResiliencyPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprComponentResiliencyPolicyInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DaprComponentResiliencyPolicyInner. + */ + public static DaprComponentResiliencyPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprComponentResiliencyPolicyInner deserializedDaprComponentResiliencyPolicyInner + = new DaprComponentResiliencyPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyInner.innerProperties + = DaprComponentResiliencyPolicyProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprComponentResiliencyPolicyInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentResiliencyPolicyProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentResiliencyPolicyProperties.java new file mode 100644 index 0000000000000..2167772c38d6f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentResiliencyPolicyProperties.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicyConfiguration; +import java.io.IOException; + +/** + * Dapr Component Resiliency Policy resource specific properties. + */ +@Fluent +public final class DaprComponentResiliencyPolicyProperties + implements JsonSerializable { + /* + * The optional inbound component resiliency policy configuration + */ + private DaprComponentResiliencyPolicyConfiguration inboundPolicy; + + /* + * The optional outbound component resiliency policy configuration + */ + private DaprComponentResiliencyPolicyConfiguration outboundPolicy; + + /** + * Creates an instance of DaprComponentResiliencyPolicyProperties class. + */ + public DaprComponentResiliencyPolicyProperties() { + } + + /** + * Get the inboundPolicy property: The optional inbound component resiliency policy configuration. + * + * @return the inboundPolicy value. + */ + public DaprComponentResiliencyPolicyConfiguration inboundPolicy() { + return this.inboundPolicy; + } + + /** + * Set the inboundPolicy property: The optional inbound component resiliency policy configuration. + * + * @param inboundPolicy the inboundPolicy value to set. + * @return the DaprComponentResiliencyPolicyProperties object itself. + */ + public DaprComponentResiliencyPolicyProperties + withInboundPolicy(DaprComponentResiliencyPolicyConfiguration inboundPolicy) { + this.inboundPolicy = inboundPolicy; + return this; + } + + /** + * Get the outboundPolicy property: The optional outbound component resiliency policy configuration. + * + * @return the outboundPolicy value. + */ + public DaprComponentResiliencyPolicyConfiguration outboundPolicy() { + return this.outboundPolicy; + } + + /** + * Set the outboundPolicy property: The optional outbound component resiliency policy configuration. + * + * @param outboundPolicy the outboundPolicy value to set. + * @return the DaprComponentResiliencyPolicyProperties object itself. + */ + public DaprComponentResiliencyPolicyProperties + withOutboundPolicy(DaprComponentResiliencyPolicyConfiguration outboundPolicy) { + this.outboundPolicy = outboundPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (inboundPolicy() != null) { + inboundPolicy().validate(); + } + if (outboundPolicy() != null) { + outboundPolicy().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("inboundPolicy", this.inboundPolicy); + jsonWriter.writeJsonField("outboundPolicy", this.outboundPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprComponentResiliencyPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprComponentResiliencyPolicyProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprComponentResiliencyPolicyProperties. + */ + public static DaprComponentResiliencyPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprComponentResiliencyPolicyProperties deserializedDaprComponentResiliencyPolicyProperties + = new DaprComponentResiliencyPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("inboundPolicy".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyProperties.inboundPolicy + = DaprComponentResiliencyPolicyConfiguration.fromJson(reader); + } else if ("outboundPolicy".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyProperties.outboundPolicy + = DaprComponentResiliencyPolicyConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprComponentResiliencyPolicyProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSubscriptionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSubscriptionInner.java new file mode 100644 index 0000000000000..623eba27acae3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSubscriptionInner.java @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.DaprSubscriptionBulkSubscribeOptions; +import com.azure.resourcemanager.appcontainers.models.DaprSubscriptionRoutes; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Dapr PubSub Event Subscription. + */ +@Fluent +public final class DaprSubscriptionInner extends ProxyResource { + /* + * Dapr PubSub Event Subscription resource specific properties + */ + private DaprSubscriptionProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DaprSubscriptionInner class. + */ + public DaprSubscriptionInner() { + } + + /** + * Get the innerProperties property: Dapr PubSub Event Subscription resource specific properties. + * + * @return the innerProperties value. + */ + private DaprSubscriptionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the pubsubName property: Dapr PubSub component name. + * + * @return the pubsubName value. + */ + public String pubsubName() { + return this.innerProperties() == null ? null : this.innerProperties().pubsubName(); + } + + /** + * Set the pubsubName property: Dapr PubSub component name. + * + * @param pubsubName the pubsubName value to set. + * @return the DaprSubscriptionInner object itself. + */ + public DaprSubscriptionInner withPubsubName(String pubsubName) { + if (this.innerProperties() == null) { + this.innerProperties = new DaprSubscriptionProperties(); + } + this.innerProperties().withPubsubName(pubsubName); + return this; + } + + /** + * Get the topic property: Topic name. + * + * @return the topic value. + */ + public String topic() { + return this.innerProperties() == null ? null : this.innerProperties().topic(); + } + + /** + * Set the topic property: Topic name. + * + * @param topic the topic value to set. + * @return the DaprSubscriptionInner object itself. + */ + public DaprSubscriptionInner withTopic(String topic) { + if (this.innerProperties() == null) { + this.innerProperties = new DaprSubscriptionProperties(); + } + this.innerProperties().withTopic(topic); + return this; + } + + /** + * Get the deadLetterTopic property: Deadletter topic name. + * + * @return the deadLetterTopic value. + */ + public String deadLetterTopic() { + return this.innerProperties() == null ? null : this.innerProperties().deadLetterTopic(); + } + + /** + * Set the deadLetterTopic property: Deadletter topic name. + * + * @param deadLetterTopic the deadLetterTopic value to set. + * @return the DaprSubscriptionInner object itself. + */ + public DaprSubscriptionInner withDeadLetterTopic(String deadLetterTopic) { + if (this.innerProperties() == null) { + this.innerProperties = new DaprSubscriptionProperties(); + } + this.innerProperties().withDeadLetterTopic(deadLetterTopic); + return this; + } + + /** + * Get the routes property: Subscription routes. + * + * @return the routes value. + */ + public DaprSubscriptionRoutes routes() { + return this.innerProperties() == null ? null : this.innerProperties().routes(); + } + + /** + * Set the routes property: Subscription routes. + * + * @param routes the routes value to set. + * @return the DaprSubscriptionInner object itself. + */ + public DaprSubscriptionInner withRoutes(DaprSubscriptionRoutes routes) { + if (this.innerProperties() == null) { + this.innerProperties = new DaprSubscriptionProperties(); + } + this.innerProperties().withRoutes(routes); + return this; + } + + /** + * Get the scopes property: Application scopes to restrict the subscription to specific apps. + * + * @return the scopes value. + */ + public List scopes() { + return this.innerProperties() == null ? null : this.innerProperties().scopes(); + } + + /** + * Set the scopes property: Application scopes to restrict the subscription to specific apps. + * + * @param scopes the scopes value to set. + * @return the DaprSubscriptionInner object itself. + */ + public DaprSubscriptionInner withScopes(List scopes) { + if (this.innerProperties() == null) { + this.innerProperties = new DaprSubscriptionProperties(); + } + this.innerProperties().withScopes(scopes); + return this; + } + + /** + * Get the metadata property: Subscription metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.innerProperties() == null ? null : this.innerProperties().metadata(); + } + + /** + * Set the metadata property: Subscription metadata. + * + * @param metadata the metadata value to set. + * @return the DaprSubscriptionInner object itself. + */ + public DaprSubscriptionInner withMetadata(Map metadata) { + if (this.innerProperties() == null) { + this.innerProperties = new DaprSubscriptionProperties(); + } + this.innerProperties().withMetadata(metadata); + return this; + } + + /** + * Get the bulkSubscribe property: Bulk subscription options. + * + * @return the bulkSubscribe value. + */ + public DaprSubscriptionBulkSubscribeOptions bulkSubscribe() { + return this.innerProperties() == null ? null : this.innerProperties().bulkSubscribe(); + } + + /** + * Set the bulkSubscribe property: Bulk subscription options. + * + * @param bulkSubscribe the bulkSubscribe value to set. + * @return the DaprSubscriptionInner object itself. + */ + public DaprSubscriptionInner withBulkSubscribe(DaprSubscriptionBulkSubscribeOptions bulkSubscribe) { + if (this.innerProperties() == null) { + this.innerProperties = new DaprSubscriptionProperties(); + } + this.innerProperties().withBulkSubscribe(bulkSubscribe); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprSubscriptionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprSubscriptionInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DaprSubscriptionInner. + */ + public static DaprSubscriptionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprSubscriptionInner deserializedDaprSubscriptionInner = new DaprSubscriptionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDaprSubscriptionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDaprSubscriptionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDaprSubscriptionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDaprSubscriptionInner.innerProperties = DaprSubscriptionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDaprSubscriptionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprSubscriptionInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSubscriptionProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSubscriptionProperties.java new file mode 100644 index 0000000000000..94f636305390b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSubscriptionProperties.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.DaprSubscriptionBulkSubscribeOptions; +import com.azure.resourcemanager.appcontainers.models.DaprSubscriptionRoutes; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Dapr PubSub Event Subscription resource specific properties. + */ +@Fluent +public final class DaprSubscriptionProperties implements JsonSerializable { + /* + * Dapr PubSub component name + */ + private String pubsubName; + + /* + * Topic name + */ + private String topic; + + /* + * Deadletter topic name + */ + private String deadLetterTopic; + + /* + * Subscription routes + */ + private DaprSubscriptionRoutes routes; + + /* + * Application scopes to restrict the subscription to specific apps. + */ + private List scopes; + + /* + * Subscription metadata + */ + private Map metadata; + + /* + * Bulk subscription options + */ + private DaprSubscriptionBulkSubscribeOptions bulkSubscribe; + + /** + * Creates an instance of DaprSubscriptionProperties class. + */ + public DaprSubscriptionProperties() { + } + + /** + * Get the pubsubName property: Dapr PubSub component name. + * + * @return the pubsubName value. + */ + public String pubsubName() { + return this.pubsubName; + } + + /** + * Set the pubsubName property: Dapr PubSub component name. + * + * @param pubsubName the pubsubName value to set. + * @return the DaprSubscriptionProperties object itself. + */ + public DaprSubscriptionProperties withPubsubName(String pubsubName) { + this.pubsubName = pubsubName; + return this; + } + + /** + * Get the topic property: Topic name. + * + * @return the topic value. + */ + public String topic() { + return this.topic; + } + + /** + * Set the topic property: Topic name. + * + * @param topic the topic value to set. + * @return the DaprSubscriptionProperties object itself. + */ + public DaprSubscriptionProperties withTopic(String topic) { + this.topic = topic; + return this; + } + + /** + * Get the deadLetterTopic property: Deadletter topic name. + * + * @return the deadLetterTopic value. + */ + public String deadLetterTopic() { + return this.deadLetterTopic; + } + + /** + * Set the deadLetterTopic property: Deadletter topic name. + * + * @param deadLetterTopic the deadLetterTopic value to set. + * @return the DaprSubscriptionProperties object itself. + */ + public DaprSubscriptionProperties withDeadLetterTopic(String deadLetterTopic) { + this.deadLetterTopic = deadLetterTopic; + return this; + } + + /** + * Get the routes property: Subscription routes. + * + * @return the routes value. + */ + public DaprSubscriptionRoutes routes() { + return this.routes; + } + + /** + * Set the routes property: Subscription routes. + * + * @param routes the routes value to set. + * @return the DaprSubscriptionProperties object itself. + */ + public DaprSubscriptionProperties withRoutes(DaprSubscriptionRoutes routes) { + this.routes = routes; + return this; + } + + /** + * Get the scopes property: Application scopes to restrict the subscription to specific apps. + * + * @return the scopes value. + */ + public List scopes() { + return this.scopes; + } + + /** + * Set the scopes property: Application scopes to restrict the subscription to specific apps. + * + * @param scopes the scopes value to set. + * @return the DaprSubscriptionProperties object itself. + */ + public DaprSubscriptionProperties withScopes(List scopes) { + this.scopes = scopes; + return this; + } + + /** + * Get the metadata property: Subscription metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: Subscription metadata. + * + * @param metadata the metadata value to set. + * @return the DaprSubscriptionProperties object itself. + */ + public DaprSubscriptionProperties withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the bulkSubscribe property: Bulk subscription options. + * + * @return the bulkSubscribe value. + */ + public DaprSubscriptionBulkSubscribeOptions bulkSubscribe() { + return this.bulkSubscribe; + } + + /** + * Set the bulkSubscribe property: Bulk subscription options. + * + * @param bulkSubscribe the bulkSubscribe value to set. + * @return the DaprSubscriptionProperties object itself. + */ + public DaprSubscriptionProperties withBulkSubscribe(DaprSubscriptionBulkSubscribeOptions bulkSubscribe) { + this.bulkSubscribe = bulkSubscribe; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (routes() != null) { + routes().validate(); + } + if (bulkSubscribe() != null) { + bulkSubscribe().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("pubsubName", this.pubsubName); + jsonWriter.writeStringField("topic", this.topic); + jsonWriter.writeStringField("deadLetterTopic", this.deadLetterTopic); + jsonWriter.writeJsonField("routes", this.routes); + jsonWriter.writeArrayField("scopes", this.scopes, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("bulkSubscribe", this.bulkSubscribe); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprSubscriptionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprSubscriptionProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprSubscriptionProperties. + */ + public static DaprSubscriptionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprSubscriptionProperties deserializedDaprSubscriptionProperties = new DaprSubscriptionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("pubsubName".equals(fieldName)) { + deserializedDaprSubscriptionProperties.pubsubName = reader.getString(); + } else if ("topic".equals(fieldName)) { + deserializedDaprSubscriptionProperties.topic = reader.getString(); + } else if ("deadLetterTopic".equals(fieldName)) { + deserializedDaprSubscriptionProperties.deadLetterTopic = reader.getString(); + } else if ("routes".equals(fieldName)) { + deserializedDaprSubscriptionProperties.routes = DaprSubscriptionRoutes.fromJson(reader); + } else if ("scopes".equals(fieldName)) { + List scopes = reader.readArray(reader1 -> reader1.getString()); + deserializedDaprSubscriptionProperties.scopes = scopes; + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedDaprSubscriptionProperties.metadata = metadata; + } else if ("bulkSubscribe".equals(fieldName)) { + deserializedDaprSubscriptionProperties.bulkSubscribe + = DaprSubscriptionBulkSubscribeOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprSubscriptionProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DiagnosticsInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DiagnosticsInner.java index 0a3cb6412ecc1..f10dbcc28fe04 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DiagnosticsInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DiagnosticsInner.java @@ -29,9 +29,9 @@ public final class DiagnosticsInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -39,9 +39,9 @@ public final class DiagnosticsInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of DiagnosticsInner class. @@ -79,13 +79,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -99,13 +99,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DotNetComponentInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DotNetComponentInner.java new file mode 100644 index 0000000000000..8ff895f7f39df --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DotNetComponentInner.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentConfigurationProperty; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentProvisioningState; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentServiceBind; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentType; +import java.io.IOException; +import java.util.List; + +/** + * .NET Component. + */ +@Fluent +public final class DotNetComponentInner extends ProxyResource { + /* + * .NET Component resource specific properties + */ + private DotNetComponentProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DotNetComponentInner class. + */ + public DotNetComponentInner() { + } + + /** + * Get the innerProperties property: .NET Component resource specific properties. + * + * @return the innerProperties value. + */ + private DotNetComponentProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the componentType property: Type of the .NET Component. + * + * @return the componentType value. + */ + public DotNetComponentType componentType() { + return this.innerProperties() == null ? null : this.innerProperties().componentType(); + } + + /** + * Set the componentType property: Type of the .NET Component. + * + * @param componentType the componentType value to set. + * @return the DotNetComponentInner object itself. + */ + public DotNetComponentInner withComponentType(DotNetComponentType componentType) { + if (this.innerProperties() == null) { + this.innerProperties = new DotNetComponentProperties(); + } + this.innerProperties().withComponentType(componentType); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the .NET Component. + * + * @return the provisioningState value. + */ + public DotNetComponentProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the configurations property: List of .NET Components configuration properties. + * + * @return the configurations value. + */ + public List configurations() { + return this.innerProperties() == null ? null : this.innerProperties().configurations(); + } + + /** + * Set the configurations property: List of .NET Components configuration properties. + * + * @param configurations the configurations value to set. + * @return the DotNetComponentInner object itself. + */ + public DotNetComponentInner withConfigurations(List configurations) { + if (this.innerProperties() == null) { + this.innerProperties = new DotNetComponentProperties(); + } + this.innerProperties().withConfigurations(configurations); + return this; + } + + /** + * Get the serviceBinds property: List of .NET Components that are bound to the .NET component. + * + * @return the serviceBinds value. + */ + public List serviceBinds() { + return this.innerProperties() == null ? null : this.innerProperties().serviceBinds(); + } + + /** + * Set the serviceBinds property: List of .NET Components that are bound to the .NET component. + * + * @param serviceBinds the serviceBinds value to set. + * @return the DotNetComponentInner object itself. + */ + public DotNetComponentInner withServiceBinds(List serviceBinds) { + if (this.innerProperties() == null) { + this.innerProperties = new DotNetComponentProperties(); + } + this.innerProperties().withServiceBinds(serviceBinds); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DotNetComponentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DotNetComponentInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DotNetComponentInner. + */ + public static DotNetComponentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DotNetComponentInner deserializedDotNetComponentInner = new DotNetComponentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDotNetComponentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDotNetComponentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDotNetComponentInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDotNetComponentInner.innerProperties = DotNetComponentProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDotNetComponentInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDotNetComponentInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DotNetComponentProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DotNetComponentProperties.java new file mode 100644 index 0000000000000..182ec5ce5887b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DotNetComponentProperties.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentConfigurationProperty; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentProvisioningState; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentServiceBind; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentType; +import java.io.IOException; +import java.util.List; + +/** + * .NET Component resource specific properties. + */ +@Fluent +public final class DotNetComponentProperties implements JsonSerializable { + /* + * Type of the .NET Component. + */ + private DotNetComponentType componentType; + + /* + * Provisioning state of the .NET Component. + */ + private DotNetComponentProvisioningState provisioningState; + + /* + * List of .NET Components configuration properties + */ + private List configurations; + + /* + * List of .NET Components that are bound to the .NET component + */ + private List serviceBinds; + + /** + * Creates an instance of DotNetComponentProperties class. + */ + public DotNetComponentProperties() { + } + + /** + * Get the componentType property: Type of the .NET Component. + * + * @return the componentType value. + */ + public DotNetComponentType componentType() { + return this.componentType; + } + + /** + * Set the componentType property: Type of the .NET Component. + * + * @param componentType the componentType value to set. + * @return the DotNetComponentProperties object itself. + */ + public DotNetComponentProperties withComponentType(DotNetComponentType componentType) { + this.componentType = componentType; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the .NET Component. + * + * @return the provisioningState value. + */ + public DotNetComponentProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the configurations property: List of .NET Components configuration properties. + * + * @return the configurations value. + */ + public List configurations() { + return this.configurations; + } + + /** + * Set the configurations property: List of .NET Components configuration properties. + * + * @param configurations the configurations value to set. + * @return the DotNetComponentProperties object itself. + */ + public DotNetComponentProperties withConfigurations(List configurations) { + this.configurations = configurations; + return this; + } + + /** + * Get the serviceBinds property: List of .NET Components that are bound to the .NET component. + * + * @return the serviceBinds value. + */ + public List serviceBinds() { + return this.serviceBinds; + } + + /** + * Set the serviceBinds property: List of .NET Components that are bound to the .NET component. + * + * @param serviceBinds the serviceBinds value to set. + * @return the DotNetComponentProperties object itself. + */ + public DotNetComponentProperties withServiceBinds(List serviceBinds) { + this.serviceBinds = serviceBinds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (configurations() != null) { + configurations().forEach(e -> e.validate()); + } + if (serviceBinds() != null) { + serviceBinds().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("componentType", this.componentType == null ? null : this.componentType.toString()); + jsonWriter.writeArrayField("configurations", this.configurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("serviceBinds", this.serviceBinds, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DotNetComponentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DotNetComponentProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DotNetComponentProperties. + */ + public static DotNetComponentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DotNetComponentProperties deserializedDotNetComponentProperties = new DotNetComponentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("componentType".equals(fieldName)) { + deserializedDotNetComponentProperties.componentType + = DotNetComponentType.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedDotNetComponentProperties.provisioningState + = DotNetComponentProvisioningState.fromString(reader.getString()); + } else if ("configurations".equals(fieldName)) { + List configurations + = reader.readArray(reader1 -> DotNetComponentConfigurationProperty.fromJson(reader1)); + deserializedDotNetComponentProperties.configurations = configurations; + } else if ("serviceBinds".equals(fieldName)) { + List serviceBinds + = reader.readArray(reader1 -> DotNetComponentServiceBind.fromJson(reader1)); + deserializedDotNetComponentProperties.serviceBinds = serviceBinds; + } else { + reader.skipChildren(); + } + } + + return deserializedDotNetComponentProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/EnvironmentAuthTokenInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/EnvironmentAuthTokenInner.java index 3c6b0c872ef81..0e95d91fd7575 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/EnvironmentAuthTokenInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/EnvironmentAuthTokenInner.java @@ -30,9 +30,9 @@ public final class EnvironmentAuthTokenInner extends Resource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -40,9 +40,9 @@ public final class EnvironmentAuthTokenInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of EnvironmentAuthTokenInner class. @@ -69,13 +69,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -89,13 +89,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/HeaderMatchMatch.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/HeaderMatchMatch.java new file mode 100644 index 0000000000000..3f50c599fc2b2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/HeaderMatchMatch.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Type of match to perform. + */ +@Fluent +public final class HeaderMatchMatch implements JsonSerializable { + /* + * Exact value of the header + */ + private String exactMatch; + + /* + * Prefix value of the header + */ + private String prefixMatch; + + /* + * Suffix value of the header + */ + private String suffixMatch; + + /* + * Regex value of the header + */ + private String regexMatch; + + /** + * Creates an instance of HeaderMatchMatch class. + */ + public HeaderMatchMatch() { + } + + /** + * Get the exactMatch property: Exact value of the header. + * + * @return the exactMatch value. + */ + public String exactMatch() { + return this.exactMatch; + } + + /** + * Set the exactMatch property: Exact value of the header. + * + * @param exactMatch the exactMatch value to set. + * @return the HeaderMatchMatch object itself. + */ + public HeaderMatchMatch withExactMatch(String exactMatch) { + this.exactMatch = exactMatch; + return this; + } + + /** + * Get the prefixMatch property: Prefix value of the header. + * + * @return the prefixMatch value. + */ + public String prefixMatch() { + return this.prefixMatch; + } + + /** + * Set the prefixMatch property: Prefix value of the header. + * + * @param prefixMatch the prefixMatch value to set. + * @return the HeaderMatchMatch object itself. + */ + public HeaderMatchMatch withPrefixMatch(String prefixMatch) { + this.prefixMatch = prefixMatch; + return this; + } + + /** + * Get the suffixMatch property: Suffix value of the header. + * + * @return the suffixMatch value. + */ + public String suffixMatch() { + return this.suffixMatch; + } + + /** + * Set the suffixMatch property: Suffix value of the header. + * + * @param suffixMatch the suffixMatch value to set. + * @return the HeaderMatchMatch object itself. + */ + public HeaderMatchMatch withSuffixMatch(String suffixMatch) { + this.suffixMatch = suffixMatch; + return this; + } + + /** + * Get the regexMatch property: Regex value of the header. + * + * @return the regexMatch value. + */ + public String regexMatch() { + return this.regexMatch; + } + + /** + * Set the regexMatch property: Regex value of the header. + * + * @param regexMatch the regexMatch value to set. + * @return the HeaderMatchMatch object itself. + */ + public HeaderMatchMatch withRegexMatch(String regexMatch) { + this.regexMatch = regexMatch; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("exactMatch", this.exactMatch); + jsonWriter.writeStringField("prefixMatch", this.prefixMatch); + jsonWriter.writeStringField("suffixMatch", this.suffixMatch); + jsonWriter.writeStringField("regexMatch", this.regexMatch); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HeaderMatchMatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HeaderMatchMatch if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HeaderMatchMatch. + */ + public static HeaderMatchMatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HeaderMatchMatch deserializedHeaderMatchMatch = new HeaderMatchMatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("exactMatch".equals(fieldName)) { + deserializedHeaderMatchMatch.exactMatch = reader.getString(); + } else if ("prefixMatch".equals(fieldName)) { + deserializedHeaderMatchMatch.prefixMatch = reader.getString(); + } else if ("suffixMatch".equals(fieldName)) { + deserializedHeaderMatchMatch.suffixMatch = reader.getString(); + } else if ("regexMatch".equals(fieldName)) { + deserializedHeaderMatchMatch.regexMatch = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHeaderMatchMatch; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/HttpRetryPolicyMatches.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/HttpRetryPolicyMatches.java new file mode 100644 index 0000000000000..6d94fe02bc2b1 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/HttpRetryPolicyMatches.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.HeaderMatch; +import java.io.IOException; +import java.util.List; + +/** + * Conditions that must be met for a request to be retried. + */ +@Fluent +public final class HttpRetryPolicyMatches implements JsonSerializable { + /* + * Headers that must be present for a request to be retried + */ + private List headers; + + /* + * Additional http status codes that can trigger a retry + */ + private List httpStatusCodes; + + /* + * Errors that can trigger a retry + */ + private List errors; + + /** + * Creates an instance of HttpRetryPolicyMatches class. + */ + public HttpRetryPolicyMatches() { + } + + /** + * Get the headers property: Headers that must be present for a request to be retried. + * + * @return the headers value. + */ + public List headers() { + return this.headers; + } + + /** + * Set the headers property: Headers that must be present for a request to be retried. + * + * @param headers the headers value to set. + * @return the HttpRetryPolicyMatches object itself. + */ + public HttpRetryPolicyMatches withHeaders(List headers) { + this.headers = headers; + return this; + } + + /** + * Get the httpStatusCodes property: Additional http status codes that can trigger a retry. + * + * @return the httpStatusCodes value. + */ + public List httpStatusCodes() { + return this.httpStatusCodes; + } + + /** + * Set the httpStatusCodes property: Additional http status codes that can trigger a retry. + * + * @param httpStatusCodes the httpStatusCodes value to set. + * @return the HttpRetryPolicyMatches object itself. + */ + public HttpRetryPolicyMatches withHttpStatusCodes(List httpStatusCodes) { + this.httpStatusCodes = httpStatusCodes; + return this; + } + + /** + * Get the errors property: Errors that can trigger a retry. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Set the errors property: Errors that can trigger a retry. + * + * @param errors the errors value to set. + * @return the HttpRetryPolicyMatches object itself. + */ + public HttpRetryPolicyMatches withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (headers() != null) { + headers().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("headers", this.headers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("httpStatusCodes", this.httpStatusCodes, + (writer, element) -> writer.writeInt(element)); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HttpRetryPolicyMatches from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HttpRetryPolicyMatches if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the HttpRetryPolicyMatches. + */ + public static HttpRetryPolicyMatches fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HttpRetryPolicyMatches deserializedHttpRetryPolicyMatches = new HttpRetryPolicyMatches(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("headers".equals(fieldName)) { + List headers = reader.readArray(reader1 -> HeaderMatch.fromJson(reader1)); + deserializedHttpRetryPolicyMatches.headers = headers; + } else if ("httpStatusCodes".equals(fieldName)) { + List httpStatusCodes = reader.readArray(reader1 -> reader1.getInt()); + deserializedHttpRetryPolicyMatches.httpStatusCodes = httpStatusCodes; + } else if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> reader1.getString()); + deserializedHttpRetryPolicyMatches.errors = errors; + } else { + reader.skipChildren(); + } + } + + return deserializedHttpRetryPolicyMatches; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/HttpRetryPolicyRetryBackOff.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/HttpRetryPolicyRetryBackOff.java new file mode 100644 index 0000000000000..b84e2a65d710c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/HttpRetryPolicyRetryBackOff.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Settings for retry backoff characteristics. + */ +@Fluent +public final class HttpRetryPolicyRetryBackOff implements JsonSerializable { + /* + * Initial delay, in milliseconds, before retrying a request + */ + private Long initialDelayInMilliseconds; + + /* + * Maximum interval, in milliseconds, between retries + */ + private Long maxIntervalInMilliseconds; + + /** + * Creates an instance of HttpRetryPolicyRetryBackOff class. + */ + public HttpRetryPolicyRetryBackOff() { + } + + /** + * Get the initialDelayInMilliseconds property: Initial delay, in milliseconds, before retrying a request. + * + * @return the initialDelayInMilliseconds value. + */ + public Long initialDelayInMilliseconds() { + return this.initialDelayInMilliseconds; + } + + /** + * Set the initialDelayInMilliseconds property: Initial delay, in milliseconds, before retrying a request. + * + * @param initialDelayInMilliseconds the initialDelayInMilliseconds value to set. + * @return the HttpRetryPolicyRetryBackOff object itself. + */ + public HttpRetryPolicyRetryBackOff withInitialDelayInMilliseconds(Long initialDelayInMilliseconds) { + this.initialDelayInMilliseconds = initialDelayInMilliseconds; + return this; + } + + /** + * Get the maxIntervalInMilliseconds property: Maximum interval, in milliseconds, between retries. + * + * @return the maxIntervalInMilliseconds value. + */ + public Long maxIntervalInMilliseconds() { + return this.maxIntervalInMilliseconds; + } + + /** + * Set the maxIntervalInMilliseconds property: Maximum interval, in milliseconds, between retries. + * + * @param maxIntervalInMilliseconds the maxIntervalInMilliseconds value to set. + * @return the HttpRetryPolicyRetryBackOff object itself. + */ + public HttpRetryPolicyRetryBackOff withMaxIntervalInMilliseconds(Long maxIntervalInMilliseconds) { + this.maxIntervalInMilliseconds = maxIntervalInMilliseconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("initialDelayInMilliseconds", this.initialDelayInMilliseconds); + jsonWriter.writeNumberField("maxIntervalInMilliseconds", this.maxIntervalInMilliseconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HttpRetryPolicyRetryBackOff from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HttpRetryPolicyRetryBackOff if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the HttpRetryPolicyRetryBackOff. + */ + public static HttpRetryPolicyRetryBackOff fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HttpRetryPolicyRetryBackOff deserializedHttpRetryPolicyRetryBackOff = new HttpRetryPolicyRetryBackOff(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("initialDelayInMilliseconds".equals(fieldName)) { + deserializedHttpRetryPolicyRetryBackOff.initialDelayInMilliseconds + = reader.getNullable(JsonReader::getLong); + } else if ("maxIntervalInMilliseconds".equals(fieldName)) { + deserializedHttpRetryPolicyRetryBackOff.maxIntervalInMilliseconds + = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedHttpRetryPolicyRetryBackOff; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JavaComponentInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JavaComponentInner.java new file mode 100644 index 0000000000000..d7d89a61dd643 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JavaComponentInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.JavaComponentProperties; +import java.io.IOException; + +/** + * Java Component. + */ +@Fluent +public final class JavaComponentInner extends ProxyResource { + /* + * Java Component resource specific properties + */ + private JavaComponentProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of JavaComponentInner class. + */ + public JavaComponentInner() { + } + + /** + * Get the properties property: Java Component resource specific properties. + * + * @return the properties value. + */ + public JavaComponentProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Java Component resource specific properties. + * + * @param properties the properties value to set. + * @return the JavaComponentInner object itself. + */ + public JavaComponentInner withProperties(JavaComponentProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JavaComponentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JavaComponentInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the JavaComponentInner. + */ + public static JavaComponentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JavaComponentInner deserializedJavaComponentInner = new JavaComponentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedJavaComponentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedJavaComponentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedJavaComponentInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedJavaComponentInner.properties = JavaComponentProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedJavaComponentInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedJavaComponentInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionInner.java index 8eaa5a9b57f33..e2a76d5a4b6e0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionInner.java @@ -9,6 +9,7 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.ExecutionStatus; import com.azure.resourcemanager.appcontainers.models.JobExecutionRunningState; import com.azure.resourcemanager.appcontainers.models.JobExecutionTemplate; import java.io.IOException; @@ -192,6 +193,29 @@ public JobExecutionInner withTemplate(JobExecutionTemplate template) { return this; } + /** + * Get the detailedStatus property: Detailed status of the job execution. + * + * @return the detailedStatus value. + */ + public ExecutionStatus detailedStatus() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatus(); + } + + /** + * Set the detailedStatus property: Detailed status of the job execution. + * + * @param detailedStatus the detailedStatus value to set. + * @return the JobExecutionInner object itself. + */ + public JobExecutionInner withDetailedStatus(ExecutionStatus detailedStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new JobExecutionProperties(); + } + this.innerProperties().withDetailedStatus(detailedStatus); + return this; + } + /** * Validates the instance. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionProperties.java index e1ed19641b891..f4c57c06efca1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionProperties.java @@ -10,6 +10,7 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.ExecutionStatus; import com.azure.resourcemanager.appcontainers.models.JobExecutionRunningState; import com.azure.resourcemanager.appcontainers.models.JobExecutionTemplate; import java.io.IOException; @@ -41,6 +42,11 @@ public final class JobExecutionProperties implements JsonSerializable CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("template".equals(fieldName)) { deserializedJobExecutionProperties.template = JobExecutionTemplate.fromJson(reader); + } else if ("detailedStatus".equals(fieldName)) { + deserializedJobExecutionProperties.detailedStatus = ExecutionStatus.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobInner.java index 32412c2489bab..e1f409fb7cd17 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobInner.java @@ -10,8 +10,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.ExtendedLocation; import com.azure.resourcemanager.appcontainers.models.JobConfiguration; import com.azure.resourcemanager.appcontainers.models.JobProvisioningState; +import com.azure.resourcemanager.appcontainers.models.JobRunningState; import com.azure.resourcemanager.appcontainers.models.JobTemplate; import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; import java.io.IOException; @@ -23,6 +25,11 @@ */ @Fluent public final class JobInner extends Resource { + /* + * The complex type of the extended location. + */ + private ExtendedLocation extendedLocation; + /* * Managed identities needed by a container app job to interact with other Azure services to not maintain any * secrets or credentials in code. @@ -40,9 +47,9 @@ public final class JobInner extends Resource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -50,9 +57,9 @@ public final class JobInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of JobInner class. @@ -60,6 +67,26 @@ public final class JobInner extends Resource { public JobInner() { } + /** + * Get the extendedLocation property: The complex type of the extended location. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The complex type of the extended location. + * + * @param extendedLocation the extendedLocation value to set. + * @return the JobInner object itself. + */ + public JobInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + /** * Get the identity property: Managed identities needed by a container app job to interact with other Azure services * to not maintain any secrets or credentials in code. @@ -101,13 +128,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -121,13 +148,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** @@ -157,6 +184,15 @@ public JobProvisioningState provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } + /** + * Get the runningState property: Current running state of the job. + * + * @return the runningState value. + */ + public JobRunningState runningState() { + return this.innerProperties() == null ? null : this.innerProperties().runningState(); + } + /** * Get the environmentId property: Resource ID of environment. * @@ -273,6 +309,9 @@ public String eventStreamEndpoint() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (extendedLocation() != null) { + extendedLocation().validate(); + } if (identity() != null) { identity().validate(); } @@ -289,6 +328,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); jsonWriter.writeJsonField("identity", this.identity); jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); @@ -321,6 +361,8 @@ public static JobInner fromJson(JsonReader jsonReader) throws IOException { } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedJobInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedJobInner.extendedLocation = ExtendedLocation.fromJson(reader); } else if ("identity".equals(fieldName)) { deserializedJobInner.identity = ManagedServiceIdentity.fromJson(reader); } else if ("properties".equals(fieldName)) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobProperties.java index f5b84eefb2718..07770179672fb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobProperties.java @@ -11,6 +11,7 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.appcontainers.models.JobConfiguration; import com.azure.resourcemanager.appcontainers.models.JobProvisioningState; +import com.azure.resourcemanager.appcontainers.models.JobRunningState; import com.azure.resourcemanager.appcontainers.models.JobTemplate; import java.io.IOException; import java.util.List; @@ -25,6 +26,11 @@ public final class JobProperties implements JsonSerializable { */ private JobProvisioningState provisioningState; + /* + * Current running state of the job + */ + private JobRunningState runningState; + /* * Resource ID of environment. */ @@ -70,6 +76,15 @@ public JobProvisioningState provisioningState() { return this.provisioningState; } + /** + * Get the runningState property: Current running state of the job. + * + * @return the runningState value. + */ + public JobRunningState runningState() { + return this.runningState; + } + /** * Get the environmentId property: Resource ID of environment. * @@ -212,6 +227,8 @@ public static JobProperties fromJson(JsonReader jsonReader) throws IOException { if ("provisioningState".equals(fieldName)) { deserializedJobProperties.provisioningState = JobProvisioningState.fromString(reader.getString()); + } else if ("runningState".equals(fieldName)) { + deserializedJobProperties.runningState = JobRunningState.fromString(reader.getString()); } else if ("environmentId".equals(fieldName)) { deserializedJobProperties.environmentId = reader.getString(); } else if ("workloadProfileName".equals(fieldName)) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/LogicAppInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/LogicAppInner.java new file mode 100644 index 0000000000000..eb646b6c00963 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/LogicAppInner.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A logic app extension resource. + */ +@Fluent +public final class LogicAppInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private Object properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of LogicAppInner class. + */ + public LogicAppInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the LogicAppInner object itself. + */ + public LogicAppInner withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeUntypedField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogicAppInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogicAppInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LogicAppInner. + */ + public static LogicAppInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogicAppInner deserializedLogicAppInner = new LogicAppInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLogicAppInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLogicAppInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLogicAppInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedLogicAppInner.properties = reader.readUntyped(); + } else if ("systemData".equals(fieldName)) { + deserializedLogicAppInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLogicAppInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedCertificateInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedCertificateInner.java index 06078138d52ef..cfdecdcf62b14 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedCertificateInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedCertificateInner.java @@ -30,9 +30,9 @@ public final class ManagedCertificateInner extends Resource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -40,9 +40,9 @@ public final class ManagedCertificateInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of ManagedCertificateInner class. @@ -80,13 +80,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -100,13 +100,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentInner.java index a10b687902fe6..3bee1a560a9a3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentInner.java @@ -10,6 +10,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.AppInsightsConfiguration; import com.azure.resourcemanager.appcontainers.models.AppLogsConfiguration; import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; import com.azure.resourcemanager.appcontainers.models.DaprConfiguration; @@ -17,6 +18,9 @@ import com.azure.resourcemanager.appcontainers.models.KedaConfiguration; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerAuthentication; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfiguration; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; +import com.azure.resourcemanager.appcontainers.models.OpenTelemetryConfiguration; +import com.azure.resourcemanager.appcontainers.models.PublicNetworkAccess; import com.azure.resourcemanager.appcontainers.models.VnetConfiguration; import com.azure.resourcemanager.appcontainers.models.WorkloadProfile; import java.io.IOException; @@ -33,6 +37,12 @@ public final class ManagedEnvironmentInner extends Resource { */ private String kind; + /* + * Managed identities for the Managed Environment to interact with other Azure services without maintaining any + * secrets or credentials in code. + */ + private ManagedServiceIdentity identity; + /* * Managed environment resource specific properties */ @@ -44,9 +54,9 @@ public final class ManagedEnvironmentInner extends Resource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -54,9 +64,9 @@ public final class ManagedEnvironmentInner extends Resource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of ManagedEnvironmentInner class. @@ -84,6 +94,28 @@ public ManagedEnvironmentInner withKind(String kind) { return this; } + /** + * Get the identity property: Managed identities for the Managed Environment to interact with other Azure services + * without maintaining any secrets or credentials in code. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed identities for the Managed Environment to interact with other Azure services + * without maintaining any secrets or credentials in code. + * + * @param identity the identity value to set. + * @return the ManagedEnvironmentInner object itself. + */ + public ManagedEnvironmentInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + /** * Get the innerProperties property: Managed environment resource specific properties. * @@ -103,13 +135,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -123,13 +155,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** @@ -286,6 +318,53 @@ public ManagedEnvironmentInner withAppLogsConfiguration(AppLogsConfiguration app return this; } + /** + * Get the appInsightsConfiguration property: Environment level Application Insights configuration. + * + * @return the appInsightsConfiguration value. + */ + public AppInsightsConfiguration appInsightsConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().appInsightsConfiguration(); + } + + /** + * Set the appInsightsConfiguration property: Environment level Application Insights configuration. + * + * @param appInsightsConfiguration the appInsightsConfiguration value to set. + * @return the ManagedEnvironmentInner object itself. + */ + public ManagedEnvironmentInner withAppInsightsConfiguration(AppInsightsConfiguration appInsightsConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedEnvironmentProperties(); + } + this.innerProperties().withAppInsightsConfiguration(appInsightsConfiguration); + return this; + } + + /** + * Get the openTelemetryConfiguration property: Environment Open Telemetry configuration. + * + * @return the openTelemetryConfiguration value. + */ + public OpenTelemetryConfiguration openTelemetryConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().openTelemetryConfiguration(); + } + + /** + * Set the openTelemetryConfiguration property: Environment Open Telemetry configuration. + * + * @param openTelemetryConfiguration the openTelemetryConfiguration value to set. + * @return the ManagedEnvironmentInner object itself. + */ + public ManagedEnvironmentInner + withOpenTelemetryConfiguration(OpenTelemetryConfiguration openTelemetryConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedEnvironmentProperties(); + } + this.innerProperties().withOpenTelemetryConfiguration(openTelemetryConfiguration); + return this; + } + /** * Get the zoneRedundant property: Whether or not this Managed Environment is zone-redundant. * @@ -485,12 +564,49 @@ public ManagedEnvironmentPropertiesPeerTrafficConfiguration peerTrafficConfigura return this; } + /** + * Get the privateEndpointConnections property: Private endpoint connections to the resource. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + + /** + * Get the publicNetworkAccess property: Property to allow or block all public traffic. Allowed Values: 'Enabled', + * 'Disabled'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Property to allow or block all public traffic. Allowed Values: 'Enabled', + * 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the ManagedEnvironmentInner object itself. + */ + public ManagedEnvironmentInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedEnvironmentProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (identity() != null) { + identity().validate(); + } if (innerProperties() != null) { innerProperties().validate(); } @@ -505,6 +621,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeJsonField("identity", this.identity); jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -538,6 +655,8 @@ public static ManagedEnvironmentInner fromJson(JsonReader jsonReader) throws IOE deserializedManagedEnvironmentInner.withTags(tags); } else if ("kind".equals(fieldName)) { deserializedManagedEnvironmentInner.kind = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedManagedEnvironmentInner.identity = ManagedServiceIdentity.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedManagedEnvironmentInner.innerProperties = ManagedEnvironmentProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentProperties.java index ce008bce77582..a2f8451b0f7f4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentProperties.java @@ -9,6 +9,7 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.AppInsightsConfiguration; import com.azure.resourcemanager.appcontainers.models.AppLogsConfiguration; import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; import com.azure.resourcemanager.appcontainers.models.DaprConfiguration; @@ -16,6 +17,8 @@ import com.azure.resourcemanager.appcontainers.models.KedaConfiguration; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerAuthentication; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfiguration; +import com.azure.resourcemanager.appcontainers.models.OpenTelemetryConfiguration; +import com.azure.resourcemanager.appcontainers.models.PublicNetworkAccess; import com.azure.resourcemanager.appcontainers.models.VnetConfiguration; import com.azure.resourcemanager.appcontainers.models.WorkloadProfile; import java.io.IOException; @@ -68,6 +71,16 @@ public final class ManagedEnvironmentProperties implements JsonSerializable privateEndpointConnections; + + /* + * Property to allow or block all public traffic. Allowed Values: 'Enabled', 'Disabled'. + */ + private PublicNetworkAccess publicNetworkAccess; + /** * Creates an instance of ManagedEnvironmentProperties class. */ @@ -244,6 +267,48 @@ public ManagedEnvironmentProperties withAppLogsConfiguration(AppLogsConfiguratio return this; } + /** + * Get the appInsightsConfiguration property: Environment level Application Insights configuration. + * + * @return the appInsightsConfiguration value. + */ + public AppInsightsConfiguration appInsightsConfiguration() { + return this.appInsightsConfiguration; + } + + /** + * Set the appInsightsConfiguration property: Environment level Application Insights configuration. + * + * @param appInsightsConfiguration the appInsightsConfiguration value to set. + * @return the ManagedEnvironmentProperties object itself. + */ + public ManagedEnvironmentProperties + withAppInsightsConfiguration(AppInsightsConfiguration appInsightsConfiguration) { + this.appInsightsConfiguration = appInsightsConfiguration; + return this; + } + + /** + * Get the openTelemetryConfiguration property: Environment Open Telemetry configuration. + * + * @return the openTelemetryConfiguration value. + */ + public OpenTelemetryConfiguration openTelemetryConfiguration() { + return this.openTelemetryConfiguration; + } + + /** + * Set the openTelemetryConfiguration property: Environment Open Telemetry configuration. + * + * @param openTelemetryConfiguration the openTelemetryConfiguration value to set. + * @return the ManagedEnvironmentProperties object itself. + */ + public ManagedEnvironmentProperties + withOpenTelemetryConfiguration(OpenTelemetryConfiguration openTelemetryConfiguration) { + this.openTelemetryConfiguration = openTelemetryConfiguration; + return this; + } + /** * Get the zoneRedundant property: Whether or not this Managed Environment is zone-redundant. * @@ -420,6 +485,37 @@ public ManagedEnvironmentPropertiesPeerTrafficConfiguration peerTrafficConfigura return this; } + /** + * Get the privateEndpointConnections property: Private endpoint connections to the resource. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the publicNetworkAccess property: Property to allow or block all public traffic. Allowed Values: 'Enabled', + * 'Disabled'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Property to allow or block all public traffic. Allowed Values: 'Enabled', + * 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the ManagedEnvironmentProperties object itself. + */ + public ManagedEnvironmentProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + /** * Validates the instance. * @@ -432,6 +528,12 @@ public void validate() { if (appLogsConfiguration() != null) { appLogsConfiguration().validate(); } + if (appInsightsConfiguration() != null) { + appInsightsConfiguration().validate(); + } + if (openTelemetryConfiguration() != null) { + openTelemetryConfiguration().validate(); + } if (customDomainConfiguration() != null) { customDomainConfiguration().validate(); } @@ -450,6 +552,9 @@ public void validate() { if (peerTrafficConfiguration() != null) { peerTrafficConfiguration().validate(); } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } } /** @@ -462,6 +567,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("daprAIConnectionString", this.daprAIConnectionString); jsonWriter.writeJsonField("vnetConfiguration", this.vnetConfiguration); jsonWriter.writeJsonField("appLogsConfiguration", this.appLogsConfiguration); + jsonWriter.writeJsonField("appInsightsConfiguration", this.appInsightsConfiguration); + jsonWriter.writeJsonField("openTelemetryConfiguration", this.openTelemetryConfiguration); jsonWriter.writeBooleanField("zoneRedundant", this.zoneRedundant); jsonWriter.writeJsonField("customDomainConfiguration", this.customDomainConfiguration); jsonWriter.writeArrayField("workloadProfiles", this.workloadProfiles, @@ -471,6 +578,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("infrastructureResourceGroup", this.infrastructureResourceGroup); jsonWriter.writeJsonField("peerAuthentication", this.peerAuthentication); jsonWriter.writeJsonField("peerTrafficConfiguration", this.peerTrafficConfiguration); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); return jsonWriter.writeEndObject(); } @@ -507,6 +616,12 @@ public static ManagedEnvironmentProperties fromJson(JsonReader jsonReader) throw } else if ("appLogsConfiguration".equals(fieldName)) { deserializedManagedEnvironmentProperties.appLogsConfiguration = AppLogsConfiguration.fromJson(reader); + } else if ("appInsightsConfiguration".equals(fieldName)) { + deserializedManagedEnvironmentProperties.appInsightsConfiguration + = AppInsightsConfiguration.fromJson(reader); + } else if ("openTelemetryConfiguration".equals(fieldName)) { + deserializedManagedEnvironmentProperties.openTelemetryConfiguration + = OpenTelemetryConfiguration.fromJson(reader); } else if ("zoneRedundant".equals(fieldName)) { deserializedManagedEnvironmentProperties.zoneRedundant = reader.getNullable(JsonReader::getBoolean); } else if ("customDomainConfiguration".equals(fieldName)) { @@ -530,6 +645,13 @@ public static ManagedEnvironmentProperties fromJson(JsonReader jsonReader) throw } else if ("peerTrafficConfiguration".equals(fieldName)) { deserializedManagedEnvironmentProperties.peerTrafficConfiguration = ManagedEnvironmentPropertiesPeerTrafficConfiguration.fromJson(reader); + } else if ("privateEndpointConnections".equals(fieldName)) { + List privateEndpointConnections + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedManagedEnvironmentProperties.privateEndpointConnections = privateEndpointConnections; + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedManagedEnvironmentProperties.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentStorageInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentStorageInner.java index 0dae489da5c73..47955d01bdbf7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentStorageInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentStorageInner.java @@ -29,9 +29,9 @@ public final class ManagedEnvironmentStorageInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -39,9 +39,9 @@ public final class ManagedEnvironmentStorageInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of ManagedEnvironmentStorageInner class. @@ -79,13 +79,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -99,13 +99,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateEndpointConnectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..31fb3366ed038 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpoint; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.appcontainers.models.PrivateLinkServiceConnectionState; +import java.io.IOException; +import java.util.List; + +/** + * The Private Endpoint Connection resource. + */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * Resource properties. + */ + private PrivateEndpointConnectionProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of PrivateEndpointConnectionInner class. + */ + public PrivateEndpointConnectionInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.innerProperties() == null ? null : this.innerProperties().groupIds(); + } + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: The resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionInner. + */ + public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionInner deserializedPrivateEndpointConnectionInner + = new PrivateEndpointConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.innerProperties + = PrivateEndpointConnectionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..6ccaf7bee3894 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpoint; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.appcontainers.models.PrivateLinkServiceConnectionState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the private endpoint connection. + */ +@Fluent +public final class PrivateEndpointConnectionProperties + implements JsonSerializable { + /* + * The group ids for the private endpoint resource. + */ + private List groupIds; + + /* + * The resource of private end point. + */ + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between service consumer and provider. + */ + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Creates an instance of PrivateEndpointConnectionProperties class. + */ + public PrivateEndpointConnectionProperties() { + } + + /** + * Get the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model PrivateEndpointConnectionProperties")); + } else { + privateLinkServiceConnectionState().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionProperties. + */ + public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionProperties deserializedPrivateEndpointConnectionProperties + = new PrivateEndpointConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState + = PrivateLinkServiceConnectionState.fromJson(reader); + } else if ("groupIds".equals(fieldName)) { + List groupIds = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateEndpointConnectionProperties.groupIds = groupIds; + } else if ("privateEndpoint".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateEndpoint = PrivateEndpoint.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.provisioningState + = PrivateEndpointConnectionProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateLinkResourceInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 0000000000000..279169e080d75 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A private link resource. + */ +@Fluent +public final class PrivateLinkResourceInner extends ProxyResource { + /* + * Resource properties. + */ + private PrivateLinkResourceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of PrivateLinkResourceInner class. + */ + public PrivateLinkResourceInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); + } + + /** + * Get the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); + } + + /** + * Set the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateLinkResourceInner. + */ + public static PrivateLinkResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceInner deserializedPrivateLinkResourceInner = new PrivateLinkResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateLinkResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateLinkResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateLinkResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateLinkResourceInner.innerProperties + = PrivateLinkResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateLinkResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateLinkResourceProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 0000000000000..f47ea4ff34d99 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/PrivateLinkResourceProperties.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of a private link resource. + */ +@Fluent +public final class PrivateLinkResourceProperties implements JsonSerializable { + /* + * The private link resource group id. + */ + private String groupId; + + /* + * The private link resource required member names. + */ + private List requiredMembers; + + /* + * The private link resource private link DNS zone name. + */ + private List requiredZoneNames; + + /** + * Creates an instance of PrivateLinkResourceProperties class. + */ + public PrivateLinkResourceProperties() { + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("requiredZoneNames", this.requiredZoneNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourceProperties. + */ + public static PrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceProperties deserializedPrivateLinkResourceProperties + = new PrivateLinkResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + deserializedPrivateLinkResourceProperties.groupId = reader.getString(); + } else if ("requiredMembers".equals(fieldName)) { + List requiredMembers = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredMembers = requiredMembers; + } else if ("requiredZoneNames".equals(fieldName)) { + List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaInner.java index 0a708c8a44862..883cb069be6f1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaInner.java @@ -32,9 +32,9 @@ public final class ReplicaInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -42,9 +42,9 @@ public final class ReplicaInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of ReplicaInner class. @@ -71,13 +71,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -91,13 +91,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/RevisionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/RevisionInner.java index 08adff0bb444f..7e1d14ba2e140 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/RevisionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/RevisionInner.java @@ -33,9 +33,9 @@ public final class RevisionInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -43,9 +43,9 @@ public final class RevisionInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of RevisionInner class. @@ -72,13 +72,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -92,13 +92,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SessionPoolInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SessionPoolInner.java new file mode 100644 index 0000000000000..a75e266bb165c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SessionPoolInner.java @@ -0,0 +1,402 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.ContainerType; +import com.azure.resourcemanager.appcontainers.models.CustomContainerTemplate; +import com.azure.resourcemanager.appcontainers.models.DynamicPoolConfiguration; +import com.azure.resourcemanager.appcontainers.models.PoolManagementType; +import com.azure.resourcemanager.appcontainers.models.ScaleConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionNetworkConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionPoolProvisioningState; +import com.azure.resourcemanager.appcontainers.models.SessionPoolSecret; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Container App session pool. + */ +@Fluent +public final class SessionPoolInner extends Resource { + /* + * Container App session pool resource specific properties + */ + private SessionPoolProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SessionPoolInner class. + */ + public SessionPoolInner() { + } + + /** + * Get the innerProperties property: Container App session pool resource specific properties. + * + * @return the innerProperties value. + */ + private SessionPoolProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public SessionPoolInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SessionPoolInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the environmentId property: Resource ID of the session pool's environment. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.innerProperties() == null ? null : this.innerProperties().environmentId(); + } + + /** + * Set the environmentId property: Resource ID of the session pool's environment. + * + * @param environmentId the environmentId value to set. + * @return the SessionPoolInner object itself. + */ + public SessionPoolInner withEnvironmentId(String environmentId) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolProperties(); + } + this.innerProperties().withEnvironmentId(environmentId); + return this; + } + + /** + * Get the containerType property: The container type of the sessions. + * + * @return the containerType value. + */ + public ContainerType containerType() { + return this.innerProperties() == null ? null : this.innerProperties().containerType(); + } + + /** + * Set the containerType property: The container type of the sessions. + * + * @param containerType the containerType value to set. + * @return the SessionPoolInner object itself. + */ + public SessionPoolInner withContainerType(ContainerType containerType) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolProperties(); + } + this.innerProperties().withContainerType(containerType); + return this; + } + + /** + * Get the poolManagementType property: The pool management type of the session pool. + * + * @return the poolManagementType value. + */ + public PoolManagementType poolManagementType() { + return this.innerProperties() == null ? null : this.innerProperties().poolManagementType(); + } + + /** + * Set the poolManagementType property: The pool management type of the session pool. + * + * @param poolManagementType the poolManagementType value to set. + * @return the SessionPoolInner object itself. + */ + public SessionPoolInner withPoolManagementType(PoolManagementType poolManagementType) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolProperties(); + } + this.innerProperties().withPoolManagementType(poolManagementType); + return this; + } + + /** + * Get the nodeCount property: The number of nodes the session pool is using. + * + * @return the nodeCount value. + */ + public Integer nodeCount() { + return this.innerProperties() == null ? null : this.innerProperties().nodeCount(); + } + + /** + * Get the scaleConfiguration property: The scale configuration of the session pool. + * + * @return the scaleConfiguration value. + */ + public ScaleConfiguration scaleConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().scaleConfiguration(); + } + + /** + * Set the scaleConfiguration property: The scale configuration of the session pool. + * + * @param scaleConfiguration the scaleConfiguration value to set. + * @return the SessionPoolInner object itself. + */ + public SessionPoolInner withScaleConfiguration(ScaleConfiguration scaleConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolProperties(); + } + this.innerProperties().withScaleConfiguration(scaleConfiguration); + return this; + } + + /** + * Get the secrets property: The secrets of the session pool. + * + * @return the secrets value. + */ + public List secrets() { + return this.innerProperties() == null ? null : this.innerProperties().secrets(); + } + + /** + * Set the secrets property: The secrets of the session pool. + * + * @param secrets the secrets value to set. + * @return the SessionPoolInner object itself. + */ + public SessionPoolInner withSecrets(List secrets) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolProperties(); + } + this.innerProperties().withSecrets(secrets); + return this; + } + + /** + * Get the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is dynamic. + * + * @return the dynamicPoolConfiguration value. + */ + public DynamicPoolConfiguration dynamicPoolConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().dynamicPoolConfiguration(); + } + + /** + * Set the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is dynamic. + * + * @param dynamicPoolConfiguration the dynamicPoolConfiguration value to set. + * @return the SessionPoolInner object itself. + */ + public SessionPoolInner withDynamicPoolConfiguration(DynamicPoolConfiguration dynamicPoolConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolProperties(); + } + this.innerProperties().withDynamicPoolConfiguration(dynamicPoolConfiguration); + return this; + } + + /** + * Get the customContainerTemplate property: The custom container configuration if the containerType is + * CustomContainer. + * + * @return the customContainerTemplate value. + */ + public CustomContainerTemplate customContainerTemplate() { + return this.innerProperties() == null ? null : this.innerProperties().customContainerTemplate(); + } + + /** + * Set the customContainerTemplate property: The custom container configuration if the containerType is + * CustomContainer. + * + * @param customContainerTemplate the customContainerTemplate value to set. + * @return the SessionPoolInner object itself. + */ + public SessionPoolInner withCustomContainerTemplate(CustomContainerTemplate customContainerTemplate) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolProperties(); + } + this.innerProperties().withCustomContainerTemplate(customContainerTemplate); + return this; + } + + /** + * Get the sessionNetworkConfiguration property: The network configuration of the sessions in the session pool. + * + * @return the sessionNetworkConfiguration value. + */ + public SessionNetworkConfiguration sessionNetworkConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().sessionNetworkConfiguration(); + } + + /** + * Set the sessionNetworkConfiguration property: The network configuration of the sessions in the session pool. + * + * @param sessionNetworkConfiguration the sessionNetworkConfiguration value to set. + * @return the SessionPoolInner object itself. + */ + public SessionPoolInner withSessionNetworkConfiguration(SessionNetworkConfiguration sessionNetworkConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolProperties(); + } + this.innerProperties().withSessionNetworkConfiguration(sessionNetworkConfiguration); + return this; + } + + /** + * Get the poolManagementEndpoint property: The endpoint to manage the pool. + * + * @return the poolManagementEndpoint value. + */ + public String poolManagementEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().poolManagementEndpoint(); + } + + /** + * Get the provisioningState property: Provisioning state of the session pool. + * + * @return the provisioningState value. + */ + public SessionPoolProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionPoolInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionPoolInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SessionPoolInner. + */ + public static SessionPoolInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionPoolInner deserializedSessionPoolInner = new SessionPoolInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSessionPoolInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSessionPoolInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSessionPoolInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSessionPoolInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSessionPoolInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSessionPoolInner.innerProperties = SessionPoolProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSessionPoolInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionPoolInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SessionPoolProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SessionPoolProperties.java new file mode 100644 index 0000000000000..02214a703a37b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SessionPoolProperties.java @@ -0,0 +1,371 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.ContainerType; +import com.azure.resourcemanager.appcontainers.models.CustomContainerTemplate; +import com.azure.resourcemanager.appcontainers.models.DynamicPoolConfiguration; +import com.azure.resourcemanager.appcontainers.models.PoolManagementType; +import com.azure.resourcemanager.appcontainers.models.ScaleConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionNetworkConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionPoolProvisioningState; +import com.azure.resourcemanager.appcontainers.models.SessionPoolSecret; +import java.io.IOException; +import java.util.List; + +/** + * Container App session pool resource specific properties. + */ +@Fluent +public final class SessionPoolProperties implements JsonSerializable { + /* + * Resource ID of the session pool's environment. + */ + private String environmentId; + + /* + * The container type of the sessions. + */ + private ContainerType containerType; + + /* + * The pool management type of the session pool. + */ + private PoolManagementType poolManagementType; + + /* + * The number of nodes the session pool is using. + */ + private Integer nodeCount; + + /* + * The scale configuration of the session pool. + */ + private ScaleConfiguration scaleConfiguration; + + /* + * The secrets of the session pool. + */ + private List secrets; + + /* + * The pool configuration if the poolManagementType is dynamic. + */ + private DynamicPoolConfiguration dynamicPoolConfiguration; + + /* + * The custom container configuration if the containerType is CustomContainer. + */ + private CustomContainerTemplate customContainerTemplate; + + /* + * The network configuration of the sessions in the session pool. + */ + private SessionNetworkConfiguration sessionNetworkConfiguration; + + /* + * The endpoint to manage the pool. + */ + private String poolManagementEndpoint; + + /* + * Provisioning state of the session pool. + */ + private SessionPoolProvisioningState provisioningState; + + /** + * Creates an instance of SessionPoolProperties class. + */ + public SessionPoolProperties() { + } + + /** + * Get the environmentId property: Resource ID of the session pool's environment. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set the environmentId property: Resource ID of the session pool's environment. + * + * @param environmentId the environmentId value to set. + * @return the SessionPoolProperties object itself. + */ + public SessionPoolProperties withEnvironmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Get the containerType property: The container type of the sessions. + * + * @return the containerType value. + */ + public ContainerType containerType() { + return this.containerType; + } + + /** + * Set the containerType property: The container type of the sessions. + * + * @param containerType the containerType value to set. + * @return the SessionPoolProperties object itself. + */ + public SessionPoolProperties withContainerType(ContainerType containerType) { + this.containerType = containerType; + return this; + } + + /** + * Get the poolManagementType property: The pool management type of the session pool. + * + * @return the poolManagementType value. + */ + public PoolManagementType poolManagementType() { + return this.poolManagementType; + } + + /** + * Set the poolManagementType property: The pool management type of the session pool. + * + * @param poolManagementType the poolManagementType value to set. + * @return the SessionPoolProperties object itself. + */ + public SessionPoolProperties withPoolManagementType(PoolManagementType poolManagementType) { + this.poolManagementType = poolManagementType; + return this; + } + + /** + * Get the nodeCount property: The number of nodes the session pool is using. + * + * @return the nodeCount value. + */ + public Integer nodeCount() { + return this.nodeCount; + } + + /** + * Get the scaleConfiguration property: The scale configuration of the session pool. + * + * @return the scaleConfiguration value. + */ + public ScaleConfiguration scaleConfiguration() { + return this.scaleConfiguration; + } + + /** + * Set the scaleConfiguration property: The scale configuration of the session pool. + * + * @param scaleConfiguration the scaleConfiguration value to set. + * @return the SessionPoolProperties object itself. + */ + public SessionPoolProperties withScaleConfiguration(ScaleConfiguration scaleConfiguration) { + this.scaleConfiguration = scaleConfiguration; + return this; + } + + /** + * Get the secrets property: The secrets of the session pool. + * + * @return the secrets value. + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets property: The secrets of the session pool. + * + * @param secrets the secrets value to set. + * @return the SessionPoolProperties object itself. + */ + public SessionPoolProperties withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + + /** + * Get the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is dynamic. + * + * @return the dynamicPoolConfiguration value. + */ + public DynamicPoolConfiguration dynamicPoolConfiguration() { + return this.dynamicPoolConfiguration; + } + + /** + * Set the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is dynamic. + * + * @param dynamicPoolConfiguration the dynamicPoolConfiguration value to set. + * @return the SessionPoolProperties object itself. + */ + public SessionPoolProperties withDynamicPoolConfiguration(DynamicPoolConfiguration dynamicPoolConfiguration) { + this.dynamicPoolConfiguration = dynamicPoolConfiguration; + return this; + } + + /** + * Get the customContainerTemplate property: The custom container configuration if the containerType is + * CustomContainer. + * + * @return the customContainerTemplate value. + */ + public CustomContainerTemplate customContainerTemplate() { + return this.customContainerTemplate; + } + + /** + * Set the customContainerTemplate property: The custom container configuration if the containerType is + * CustomContainer. + * + * @param customContainerTemplate the customContainerTemplate value to set. + * @return the SessionPoolProperties object itself. + */ + public SessionPoolProperties withCustomContainerTemplate(CustomContainerTemplate customContainerTemplate) { + this.customContainerTemplate = customContainerTemplate; + return this; + } + + /** + * Get the sessionNetworkConfiguration property: The network configuration of the sessions in the session pool. + * + * @return the sessionNetworkConfiguration value. + */ + public SessionNetworkConfiguration sessionNetworkConfiguration() { + return this.sessionNetworkConfiguration; + } + + /** + * Set the sessionNetworkConfiguration property: The network configuration of the sessions in the session pool. + * + * @param sessionNetworkConfiguration the sessionNetworkConfiguration value to set. + * @return the SessionPoolProperties object itself. + */ + public SessionPoolProperties + withSessionNetworkConfiguration(SessionNetworkConfiguration sessionNetworkConfiguration) { + this.sessionNetworkConfiguration = sessionNetworkConfiguration; + return this; + } + + /** + * Get the poolManagementEndpoint property: The endpoint to manage the pool. + * + * @return the poolManagementEndpoint value. + */ + public String poolManagementEndpoint() { + return this.poolManagementEndpoint; + } + + /** + * Get the provisioningState property: Provisioning state of the session pool. + * + * @return the provisioningState value. + */ + public SessionPoolProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scaleConfiguration() != null) { + scaleConfiguration().validate(); + } + if (secrets() != null) { + secrets().forEach(e -> e.validate()); + } + if (dynamicPoolConfiguration() != null) { + dynamicPoolConfiguration().validate(); + } + if (customContainerTemplate() != null) { + customContainerTemplate().validate(); + } + if (sessionNetworkConfiguration() != null) { + sessionNetworkConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("environmentId", this.environmentId); + jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString()); + jsonWriter.writeStringField("poolManagementType", + this.poolManagementType == null ? null : this.poolManagementType.toString()); + jsonWriter.writeJsonField("scaleConfiguration", this.scaleConfiguration); + jsonWriter.writeArrayField("secrets", this.secrets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("dynamicPoolConfiguration", this.dynamicPoolConfiguration); + jsonWriter.writeJsonField("customContainerTemplate", this.customContainerTemplate); + jsonWriter.writeJsonField("sessionNetworkConfiguration", this.sessionNetworkConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionPoolProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionPoolProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionPoolProperties. + */ + public static SessionPoolProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionPoolProperties deserializedSessionPoolProperties = new SessionPoolProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("environmentId".equals(fieldName)) { + deserializedSessionPoolProperties.environmentId = reader.getString(); + } else if ("containerType".equals(fieldName)) { + deserializedSessionPoolProperties.containerType = ContainerType.fromString(reader.getString()); + } else if ("poolManagementType".equals(fieldName)) { + deserializedSessionPoolProperties.poolManagementType + = PoolManagementType.fromString(reader.getString()); + } else if ("nodeCount".equals(fieldName)) { + deserializedSessionPoolProperties.nodeCount = reader.getNullable(JsonReader::getInt); + } else if ("scaleConfiguration".equals(fieldName)) { + deserializedSessionPoolProperties.scaleConfiguration = ScaleConfiguration.fromJson(reader); + } else if ("secrets".equals(fieldName)) { + List secrets = reader.readArray(reader1 -> SessionPoolSecret.fromJson(reader1)); + deserializedSessionPoolProperties.secrets = secrets; + } else if ("dynamicPoolConfiguration".equals(fieldName)) { + deserializedSessionPoolProperties.dynamicPoolConfiguration + = DynamicPoolConfiguration.fromJson(reader); + } else if ("customContainerTemplate".equals(fieldName)) { + deserializedSessionPoolProperties.customContainerTemplate + = CustomContainerTemplate.fromJson(reader); + } else if ("sessionNetworkConfiguration".equals(fieldName)) { + deserializedSessionPoolProperties.sessionNetworkConfiguration + = SessionNetworkConfiguration.fromJson(reader); + } else if ("poolManagementEndpoint".equals(fieldName)) { + deserializedSessionPoolProperties.poolManagementEndpoint = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedSessionPoolProperties.provisioningState + = SessionPoolProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionPoolProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SessionPoolUpdatablePropertiesProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SessionPoolUpdatablePropertiesProperties.java new file mode 100644 index 0000000000000..d826fa30dd3e7 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SessionPoolUpdatablePropertiesProperties.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.CustomContainerTemplate; +import com.azure.resourcemanager.appcontainers.models.DynamicPoolConfiguration; +import com.azure.resourcemanager.appcontainers.models.ScaleConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionNetworkConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionPoolSecret; +import java.io.IOException; +import java.util.List; + +/** + * Session pool resource specific updatable properties. + */ +@Fluent +public final class SessionPoolUpdatablePropertiesProperties + implements JsonSerializable { + /* + * The scale configuration of the session pool. + */ + private ScaleConfiguration scaleConfiguration; + + /* + * The secrets of the session pool. + */ + private List secrets; + + /* + * The pool configuration if the poolManagementType is dynamic. + */ + private DynamicPoolConfiguration dynamicPoolConfiguration; + + /* + * The custom container configuration if the containerType is CustomContainer. + */ + private CustomContainerTemplate customContainerTemplate; + + /* + * The network configuration of the sessions in the session pool. + */ + private SessionNetworkConfiguration sessionNetworkConfiguration; + + /** + * Creates an instance of SessionPoolUpdatablePropertiesProperties class. + */ + public SessionPoolUpdatablePropertiesProperties() { + } + + /** + * Get the scaleConfiguration property: The scale configuration of the session pool. + * + * @return the scaleConfiguration value. + */ + public ScaleConfiguration scaleConfiguration() { + return this.scaleConfiguration; + } + + /** + * Set the scaleConfiguration property: The scale configuration of the session pool. + * + * @param scaleConfiguration the scaleConfiguration value to set. + * @return the SessionPoolUpdatablePropertiesProperties object itself. + */ + public SessionPoolUpdatablePropertiesProperties withScaleConfiguration(ScaleConfiguration scaleConfiguration) { + this.scaleConfiguration = scaleConfiguration; + return this; + } + + /** + * Get the secrets property: The secrets of the session pool. + * + * @return the secrets value. + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets property: The secrets of the session pool. + * + * @param secrets the secrets value to set. + * @return the SessionPoolUpdatablePropertiesProperties object itself. + */ + public SessionPoolUpdatablePropertiesProperties withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + + /** + * Get the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is dynamic. + * + * @return the dynamicPoolConfiguration value. + */ + public DynamicPoolConfiguration dynamicPoolConfiguration() { + return this.dynamicPoolConfiguration; + } + + /** + * Set the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is dynamic. + * + * @param dynamicPoolConfiguration the dynamicPoolConfiguration value to set. + * @return the SessionPoolUpdatablePropertiesProperties object itself. + */ + public SessionPoolUpdatablePropertiesProperties + withDynamicPoolConfiguration(DynamicPoolConfiguration dynamicPoolConfiguration) { + this.dynamicPoolConfiguration = dynamicPoolConfiguration; + return this; + } + + /** + * Get the customContainerTemplate property: The custom container configuration if the containerType is + * CustomContainer. + * + * @return the customContainerTemplate value. + */ + public CustomContainerTemplate customContainerTemplate() { + return this.customContainerTemplate; + } + + /** + * Set the customContainerTemplate property: The custom container configuration if the containerType is + * CustomContainer. + * + * @param customContainerTemplate the customContainerTemplate value to set. + * @return the SessionPoolUpdatablePropertiesProperties object itself. + */ + public SessionPoolUpdatablePropertiesProperties + withCustomContainerTemplate(CustomContainerTemplate customContainerTemplate) { + this.customContainerTemplate = customContainerTemplate; + return this; + } + + /** + * Get the sessionNetworkConfiguration property: The network configuration of the sessions in the session pool. + * + * @return the sessionNetworkConfiguration value. + */ + public SessionNetworkConfiguration sessionNetworkConfiguration() { + return this.sessionNetworkConfiguration; + } + + /** + * Set the sessionNetworkConfiguration property: The network configuration of the sessions in the session pool. + * + * @param sessionNetworkConfiguration the sessionNetworkConfiguration value to set. + * @return the SessionPoolUpdatablePropertiesProperties object itself. + */ + public SessionPoolUpdatablePropertiesProperties + withSessionNetworkConfiguration(SessionNetworkConfiguration sessionNetworkConfiguration) { + this.sessionNetworkConfiguration = sessionNetworkConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scaleConfiguration() != null) { + scaleConfiguration().validate(); + } + if (secrets() != null) { + secrets().forEach(e -> e.validate()); + } + if (dynamicPoolConfiguration() != null) { + dynamicPoolConfiguration().validate(); + } + if (customContainerTemplate() != null) { + customContainerTemplate().validate(); + } + if (sessionNetworkConfiguration() != null) { + sessionNetworkConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("scaleConfiguration", this.scaleConfiguration); + jsonWriter.writeArrayField("secrets", this.secrets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("dynamicPoolConfiguration", this.dynamicPoolConfiguration); + jsonWriter.writeJsonField("customContainerTemplate", this.customContainerTemplate); + jsonWriter.writeJsonField("sessionNetworkConfiguration", this.sessionNetworkConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionPoolUpdatablePropertiesProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionPoolUpdatablePropertiesProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionPoolUpdatablePropertiesProperties. + */ + public static SessionPoolUpdatablePropertiesProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionPoolUpdatablePropertiesProperties deserializedSessionPoolUpdatablePropertiesProperties + = new SessionPoolUpdatablePropertiesProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scaleConfiguration".equals(fieldName)) { + deserializedSessionPoolUpdatablePropertiesProperties.scaleConfiguration + = ScaleConfiguration.fromJson(reader); + } else if ("secrets".equals(fieldName)) { + List secrets = reader.readArray(reader1 -> SessionPoolSecret.fromJson(reader1)); + deserializedSessionPoolUpdatablePropertiesProperties.secrets = secrets; + } else if ("dynamicPoolConfiguration".equals(fieldName)) { + deserializedSessionPoolUpdatablePropertiesProperties.dynamicPoolConfiguration + = DynamicPoolConfiguration.fromJson(reader); + } else if ("customContainerTemplate".equals(fieldName)) { + deserializedSessionPoolUpdatablePropertiesProperties.customContainerTemplate + = CustomContainerTemplate.fromJson(reader); + } else if ("sessionNetworkConfiguration".equals(fieldName)) { + deserializedSessionPoolUpdatablePropertiesProperties.sessionNetworkConfiguration + = SessionNetworkConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionPoolUpdatablePropertiesProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SourceControlInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SourceControlInner.java index d9898c404ecc4..21c58f99bc1e4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SourceControlInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SourceControlInner.java @@ -30,9 +30,9 @@ public final class SourceControlInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -40,9 +40,9 @@ public final class SourceControlInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of SourceControlInner class. @@ -69,13 +69,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -89,13 +89,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/WorkflowEnvelopeInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/WorkflowEnvelopeInner.java new file mode 100644 index 0000000000000..ed3a7ea4427cb --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/WorkflowEnvelopeInner.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.models.WorkflowEnvelopeProperties; +import java.io.IOException; + +/** + * Workflow properties definition. + */ +@Fluent +public final class WorkflowEnvelopeInner implements JsonSerializable { + /* + * The resource id. + */ + private String id; + + /* + * Gets the resource name. + */ + private String name; + + /* + * Gets the resource type. + */ + private String type; + + /* + * The resource kind. + */ + private String kind; + + /* + * The resource location. + */ + private String location; + + /* + * Additional workflow properties. + */ + private WorkflowEnvelopeProperties properties; + + /** + * Creates an instance of WorkflowEnvelopeInner class. + */ + public WorkflowEnvelopeInner() { + } + + /** + * Get the id property: The resource id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Gets the resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Gets the resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the kind property: The resource kind. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: The resource kind. + * + * @param kind the kind value to set. + * @return the WorkflowEnvelopeInner object itself. + */ + public WorkflowEnvelopeInner withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the location property: The resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The resource location. + * + * @param location the location value to set. + * @return the WorkflowEnvelopeInner object itself. + */ + public WorkflowEnvelopeInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the properties property: Additional workflow properties. + * + * @return the properties value. + */ + public WorkflowEnvelopeProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Additional workflow properties. + * + * @param properties the properties value to set. + * @return the WorkflowEnvelopeInner object itself. + */ + public WorkflowEnvelopeInner withProperties(WorkflowEnvelopeProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkflowEnvelopeInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkflowEnvelopeInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkflowEnvelopeInner. + */ + public static WorkflowEnvelopeInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkflowEnvelopeInner deserializedWorkflowEnvelopeInner = new WorkflowEnvelopeInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWorkflowEnvelopeInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedWorkflowEnvelopeInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWorkflowEnvelopeInner.type = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedWorkflowEnvelopeInner.kind = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedWorkflowEnvelopeInner.location = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedWorkflowEnvelopeInner.properties = WorkflowEnvelopeProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkflowEnvelopeInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/WorkloadProfileStatesInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/WorkloadProfileStatesInner.java index 5fa01e7da57cd..3bbd9fb5cca5d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/WorkloadProfileStatesInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/WorkloadProfileStatesInner.java @@ -29,9 +29,9 @@ public final class WorkloadProfileStatesInner extends ProxyResource { private SystemData systemData; /* - * Fully qualified resource Id for the resource. + * The type of the resource. */ - private String id; + private String type; /* * The name of the resource. @@ -39,9 +39,9 @@ public final class WorkloadProfileStatesInner extends ProxyResource { private String name; /* - * The type of the resource. + * Fully qualified resource Id for the resource. */ - private String type; + private String id; /** * Creates an instance of WorkloadProfileStatesInner class. @@ -79,13 +79,13 @@ public SystemData systemData() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the type property: The type of the resource. * - * @return the id value. + * @return the type value. */ @Override - public String id() { - return this.id; + public String type() { + return this.type; } /** @@ -99,13 +99,13 @@ public String name() { } /** - * Get the type property: The type of the resource. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the type value. + * @return the id value. */ @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/package-info.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/package-info.java index 9ea383c7aad70..f87287ab52d01 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/package-info.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/package-info.java @@ -4,6 +4,8 @@ /** * Package containing the inner data models for ContainerAppsApiClient. - * null. + * Functions is an extension resource to revisions and the api listed is used to proxy the call from Web RP to the + * function app's host process, this api is not exposed to users and only Web RP is allowed to invoke functions + * extension resource. */ package com.azure.resourcemanager.appcontainers.fluent.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/package-info.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/package-info.java index 131b0b619aad3..0eba2fe983f2c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/package-info.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/package-info.java @@ -4,6 +4,8 @@ /** * Package containing the service clients for ContainerAppsApiClient. - * null. + * Functions is an extension resource to revisions and the api listed is used to proxy the call from Web RP to the + * function app's host process, this api is not exposed to users and only Web RP is allowed to invoke functions + * extension resource. */ package com.azure.resourcemanager.appcontainers.fluent; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AppResilienciesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AppResilienciesClientImpl.java new file mode 100644 index 0000000000000..e117050a35fbc --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AppResilienciesClientImpl.java @@ -0,0 +1,926 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.appcontainers.fluent.AppResilienciesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.AppResiliencyInner; +import com.azure.resourcemanager.appcontainers.models.AppResiliencyCollection; +import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AppResilienciesClient. + */ +public final class AppResilienciesClientImpl implements AppResilienciesClient { + /** + * The proxy service used to perform REST calls. + */ + private final AppResilienciesService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of AppResilienciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AppResilienciesClientImpl(ContainerAppsApiClientImpl client) { + this.service + = RestProxy.create(AppResilienciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientAppResiliencies to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface AppResilienciesService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("appName") String appName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AppResiliencyInner resiliencyEnvelope, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("appName") String appName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AppResiliencyInner resiliencyEnvelope, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("appName") String appName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("appName") String appName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("appName") String appName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Create or update an application's resiliency policy. + * + * Create or update container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param resiliencyEnvelope The resiliency policy to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration to setup App Resiliency along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String appName, + String name, AppResiliencyInner resiliencyEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resiliencyEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter resiliencyEnvelope is required and cannot be null.")); + } else { + resiliencyEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, appName, name, this.client.getApiVersion(), resiliencyEnvelope, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update an application's resiliency policy. + * + * Create or update container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param resiliencyEnvelope The resiliency policy to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration to setup App Resiliency along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String appName, + String name, AppResiliencyInner resiliencyEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resiliencyEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter resiliencyEnvelope is required and cannot be null.")); + } else { + resiliencyEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + appName, name, this.client.getApiVersion(), resiliencyEnvelope, accept, context); + } + + /** + * Create or update an application's resiliency policy. + * + * Create or update container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param resiliencyEnvelope The resiliency policy to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration to setup App Resiliency on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String appName, String name, + AppResiliencyInner resiliencyEnvelope) { + return createOrUpdateWithResponseAsync(resourceGroupName, appName, name, resiliencyEnvelope) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update an application's resiliency policy. + * + * Create or update container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param resiliencyEnvelope The resiliency policy to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration to setup App Resiliency along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String appName, + String name, AppResiliencyInner resiliencyEnvelope, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, appName, name, resiliencyEnvelope, context).block(); + } + + /** + * Create or update an application's resiliency policy. + * + * Create or update container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param resiliencyEnvelope The resiliency policy to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration to setup App Resiliency. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResiliencyInner createOrUpdate(String resourceGroupName, String appName, String name, + AppResiliencyInner resiliencyEnvelope) { + return createOrUpdateWithResponse(resourceGroupName, appName, name, resiliencyEnvelope, Context.NONE) + .getValue(); + } + + /** + * Update an application's resiliency policy. + * + * Update container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param resiliencyEnvelope The resiliency policy to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration to setup App Resiliency along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String appName, + String name, AppResiliencyInner resiliencyEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resiliencyEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter resiliencyEnvelope is required and cannot be null.")); + } else { + resiliencyEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, appName, name, this.client.getApiVersion(), resiliencyEnvelope, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an application's resiliency policy. + * + * Update container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param resiliencyEnvelope The resiliency policy to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration to setup App Resiliency along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String appName, + String name, AppResiliencyInner resiliencyEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resiliencyEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter resiliencyEnvelope is required and cannot be null.")); + } else { + resiliencyEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, appName, + name, this.client.getApiVersion(), resiliencyEnvelope, accept, context); + } + + /** + * Update an application's resiliency policy. + * + * Update container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param resiliencyEnvelope The resiliency policy to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration to setup App Resiliency on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String appName, String name, + AppResiliencyInner resiliencyEnvelope) { + return updateWithResponseAsync(resourceGroupName, appName, name, resiliencyEnvelope) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update an application's resiliency policy. + * + * Update container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param resiliencyEnvelope The resiliency policy to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration to setup App Resiliency along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String appName, String name, + AppResiliencyInner resiliencyEnvelope, Context context) { + return updateWithResponseAsync(resourceGroupName, appName, name, resiliencyEnvelope, context).block(); + } + + /** + * Update an application's resiliency policy. + * + * Update container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param resiliencyEnvelope The resiliency policy to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration to setup App Resiliency. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResiliencyInner update(String resourceGroupName, String appName, String name, + AppResiliencyInner resiliencyEnvelope) { + return updateWithResponse(resourceGroupName, appName, name, resiliencyEnvelope, Context.NONE).getValue(); + } + + /** + * Delete an application's resiliency policy. + * + * Delete container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String appName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, appName, name, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an application's resiliency policy. + * + * Delete container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String appName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, appName, + name, this.client.getApiVersion(), accept, context); + } + + /** + * Delete an application's resiliency policy. + * + * Delete container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String appName, String name) { + return deleteWithResponseAsync(resourceGroupName, appName, name).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete an application's resiliency policy. + * + * Delete container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String appName, String name, Context context) { + return deleteWithResponseAsync(resourceGroupName, appName, name, context).block(); + } + + /** + * Delete an application's resiliency policy. + * + * Delete container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String appName, String name) { + deleteWithResponse(resourceGroupName, appName, name, Context.NONE); + } + + /** + * Get an application's resiliency policy. + * + * Get container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container app resiliency policy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String appName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, appName, name, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an application's resiliency policy. + * + * Get container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container app resiliency policy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String appName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, appName, name, + this.client.getApiVersion(), accept, context); + } + + /** + * Get an application's resiliency policy. + * + * Get container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container app resiliency policy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String appName, String name) { + return getWithResponseAsync(resourceGroupName, appName, name).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get an application's resiliency policy. + * + * Get container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container app resiliency policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String appName, String name, + Context context) { + return getWithResponseAsync(resourceGroupName, appName, name, context).block(); + } + + /** + * Get an application's resiliency policy. + * + * Get container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container app resiliency policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResiliencyInner get(String resourceGroupName, String appName, String name) { + return getWithResponse(resourceGroupName, appName, name, Context.NONE).getValue(); + } + + /** + * List an application's resiliency policies. + * + * List container app resiliency policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of AppResiliency policies along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String appName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, appName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List an application's resiliency policies. + * + * List container app resiliency policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of AppResiliency policies along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String appName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, appName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List an application's resiliency policies. + * + * List container app resiliency policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of AppResiliency policies as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String appName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, appName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List an application's resiliency policies. + * + * List container app resiliency policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of AppResiliency policies as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String appName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, appName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List an application's resiliency policies. + * + * List container app resiliency policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of AppResiliency policies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String appName) { + return new PagedIterable<>(listAsync(resourceGroupName, appName)); + } + + /** + * List an application's resiliency policies. + * + * List container app resiliency policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of AppResiliency policies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String appName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, appName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of AppResiliency policies along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of AppResiliency policies along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AppResilienciesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AppResilienciesImpl.java new file mode 100644 index 0000000000000..d1884526629d3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AppResilienciesImpl.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.AppResilienciesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.AppResiliencyInner; +import com.azure.resourcemanager.appcontainers.models.AppResiliencies; +import com.azure.resourcemanager.appcontainers.models.AppResiliency; + +public final class AppResilienciesImpl implements AppResiliencies { + private static final ClientLogger LOGGER = new ClientLogger(AppResilienciesImpl.class); + + private final AppResilienciesClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public AppResilienciesImpl(AppResilienciesClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response deleteWithResponse(String resourceGroupName, String appName, String name, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, appName, name, context); + } + + public void delete(String resourceGroupName, String appName, String name) { + this.serviceClient().delete(resourceGroupName, appName, name); + } + + public Response getWithResponse(String resourceGroupName, String appName, String name, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, appName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AppResiliencyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AppResiliency get(String resourceGroupName, String appName, String name) { + AppResiliencyInner inner = this.serviceClient().get(resourceGroupName, appName, name); + if (inner != null) { + return new AppResiliencyImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String appName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, appName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppResiliencyImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String appName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, appName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppResiliencyImpl(inner1, this.manager())); + } + + public AppResiliency getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String appName = ResourceManagerUtils.getValueFromIdByName(id, "containerApps"); + if (appName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "resiliencyPolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resiliencyPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, appName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String appName = ResourceManagerUtils.getValueFromIdByName(id, "containerApps"); + if (appName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "resiliencyPolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resiliencyPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, appName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String appName = ResourceManagerUtils.getValueFromIdByName(id, "containerApps"); + if (appName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "resiliencyPolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resiliencyPolicies'.", id))); + } + this.deleteWithResponse(resourceGroupName, appName, name, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String appName = ResourceManagerUtils.getValueFromIdByName(id, "containerApps"); + if (appName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "resiliencyPolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resiliencyPolicies'.", id))); + } + return this.deleteWithResponse(resourceGroupName, appName, name, context); + } + + private AppResilienciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public AppResiliencyImpl define(String name) { + return new AppResiliencyImpl(name, this.manager()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AppResiliencyImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AppResiliencyImpl.java new file mode 100644 index 0000000000000..ac7c0ecd7a104 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AppResiliencyImpl.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.AppResiliencyInner; +import com.azure.resourcemanager.appcontainers.models.AppResiliency; +import com.azure.resourcemanager.appcontainers.models.CircuitBreakerPolicy; +import com.azure.resourcemanager.appcontainers.models.HttpConnectionPool; +import com.azure.resourcemanager.appcontainers.models.HttpRetryPolicy; +import com.azure.resourcemanager.appcontainers.models.TcpConnectionPool; +import com.azure.resourcemanager.appcontainers.models.TcpRetryPolicy; +import com.azure.resourcemanager.appcontainers.models.TimeoutPolicy; + +public final class AppResiliencyImpl implements AppResiliency, AppResiliency.Definition, AppResiliency.Update { + private AppResiliencyInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public TimeoutPolicy timeoutPolicy() { + return this.innerModel().timeoutPolicy(); + } + + public HttpRetryPolicy httpRetryPolicy() { + return this.innerModel().httpRetryPolicy(); + } + + public TcpRetryPolicy tcpRetryPolicy() { + return this.innerModel().tcpRetryPolicy(); + } + + public CircuitBreakerPolicy circuitBreakerPolicy() { + return this.innerModel().circuitBreakerPolicy(); + } + + public HttpConnectionPool httpConnectionPool() { + return this.innerModel().httpConnectionPool(); + } + + public TcpConnectionPool tcpConnectionPool() { + return this.innerModel().tcpConnectionPool(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AppResiliencyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String appName; + + private String name; + + public AppResiliencyImpl withExistingContainerApp(String resourceGroupName, String appName) { + this.resourceGroupName = resourceGroupName; + this.appName = appName; + return this; + } + + public AppResiliency create() { + this.innerObject = serviceManager.serviceClient() + .getAppResiliencies() + .createOrUpdateWithResponse(resourceGroupName, appName, name, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public AppResiliency create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAppResiliencies() + .createOrUpdateWithResponse(resourceGroupName, appName, name, this.innerModel(), context) + .getValue(); + return this; + } + + AppResiliencyImpl(String name, com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = new AppResiliencyInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public AppResiliencyImpl update() { + return this; + } + + public AppResiliency apply() { + this.innerObject = serviceManager.serviceClient() + .getAppResiliencies() + .updateWithResponse(resourceGroupName, appName, name, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public AppResiliency apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAppResiliencies() + .updateWithResponse(resourceGroupName, appName, name, this.innerModel(), context) + .getValue(); + return this; + } + + AppResiliencyImpl(AppResiliencyInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.appName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "containerApps"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resiliencyPolicies"); + } + + public AppResiliency refresh() { + this.innerObject = serviceManager.serviceClient() + .getAppResiliencies() + .getWithResponse(resourceGroupName, appName, name, Context.NONE) + .getValue(); + return this; + } + + public AppResiliency refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAppResiliencies() + .getWithResponse(resourceGroupName, appName, name, context) + .getValue(); + return this; + } + + public AppResiliencyImpl withTimeoutPolicy(TimeoutPolicy timeoutPolicy) { + this.innerModel().withTimeoutPolicy(timeoutPolicy); + return this; + } + + public AppResiliencyImpl withHttpRetryPolicy(HttpRetryPolicy httpRetryPolicy) { + this.innerModel().withHttpRetryPolicy(httpRetryPolicy); + return this; + } + + public AppResiliencyImpl withTcpRetryPolicy(TcpRetryPolicy tcpRetryPolicy) { + this.innerModel().withTcpRetryPolicy(tcpRetryPolicy); + return this; + } + + public AppResiliencyImpl withCircuitBreakerPolicy(CircuitBreakerPolicy circuitBreakerPolicy) { + this.innerModel().withCircuitBreakerPolicy(circuitBreakerPolicy); + return this; + } + + public AppResiliencyImpl withHttpConnectionPool(HttpConnectionPool httpConnectionPool) { + this.innerModel().withHttpConnectionPool(httpConnectionPool); + return this; + } + + public AppResiliencyImpl withTcpConnectionPool(TcpConnectionPool tcpConnectionPool) { + this.innerModel().withTcpConnectionPool(tcpConnectionPool); + return this; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildAuthTokensClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildAuthTokensClientImpl.java new file mode 100644 index 0000000000000..c41f96fc70bff --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildAuthTokensClientImpl.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.appcontainers.fluent.BuildAuthTokensClient; +import com.azure.resourcemanager.appcontainers.fluent.models.BuildTokenInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BuildAuthTokensClient. + */ +public final class BuildAuthTokensClientImpl implements BuildAuthTokensClient { + /** + * The proxy service used to perform REST calls. + */ + private final BuildAuthTokensService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of BuildAuthTokensClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BuildAuthTokensClientImpl(ContainerAppsApiClientImpl client) { + this.service + = RestProxy.create(BuildAuthTokensService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientBuildAuthTokens to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface BuildAuthTokensService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName}/listAuthToken") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("builderName") String builderName, + @PathParam("buildName") String buildName, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the token used to connect to the endpoint where source code can be uploaded for a build. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the token used to connect to the endpoint where source code can be uploaded for a build along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, String builderName, + String buildName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, builderName, buildName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the token used to connect to the endpoint where source code can be uploaded for a build. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the token used to connect to the endpoint where source code can be uploaded for a build along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, String builderName, + String buildName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, builderName, buildName, accept, context); + } + + /** + * Gets the token used to connect to the endpoint where source code can be uploaded for a build. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the token used to connect to the endpoint where source code can be uploaded for a build on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String builderName, String buildName) { + return listWithResponseAsync(resourceGroupName, builderName, buildName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the token used to connect to the endpoint where source code can be uploaded for a build. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the token used to connect to the endpoint where source code can be uploaded for a build along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, String builderName, String buildName, + Context context) { + return listWithResponseAsync(resourceGroupName, builderName, buildName, context).block(); + } + + /** + * Gets the token used to connect to the endpoint where source code can be uploaded for a build. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the token used to connect to the endpoint where source code can be uploaded for a build. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuildTokenInner list(String resourceGroupName, String builderName, String buildName) { + return listWithResponse(resourceGroupName, builderName, buildName, Context.NONE).getValue(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildAuthTokensImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildAuthTokensImpl.java new file mode 100644 index 0000000000000..be90dbf624920 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildAuthTokensImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.BuildAuthTokensClient; +import com.azure.resourcemanager.appcontainers.fluent.models.BuildTokenInner; +import com.azure.resourcemanager.appcontainers.models.BuildAuthTokens; +import com.azure.resourcemanager.appcontainers.models.BuildToken; + +public final class BuildAuthTokensImpl implements BuildAuthTokens { + private static final ClientLogger LOGGER = new ClientLogger(BuildAuthTokensImpl.class); + + private final BuildAuthTokensClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public BuildAuthTokensImpl(BuildAuthTokensClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listWithResponse(String resourceGroupName, String builderName, String buildName, + Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, builderName, buildName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BuildTokenImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BuildToken list(String resourceGroupName, String builderName, String buildName) { + BuildTokenInner inner = this.serviceClient().list(resourceGroupName, builderName, buildName); + if (inner != null) { + return new BuildTokenImpl(inner, this.manager()); + } else { + return null; + } + } + + private BuildAuthTokensClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildResourceImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildResourceImpl.java new file mode 100644 index 0000000000000..f254e9354fc18 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildResourceImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.BuildResourceInner; +import com.azure.resourcemanager.appcontainers.models.BuildConfiguration; +import com.azure.resourcemanager.appcontainers.models.BuildProvisioningState; +import com.azure.resourcemanager.appcontainers.models.BuildResource; +import com.azure.resourcemanager.appcontainers.models.BuildStatus; +import com.azure.resourcemanager.appcontainers.models.ContainerRegistryWithCustomImage; + +public final class BuildResourceImpl implements BuildResource, BuildResource.Definition, BuildResource.Update { + private BuildResourceInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public BuildProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public BuildStatus buildStatus() { + return this.innerModel().buildStatus(); + } + + public ContainerRegistryWithCustomImage destinationContainerRegistry() { + return this.innerModel().destinationContainerRegistry(); + } + + public BuildConfiguration configuration() { + return this.innerModel().configuration(); + } + + public String uploadEndpoint() { + return this.innerModel().uploadEndpoint(); + } + + public String logStreamEndpoint() { + return this.innerModel().logStreamEndpoint(); + } + + public String tokenEndpoint() { + return this.innerModel().tokenEndpoint(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public BuildResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String builderName; + + private String buildName; + + public BuildResourceImpl withExistingBuilder(String resourceGroupName, String builderName) { + this.resourceGroupName = resourceGroupName; + this.builderName = builderName; + return this; + } + + public BuildResource create() { + this.innerObject = serviceManager.serviceClient() + .getBuilds() + .createOrUpdate(resourceGroupName, builderName, buildName, this.innerModel(), Context.NONE); + return this; + } + + public BuildResource create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBuilds() + .createOrUpdate(resourceGroupName, builderName, buildName, this.innerModel(), context); + return this; + } + + BuildResourceImpl(String name, com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = new BuildResourceInner(); + this.serviceManager = serviceManager; + this.buildName = name; + } + + public BuildResourceImpl update() { + return this; + } + + public BuildResource apply() { + this.innerObject = serviceManager.serviceClient() + .getBuilds() + .createOrUpdate(resourceGroupName, builderName, buildName, this.innerModel(), Context.NONE); + return this; + } + + public BuildResource apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBuilds() + .createOrUpdate(resourceGroupName, builderName, buildName, this.innerModel(), context); + return this; + } + + BuildResourceImpl(BuildResourceInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.builderName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "builders"); + this.buildName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "builds"); + } + + public BuildResource refresh() { + this.innerObject = serviceManager.serviceClient() + .getBuilds() + .getWithResponse(resourceGroupName, builderName, buildName, Context.NONE) + .getValue(); + return this; + } + + public BuildResource refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBuilds() + .getWithResponse(resourceGroupName, builderName, buildName, context) + .getValue(); + return this; + } + + public BuildResourceImpl + withDestinationContainerRegistry(ContainerRegistryWithCustomImage destinationContainerRegistry) { + this.innerModel().withDestinationContainerRegistry(destinationContainerRegistry); + return this; + } + + public BuildResourceImpl withConfiguration(BuildConfiguration configuration) { + this.innerModel().withConfiguration(configuration); + return this; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildTokenImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildTokenImpl.java new file mode 100644 index 0000000000000..cd7d3b4913708 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildTokenImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.resourcemanager.appcontainers.fluent.models.BuildTokenInner; +import com.azure.resourcemanager.appcontainers.models.BuildToken; +import java.time.OffsetDateTime; + +public final class BuildTokenImpl implements BuildToken { + private BuildTokenInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + BuildTokenImpl(BuildTokenInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String token() { + return this.innerModel().token(); + } + + public OffsetDateTime expires() { + return this.innerModel().expires(); + } + + public BuildTokenInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuilderResourceImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuilderResourceImpl.java new file mode 100644 index 0000000000000..14d509009b5e2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuilderResourceImpl.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.BuilderResourceInner; +import com.azure.resourcemanager.appcontainers.models.BuilderProvisioningState; +import com.azure.resourcemanager.appcontainers.models.BuilderResource; +import com.azure.resourcemanager.appcontainers.models.BuilderResourceUpdate; +import com.azure.resourcemanager.appcontainers.models.ContainerRegistry; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class BuilderResourceImpl implements BuilderResource, BuilderResource.Definition, BuilderResource.Update { + private BuilderResourceInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public BuilderProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String environmentId() { + return this.innerModel().environmentId(); + } + + public List containerRegistries() { + List inner = this.innerModel().containerRegistries(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public BuilderResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String builderName; + + private BuilderResourceUpdate updateBuilderEnvelope; + + public BuilderResourceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public BuilderResource create() { + this.innerObject = serviceManager.serviceClient() + .getBuilders() + .createOrUpdate(resourceGroupName, builderName, this.innerModel(), Context.NONE); + return this; + } + + public BuilderResource create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBuilders() + .createOrUpdate(resourceGroupName, builderName, this.innerModel(), context); + return this; + } + + BuilderResourceImpl(String name, com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = new BuilderResourceInner(); + this.serviceManager = serviceManager; + this.builderName = name; + } + + public BuilderResourceImpl update() { + this.updateBuilderEnvelope = new BuilderResourceUpdate(); + return this; + } + + public BuilderResource apply() { + this.innerObject = serviceManager.serviceClient() + .getBuilders() + .update(resourceGroupName, builderName, updateBuilderEnvelope, Context.NONE); + return this; + } + + public BuilderResource apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBuilders() + .update(resourceGroupName, builderName, updateBuilderEnvelope, context); + return this; + } + + BuilderResourceImpl(BuilderResourceInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.builderName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "builders"); + } + + public BuilderResource refresh() { + this.innerObject = serviceManager.serviceClient() + .getBuilders() + .getByResourceGroupWithResponse(resourceGroupName, builderName, Context.NONE) + .getValue(); + return this; + } + + public BuilderResource refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBuilders() + .getByResourceGroupWithResponse(resourceGroupName, builderName, context) + .getValue(); + return this; + } + + public BuilderResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public BuilderResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public BuilderResourceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBuilderEnvelope.withTags(tags); + return this; + } + } + + public BuilderResourceImpl withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateBuilderEnvelope.withIdentity(identity); + return this; + } + } + + public BuilderResourceImpl withEnvironmentId(String environmentId) { + if (isInCreateMode()) { + this.innerModel().withEnvironmentId(environmentId); + return this; + } else { + this.updateBuilderEnvelope.withEnvironmentId(environmentId); + return this; + } + } + + public BuilderResourceImpl withContainerRegistries(List containerRegistries) { + this.innerModel().withContainerRegistries(containerRegistries); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildersClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildersClientImpl.java new file mode 100644 index 0000000000000..573cee8d22d94 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildersClientImpl.java @@ -0,0 +1,1282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appcontainers.fluent.BuildersClient; +import com.azure.resourcemanager.appcontainers.fluent.models.BuilderResourceInner; +import com.azure.resourcemanager.appcontainers.models.BuilderCollection; +import com.azure.resourcemanager.appcontainers.models.BuilderResourceUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BuildersClient. + */ +public final class BuildersClientImpl implements BuildersClient { + /** + * The proxy service used to perform REST calls. + */ + private final BuildersService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of BuildersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BuildersClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(BuildersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientBuilders to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface BuildersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/builders") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("builderName") String builderName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("builderName") String builderName, + @BodyParam("application/json") BuilderResourceInner builderEnvelope, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("builderName") String builderName, + @BodyParam("application/json") BuilderResourceUpdate builderEnvelope, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("builderName") String builderName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List BuilderResource resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List BuilderResource resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List BuilderResource resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List BuilderResource resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List BuilderResource resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List BuilderResource resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List BuilderResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List BuilderResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List BuilderResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List BuilderResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List BuilderResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List BuilderResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuilderResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String builderName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, builderName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuilderResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String builderName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, builderName, accept, context); + } + + /** + * Get a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuilderResource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String builderName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, builderName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuilderResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String builderName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, builderName, context).block(); + } + + /** + * Get a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuilderResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuilderResourceInner getByResourceGroup(String resourceGroupName, String builderName) { + return getByResourceGroupWithResponse(resourceGroupName, builderName, Context.NONE).getValue(); + } + + /** + * Create or update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the SourceToCloud builder resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String builderName, BuilderResourceInner builderEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + if (builderEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter builderEnvelope is required and cannot be null.")); + } else { + builderEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, builderName, builderEnvelope, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the SourceToCloud builder resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String builderName, BuilderResourceInner builderEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + if (builderEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter builderEnvelope is required and cannot be null.")); + } else { + builderEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, builderName, builderEnvelope, accept, context); + } + + /** + * Create or update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of information about the SourceToCloud builder resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BuilderResourceInner> + beginCreateOrUpdateAsync(String resourceGroupName, String builderName, BuilderResourceInner builderEnvelope) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, builderName, builderEnvelope); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + BuilderResourceInner.class, BuilderResourceInner.class, this.client.getContext()); + } + + /** + * Create or update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of information about the SourceToCloud builder resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BuilderResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String builderName, BuilderResourceInner builderEnvelope, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, builderName, builderEnvelope, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + BuilderResourceInner.class, BuilderResourceInner.class, context); + } + + /** + * Create or update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information about the SourceToCloud builder resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BuilderResourceInner> + beginCreateOrUpdate(String resourceGroupName, String builderName, BuilderResourceInner builderEnvelope) { + return this.beginCreateOrUpdateAsync(resourceGroupName, builderName, builderEnvelope).getSyncPoller(); + } + + /** + * Create or update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information about the SourceToCloud builder resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BuilderResourceInner> beginCreateOrUpdate( + String resourceGroupName, String builderName, BuilderResourceInner builderEnvelope, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, builderName, builderEnvelope, context).getSyncPoller(); + } + + /** + * Create or update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the SourceToCloud builder resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String builderName, + BuilderResourceInner builderEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, builderName, builderEnvelope).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the SourceToCloud builder resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String builderName, + BuilderResourceInner builderEnvelope, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, builderName, builderEnvelope, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the SourceToCloud builder resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuilderResourceInner createOrUpdate(String resourceGroupName, String builderName, + BuilderResourceInner builderEnvelope) { + return createOrUpdateAsync(resourceGroupName, builderName, builderEnvelope).block(); + } + + /** + * Create or update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the SourceToCloud builder resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuilderResourceInner createOrUpdate(String resourceGroupName, String builderName, + BuilderResourceInner builderEnvelope, Context context) { + return createOrUpdateAsync(resourceGroupName, builderName, builderEnvelope, context).block(); + } + + /** + * Update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the SourceToCloud builder resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String builderName, + BuilderResourceUpdate builderEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + if (builderEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter builderEnvelope is required and cannot be null.")); + } else { + builderEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, builderName, builderEnvelope, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the SourceToCloud builder resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String builderName, + BuilderResourceUpdate builderEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + if (builderEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter builderEnvelope is required and cannot be null.")); + } else { + builderEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, builderName, builderEnvelope, accept, context); + } + + /** + * Update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of information about the SourceToCloud builder resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BuilderResourceInner> + beginUpdateAsync(String resourceGroupName, String builderName, BuilderResourceUpdate builderEnvelope) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, builderName, builderEnvelope); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + BuilderResourceInner.class, BuilderResourceInner.class, this.client.getContext()); + } + + /** + * Update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of information about the SourceToCloud builder resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BuilderResourceInner> beginUpdateAsync( + String resourceGroupName, String builderName, BuilderResourceUpdate builderEnvelope, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, builderName, builderEnvelope, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + BuilderResourceInner.class, BuilderResourceInner.class, context); + } + + /** + * Update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information about the SourceToCloud builder resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BuilderResourceInner> beginUpdate(String resourceGroupName, + String builderName, BuilderResourceUpdate builderEnvelope) { + return this.beginUpdateAsync(resourceGroupName, builderName, builderEnvelope).getSyncPoller(); + } + + /** + * Update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information about the SourceToCloud builder resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BuilderResourceInner> beginUpdate(String resourceGroupName, + String builderName, BuilderResourceUpdate builderEnvelope, Context context) { + return this.beginUpdateAsync(resourceGroupName, builderName, builderEnvelope, context).getSyncPoller(); + } + + /** + * Update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the SourceToCloud builder resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String builderName, + BuilderResourceUpdate builderEnvelope) { + return beginUpdateAsync(resourceGroupName, builderName, builderEnvelope).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the SourceToCloud builder resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String builderName, + BuilderResourceUpdate builderEnvelope, Context context) { + return beginUpdateAsync(resourceGroupName, builderName, builderEnvelope, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the SourceToCloud builder resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuilderResourceInner update(String resourceGroupName, String builderName, + BuilderResourceUpdate builderEnvelope) { + return updateAsync(resourceGroupName, builderName, builderEnvelope).block(); + } + + /** + * Update a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param builderEnvelope The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the SourceToCloud builder resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuilderResourceInner update(String resourceGroupName, String builderName, + BuilderResourceUpdate builderEnvelope, Context context) { + return updateAsync(resourceGroupName, builderName, builderEnvelope, context).block(); + } + + /** + * Delete a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String builderName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, builderName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String builderName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, builderName, accept, context); + } + + /** + * Delete a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String builderName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, builderName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String builderName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, builderName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String builderName) { + return this.beginDeleteAsync(resourceGroupName, builderName).getSyncPoller(); + } + + /** + * Delete a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String builderName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, builderName, context).getSyncPoller(); + } + + /** + * Delete a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String builderName) { + return beginDeleteAsync(resourceGroupName, builderName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String builderName, Context context) { + return beginDeleteAsync(resourceGroupName, builderName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String builderName) { + deleteAsync(resourceGroupName, builderName).block(); + } + + /** + * Delete a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String builderName, Context context) { + deleteAsync(resourceGroupName, builderName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildersImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildersImpl.java new file mode 100644 index 0000000000000..afb724f88cafe --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildersImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.BuildersClient; +import com.azure.resourcemanager.appcontainers.fluent.models.BuilderResourceInner; +import com.azure.resourcemanager.appcontainers.models.BuilderResource; +import com.azure.resourcemanager.appcontainers.models.Builders; + +public final class BuildersImpl implements Builders { + private static final ClientLogger LOGGER = new ClientLogger(BuildersImpl.class); + + private final BuildersClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public BuildersImpl(BuildersClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BuilderResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BuilderResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BuilderResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BuilderResourceImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String builderName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, builderName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BuilderResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BuilderResource getByResourceGroup(String resourceGroupName, String builderName) { + BuilderResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, builderName); + if (inner != null) { + return new BuilderResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String builderName) { + this.serviceClient().delete(resourceGroupName, builderName); + } + + public void delete(String resourceGroupName, String builderName, Context context) { + this.serviceClient().delete(resourceGroupName, builderName, context); + } + + public BuilderResource getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String builderName = ResourceManagerUtils.getValueFromIdByName(id, "builders"); + if (builderName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builders'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, builderName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String builderName = ResourceManagerUtils.getValueFromIdByName(id, "builders"); + if (builderName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builders'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, builderName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String builderName = ResourceManagerUtils.getValueFromIdByName(id, "builders"); + if (builderName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builders'.", id))); + } + this.delete(resourceGroupName, builderName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String builderName = ResourceManagerUtils.getValueFromIdByName(id, "builders"); + if (builderName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builders'.", id))); + } + this.delete(resourceGroupName, builderName, context); + } + + private BuildersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public BuilderResourceImpl define(String name) { + return new BuilderResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildsByBuilderResourcesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildsByBuilderResourcesClientImpl.java new file mode 100644 index 0000000000000..e5110840118b9 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildsByBuilderResourcesClientImpl.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.appcontainers.fluent.BuildsByBuilderResourcesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.BuildResourceInner; +import com.azure.resourcemanager.appcontainers.models.BuildCollection; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BuildsByBuilderResourcesClient. + */ +public final class BuildsByBuilderResourcesClientImpl implements BuildsByBuilderResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final BuildsByBuilderResourcesService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of BuildsByBuilderResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BuildsByBuilderResourcesClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(BuildsByBuilderResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientBuildsByBuilderResources to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface BuildsByBuilderResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("builderName") String builderName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List BuildResource resources by BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuildResource list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String builderName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, builderName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List BuildResource resources by BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuildResource list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String builderName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, builderName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List BuildResource resources by BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuildResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String builderName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, builderName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List BuildResource resources by BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuildResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String builderName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, builderName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List BuildResource resources by BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuildResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String builderName) { + return new PagedIterable<>(listAsync(resourceGroupName, builderName)); + } + + /** + * List BuildResource resources by BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuildResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String builderName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, builderName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuildResource list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuildResource list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildsByBuilderResourcesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildsByBuilderResourcesImpl.java new file mode 100644 index 0000000000000..d1222c2dc55d9 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildsByBuilderResourcesImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.BuildsByBuilderResourcesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.BuildResourceInner; +import com.azure.resourcemanager.appcontainers.models.BuildResource; +import com.azure.resourcemanager.appcontainers.models.BuildsByBuilderResources; + +public final class BuildsByBuilderResourcesImpl implements BuildsByBuilderResources { + private static final ClientLogger LOGGER = new ClientLogger(BuildsByBuilderResourcesImpl.class); + + private final BuildsByBuilderResourcesClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public BuildsByBuilderResourcesImpl(BuildsByBuilderResourcesClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String builderName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, builderName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BuildResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String builderName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, builderName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BuildResourceImpl(inner1, this.manager())); + } + + private BuildsByBuilderResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildsClientImpl.java new file mode 100644 index 0000000000000..c297118316aca --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildsClientImpl.java @@ -0,0 +1,696 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appcontainers.fluent.BuildsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.BuildResourceInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BuildsClient. + */ +public final class BuildsClientImpl implements BuildsClient { + /** + * The proxy service used to perform REST calls. + */ + private final BuildsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of BuildsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BuildsClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(BuildsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientBuilds to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface BuildsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("builderName") String builderName, + @PathParam("buildName") String buildName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("builderName") String builderName, + @PathParam("buildName") String buildName, @BodyParam("application/json") BuildResourceInner buildEnvelope, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("builderName") String builderName, + @PathParam("buildName") String buildName, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuildResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String builderName, + String buildName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, builderName, buildName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuildResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String builderName, + String buildName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, builderName, buildName, accept, context); + } + + /** + * Get a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuildResource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String builderName, String buildName) { + return getWithResponseAsync(resourceGroupName, builderName, buildName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuildResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String builderName, String buildName, + Context context) { + return getWithResponseAsync(resourceGroupName, builderName, buildName, context).block(); + } + + /** + * Get a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuildResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuildResourceInner get(String resourceGroupName, String builderName, String buildName) { + return getWithResponse(resourceGroupName, builderName, buildName, Context.NONE).getValue(); + } + + /** + * Create a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param buildEnvelope Resource create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information pertaining to an individual build along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String builderName, String buildName, BuildResourceInner buildEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + if (buildEnvelope == null) { + return Mono.error(new IllegalArgumentException("Parameter buildEnvelope is required and cannot be null.")); + } else { + buildEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, builderName, buildName, buildEnvelope, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param buildEnvelope Resource create or update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information pertaining to an individual build along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String builderName, String buildName, BuildResourceInner buildEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + if (buildEnvelope == null) { + return Mono.error(new IllegalArgumentException("Parameter buildEnvelope is required and cannot be null.")); + } else { + buildEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, builderName, buildName, buildEnvelope, accept, context); + } + + /** + * Create a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param buildEnvelope Resource create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of information pertaining to an individual build. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BuildResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String builderName, String buildName, BuildResourceInner buildEnvelope) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, builderName, buildName, buildEnvelope); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + BuildResourceInner.class, BuildResourceInner.class, this.client.getContext()); + } + + /** + * Create a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param buildEnvelope Resource create or update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of information pertaining to an individual build. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BuildResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String builderName, String buildName, BuildResourceInner buildEnvelope, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, builderName, buildName, buildEnvelope, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + BuildResourceInner.class, BuildResourceInner.class, context); + } + + /** + * Create a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param buildEnvelope Resource create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information pertaining to an individual build. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BuildResourceInner> beginCreateOrUpdate(String resourceGroupName, + String builderName, String buildName, BuildResourceInner buildEnvelope) { + return this.beginCreateOrUpdateAsync(resourceGroupName, builderName, buildName, buildEnvelope).getSyncPoller(); + } + + /** + * Create a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param buildEnvelope Resource create or update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information pertaining to an individual build. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BuildResourceInner> beginCreateOrUpdate(String resourceGroupName, + String builderName, String buildName, BuildResourceInner buildEnvelope, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, builderName, buildName, buildEnvelope, context) + .getSyncPoller(); + } + + /** + * Create a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param buildEnvelope Resource create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information pertaining to an individual build on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String builderName, String buildName, + BuildResourceInner buildEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, builderName, buildName, buildEnvelope).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param buildEnvelope Resource create or update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information pertaining to an individual build on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String builderName, String buildName, + BuildResourceInner buildEnvelope, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, builderName, buildName, buildEnvelope, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param buildEnvelope Resource create or update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information pertaining to an individual build. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuildResourceInner createOrUpdate(String resourceGroupName, String builderName, String buildName, + BuildResourceInner buildEnvelope) { + return createOrUpdateAsync(resourceGroupName, builderName, buildName, buildEnvelope).block(); + } + + /** + * Create a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param buildEnvelope Resource create or update parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information pertaining to an individual build. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuildResourceInner createOrUpdate(String resourceGroupName, String builderName, String buildName, + BuildResourceInner buildEnvelope, Context context) { + return createOrUpdateAsync(resourceGroupName, builderName, buildName, buildEnvelope, context).block(); + } + + /** + * Delete a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String builderName, + String buildName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, builderName, buildName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String builderName, + String buildName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, builderName, buildName, accept, context); + } + + /** + * Delete a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String builderName, + String buildName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, builderName, buildName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String builderName, + String buildName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, builderName, buildName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String builderName, + String buildName) { + return this.beginDeleteAsync(resourceGroupName, builderName, buildName).getSyncPoller(); + } + + /** + * Delete a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String builderName, + String buildName, Context context) { + return this.beginDeleteAsync(resourceGroupName, builderName, buildName, context).getSyncPoller(); + } + + /** + * Delete a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String builderName, String buildName) { + return beginDeleteAsync(resourceGroupName, builderName, buildName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String builderName, String buildName, Context context) { + return beginDeleteAsync(resourceGroupName, builderName, buildName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String builderName, String buildName) { + deleteAsync(resourceGroupName, builderName, buildName).block(); + } + + /** + * Delete a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String builderName, String buildName, Context context) { + deleteAsync(resourceGroupName, builderName, buildName, context).block(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildsImpl.java new file mode 100644 index 0000000000000..7f29012d629e5 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BuildsImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.BuildsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.BuildResourceInner; +import com.azure.resourcemanager.appcontainers.models.BuildResource; +import com.azure.resourcemanager.appcontainers.models.Builds; + +public final class BuildsImpl implements Builds { + private static final ClientLogger LOGGER = new ClientLogger(BuildsImpl.class); + + private final BuildsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public BuildsImpl(BuildsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String builderName, String buildName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, builderName, buildName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BuildResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BuildResource get(String resourceGroupName, String builderName, String buildName) { + BuildResourceInner inner = this.serviceClient().get(resourceGroupName, builderName, buildName); + if (inner != null) { + return new BuildResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String builderName, String buildName) { + this.serviceClient().delete(resourceGroupName, builderName, buildName); + } + + public void delete(String resourceGroupName, String builderName, String buildName, Context context) { + this.serviceClient().delete(resourceGroupName, builderName, buildName, context); + } + + public BuildResource getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String builderName = ResourceManagerUtils.getValueFromIdByName(id, "builders"); + if (builderName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builders'.", id))); + } + String buildName = ResourceManagerUtils.getValueFromIdByName(id, "builds"); + if (buildName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builds'.", id))); + } + return this.getWithResponse(resourceGroupName, builderName, buildName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String builderName = ResourceManagerUtils.getValueFromIdByName(id, "builders"); + if (builderName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builders'.", id))); + } + String buildName = ResourceManagerUtils.getValueFromIdByName(id, "builds"); + if (buildName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builds'.", id))); + } + return this.getWithResponse(resourceGroupName, builderName, buildName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String builderName = ResourceManagerUtils.getValueFromIdByName(id, "builders"); + if (builderName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builders'.", id))); + } + String buildName = ResourceManagerUtils.getValueFromIdByName(id, "builds"); + if (buildName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builds'.", id))); + } + this.delete(resourceGroupName, builderName, buildName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String builderName = ResourceManagerUtils.getValueFromIdByName(id, "builders"); + if (builderName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builders'.", id))); + } + String buildName = ResourceManagerUtils.getValueFromIdByName(id, "builds"); + if (buildName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builds'.", id))); + } + this.delete(resourceGroupName, builderName, buildName, context); + } + + private BuildsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public BuildResourceImpl define(String name) { + return new BuildResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppImpl.java index b635fe191e364..ef5e6d5f3bcda 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppImpl.java @@ -12,9 +12,11 @@ import com.azure.resourcemanager.appcontainers.models.Configuration; import com.azure.resourcemanager.appcontainers.models.ContainerApp; import com.azure.resourcemanager.appcontainers.models.ContainerAppAuthToken; +import com.azure.resourcemanager.appcontainers.models.ContainerAppPropertiesPatchingConfiguration; import com.azure.resourcemanager.appcontainers.models.ContainerAppProvisioningState; import com.azure.resourcemanager.appcontainers.models.CustomHostnameAnalysisResult; import com.azure.resourcemanager.appcontainers.models.ExtendedLocation; +import com.azure.resourcemanager.appcontainers.models.Kind; import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; import com.azure.resourcemanager.appcontainers.models.SecretsCollection; import com.azure.resourcemanager.appcontainers.models.Template; @@ -64,6 +66,10 @@ public String managedBy() { return this.innerModel().managedBy(); } + public Kind kind() { + return this.innerModel().kind(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -72,6 +78,10 @@ public ContainerAppProvisioningState provisioningState() { return this.innerModel().provisioningState(); } + public String deploymentErrors() { + return this.innerModel().deploymentErrors(); + } + public String managedEnvironmentId() { return this.innerModel().managedEnvironmentId(); } @@ -84,6 +94,10 @@ public String workloadProfileName() { return this.innerModel().workloadProfileName(); } + public ContainerAppPropertiesPatchingConfiguration patchingConfiguration() { + return this.innerModel().patchingConfiguration(); + } + public String latestRevisionName() { return this.innerModel().latestRevisionName(); } @@ -284,6 +298,11 @@ public ContainerAppImpl withManagedBy(String managedBy) { return this; } + public ContainerAppImpl withKind(Kind kind) { + this.innerModel().withKind(kind); + return this; + } + public ContainerAppImpl withManagedEnvironmentId(String managedEnvironmentId) { this.innerModel().withManagedEnvironmentId(managedEnvironmentId); return this; @@ -299,6 +318,12 @@ public ContainerAppImpl withWorkloadProfileName(String workloadProfileName) { return this; } + public ContainerAppImpl + withPatchingConfiguration(ContainerAppPropertiesPatchingConfiguration patchingConfiguration) { + this.innerModel().withPatchingConfiguration(patchingConfiguration); + return this; + } + public ContainerAppImpl withConfiguration(Configuration configuration) { this.innerModel().withConfiguration(configuration); return this; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsApiClientBuilder.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsApiClientBuilder.java index 29f39590b6348..d2fa8d7fd0f74 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsApiClientBuilder.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsApiClientBuilder.java @@ -20,12 +20,12 @@ @ServiceClientBuilder(serviceClients = { ContainerAppsApiClientImpl.class }) public final class ContainerAppsApiClientBuilder { /* - * The ID of the target subscription. + * The ID of the target subscription. The value must be an UUID. */ private String subscriptionId; /** - * Sets The ID of the target subscription. + * Sets The ID of the target subscription. The value must be an UUID. * * @param subscriptionId the subscriptionId value. * @return the ContainerAppsApiClientBuilder. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsApiClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsApiClientImpl.java index 119c3d764875a..8baaf047e7462 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsApiClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsApiClientImpl.java @@ -23,8 +23,13 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.appcontainers.fluent.AppResilienciesClient; import com.azure.resourcemanager.appcontainers.fluent.AvailableWorkloadProfilesClient; import com.azure.resourcemanager.appcontainers.fluent.BillingMetersClient; +import com.azure.resourcemanager.appcontainers.fluent.BuildAuthTokensClient; +import com.azure.resourcemanager.appcontainers.fluent.BuildersClient; +import com.azure.resourcemanager.appcontainers.fluent.BuildsByBuilderResourcesClient; +import com.azure.resourcemanager.appcontainers.fluent.BuildsClient; import com.azure.resourcemanager.appcontainers.fluent.CertificatesClient; import com.azure.resourcemanager.appcontainers.fluent.ConnectedEnvironmentsCertificatesClient; import com.azure.resourcemanager.appcontainers.fluent.ConnectedEnvironmentsClient; @@ -32,16 +37,28 @@ import com.azure.resourcemanager.appcontainers.fluent.ConnectedEnvironmentsStoragesClient; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsApiClient; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsAuthConfigsClient; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsBuildsByContainerAppsClient; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsBuildsClient; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsClient; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsDiagnosticsClient; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsPatchesClient; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsRevisionReplicasClient; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsRevisionsClient; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsSessionPoolsClient; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsSourceControlsClient; +import com.azure.resourcemanager.appcontainers.fluent.DaprComponentResiliencyPoliciesClient; import com.azure.resourcemanager.appcontainers.fluent.DaprComponentsClient; +import com.azure.resourcemanager.appcontainers.fluent.DaprSubscriptionsClient; +import com.azure.resourcemanager.appcontainers.fluent.DotNetComponentsClient; +import com.azure.resourcemanager.appcontainers.fluent.FunctionsExtensionsClient; +import com.azure.resourcemanager.appcontainers.fluent.JavaComponentsClient; import com.azure.resourcemanager.appcontainers.fluent.JobsClient; import com.azure.resourcemanager.appcontainers.fluent.JobsExecutionsClient; +import com.azure.resourcemanager.appcontainers.fluent.LogicAppsClient; import com.azure.resourcemanager.appcontainers.fluent.ManagedCertificatesClient; import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentDiagnosticsClient; +import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentPrivateLinkResourcesClient; import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentsClient; import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentsDiagnosticsClient; import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentsStoragesClient; @@ -65,12 +82,12 @@ @ServiceClient(builder = ContainerAppsApiClientBuilder.class) public final class ContainerAppsApiClientImpl implements ContainerAppsApiClient { /** - * The ID of the target subscription. + * The ID of the target subscription. The value must be an UUID. */ private final String subscriptionId; /** - * Gets The ID of the target subscription. + * Gets The ID of the target subscription. The value must be an UUID. * * @return the subscriptionId value. */ @@ -148,6 +165,20 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } + /** + * The AppResilienciesClient object to access its operations. + */ + private final AppResilienciesClient appResiliencies; + + /** + * Gets the AppResilienciesClient object to access its operations. + * + * @return the AppResilienciesClient object. + */ + public AppResilienciesClient getAppResiliencies() { + return this.appResiliencies; + } + /** * The ContainerAppsAuthConfigsClient object to access its operations. */ @@ -190,6 +221,62 @@ public BillingMetersClient getBillingMeters() { return this.billingMeters; } + /** + * The BuildersClient object to access its operations. + */ + private final BuildersClient builders; + + /** + * Gets the BuildersClient object to access its operations. + * + * @return the BuildersClient object. + */ + public BuildersClient getBuilders() { + return this.builders; + } + + /** + * The BuildsByBuilderResourcesClient object to access its operations. + */ + private final BuildsByBuilderResourcesClient buildsByBuilderResources; + + /** + * Gets the BuildsByBuilderResourcesClient object to access its operations. + * + * @return the BuildsByBuilderResourcesClient object. + */ + public BuildsByBuilderResourcesClient getBuildsByBuilderResources() { + return this.buildsByBuilderResources; + } + + /** + * The BuildsClient object to access its operations. + */ + private final BuildsClient builds; + + /** + * Gets the BuildsClient object to access its operations. + * + * @return the BuildsClient object. + */ + public BuildsClient getBuilds() { + return this.builds; + } + + /** + * The BuildAuthTokensClient object to access its operations. + */ + private final BuildAuthTokensClient buildAuthTokens; + + /** + * Gets the BuildAuthTokensClient object to access its operations. + * + * @return the BuildAuthTokensClient object. + */ + public BuildAuthTokensClient getBuildAuthTokens() { + return this.buildAuthTokens; + } + /** * The ConnectedEnvironmentsClient object to access its operations. */ @@ -260,6 +347,48 @@ public ContainerAppsClient getContainerApps() { return this.containerApps; } + /** + * The ContainerAppsBuildsByContainerAppsClient object to access its operations. + */ + private final ContainerAppsBuildsByContainerAppsClient containerAppsBuildsByContainerApps; + + /** + * Gets the ContainerAppsBuildsByContainerAppsClient object to access its operations. + * + * @return the ContainerAppsBuildsByContainerAppsClient object. + */ + public ContainerAppsBuildsByContainerAppsClient getContainerAppsBuildsByContainerApps() { + return this.containerAppsBuildsByContainerApps; + } + + /** + * The ContainerAppsBuildsClient object to access its operations. + */ + private final ContainerAppsBuildsClient containerAppsBuilds; + + /** + * Gets the ContainerAppsBuildsClient object to access its operations. + * + * @return the ContainerAppsBuildsClient object. + */ + public ContainerAppsBuildsClient getContainerAppsBuilds() { + return this.containerAppsBuilds; + } + + /** + * The ContainerAppsPatchesClient object to access its operations. + */ + private final ContainerAppsPatchesClient containerAppsPatches; + + /** + * Gets the ContainerAppsPatchesClient object to access its operations. + * + * @return the ContainerAppsPatchesClient object. + */ + public ContainerAppsPatchesClient getContainerAppsPatches() { + return this.containerAppsPatches; + } + /** * The ContainerAppsRevisionsClient object to access its operations. */ @@ -344,6 +473,34 @@ public JobsClient getJobs() { return this.jobs; } + /** + * The DotNetComponentsClient object to access its operations. + */ + private final DotNetComponentsClient dotNetComponents; + + /** + * Gets the DotNetComponentsClient object to access its operations. + * + * @return the DotNetComponentsClient object. + */ + public DotNetComponentsClient getDotNetComponents() { + return this.dotNetComponents; + } + + /** + * The FunctionsExtensionsClient object to access its operations. + */ + private final FunctionsExtensionsClient functionsExtensions; + + /** + * Gets the FunctionsExtensionsClient object to access its operations. + * + * @return the FunctionsExtensionsClient object. + */ + public FunctionsExtensionsClient getFunctionsExtensions() { + return this.functionsExtensions; + } + /** * The OperationsClient object to access its operations. */ @@ -358,6 +515,20 @@ public OperationsClient getOperations() { return this.operations; } + /** + * The JavaComponentsClient object to access its operations. + */ + private final JavaComponentsClient javaComponents; + + /** + * Gets the JavaComponentsClient object to access its operations. + * + * @return the JavaComponentsClient object. + */ + public JavaComponentsClient getJavaComponents() { + return this.javaComponents; + } + /** * The JobsExecutionsClient object to access its operations. */ @@ -386,6 +557,20 @@ public ResourceProvidersClient getResourceProviders() { return this.resourceProviders; } + /** + * The LogicAppsClient object to access its operations. + */ + private final LogicAppsClient logicApps; + + /** + * Gets the LogicAppsClient object to access its operations. + * + * @return the LogicAppsClient object. + */ + public LogicAppsClient getLogicApps() { + return this.logicApps; + } + /** * The ManagedEnvironmentsClient object to access its operations. */ @@ -442,6 +627,48 @@ public NamespacesClient getNamespaces() { return this.namespaces; } + /** + * The ManagedEnvironmentPrivateEndpointConnectionsClient object to access its operations. + */ + private final ManagedEnvironmentPrivateEndpointConnectionsClient managedEnvironmentPrivateEndpointConnections; + + /** + * Gets the ManagedEnvironmentPrivateEndpointConnectionsClient object to access its operations. + * + * @return the ManagedEnvironmentPrivateEndpointConnectionsClient object. + */ + public ManagedEnvironmentPrivateEndpointConnectionsClient getManagedEnvironmentPrivateEndpointConnections() { + return this.managedEnvironmentPrivateEndpointConnections; + } + + /** + * The ManagedEnvironmentPrivateLinkResourcesClient object to access its operations. + */ + private final ManagedEnvironmentPrivateLinkResourcesClient managedEnvironmentPrivateLinkResources; + + /** + * Gets the ManagedEnvironmentPrivateLinkResourcesClient object to access its operations. + * + * @return the ManagedEnvironmentPrivateLinkResourcesClient object. + */ + public ManagedEnvironmentPrivateLinkResourcesClient getManagedEnvironmentPrivateLinkResources() { + return this.managedEnvironmentPrivateLinkResources; + } + + /** + * The DaprComponentResiliencyPoliciesClient object to access its operations. + */ + private final DaprComponentResiliencyPoliciesClient daprComponentResiliencyPolicies; + + /** + * Gets the DaprComponentResiliencyPoliciesClient object to access its operations. + * + * @return the DaprComponentResiliencyPoliciesClient object. + */ + public DaprComponentResiliencyPoliciesClient getDaprComponentResiliencyPolicies() { + return this.daprComponentResiliencyPolicies; + } + /** * The DaprComponentsClient object to access its operations. */ @@ -456,6 +683,20 @@ public DaprComponentsClient getDaprComponents() { return this.daprComponents; } + /** + * The DaprSubscriptionsClient object to access its operations. + */ + private final DaprSubscriptionsClient daprSubscriptions; + + /** + * Gets the DaprSubscriptionsClient object to access its operations. + * + * @return the DaprSubscriptionsClient object. + */ + public DaprSubscriptionsClient getDaprSubscriptions() { + return this.daprSubscriptions; + } + /** * The ManagedEnvironmentsStoragesClient object to access its operations. */ @@ -470,6 +711,20 @@ public ManagedEnvironmentsStoragesClient getManagedEnvironmentsStorages() { return this.managedEnvironmentsStorages; } + /** + * The ContainerAppsSessionPoolsClient object to access its operations. + */ + private final ContainerAppsSessionPoolsClient containerAppsSessionPools; + + /** + * Gets the ContainerAppsSessionPoolsClient object to access its operations. + * + * @return the ContainerAppsSessionPoolsClient object. + */ + public ContainerAppsSessionPoolsClient getContainerAppsSessionPools() { + return this.containerAppsSessionPools; + } + /** * The ContainerAppsSourceControlsClient object to access its operations. */ @@ -519,7 +774,7 @@ public ManagedEnvironmentUsagesClient getManagedEnvironmentUsages() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param endpoint server parameter. */ ContainerAppsApiClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, @@ -529,30 +784,48 @@ public ManagedEnvironmentUsagesClient getManagedEnvironmentUsages() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2024-03-01"; + this.apiVersion = "2024-08-02-preview"; + this.appResiliencies = new AppResilienciesClientImpl(this); this.containerAppsAuthConfigs = new ContainerAppsAuthConfigsClientImpl(this); this.availableWorkloadProfiles = new AvailableWorkloadProfilesClientImpl(this); this.billingMeters = new BillingMetersClientImpl(this); + this.builders = new BuildersClientImpl(this); + this.buildsByBuilderResources = new BuildsByBuilderResourcesClientImpl(this); + this.builds = new BuildsClientImpl(this); + this.buildAuthTokens = new BuildAuthTokensClientImpl(this); this.connectedEnvironments = new ConnectedEnvironmentsClientImpl(this); this.connectedEnvironmentsCertificates = new ConnectedEnvironmentsCertificatesClientImpl(this); this.connectedEnvironmentsDaprComponents = new ConnectedEnvironmentsDaprComponentsClientImpl(this); this.connectedEnvironmentsStorages = new ConnectedEnvironmentsStoragesClientImpl(this); this.containerApps = new ContainerAppsClientImpl(this); + this.containerAppsBuildsByContainerApps = new ContainerAppsBuildsByContainerAppsClientImpl(this); + this.containerAppsBuilds = new ContainerAppsBuildsClientImpl(this); + this.containerAppsPatches = new ContainerAppsPatchesClientImpl(this); this.containerAppsRevisions = new ContainerAppsRevisionsClientImpl(this); this.containerAppsRevisionReplicas = new ContainerAppsRevisionReplicasClientImpl(this); this.containerAppsDiagnostics = new ContainerAppsDiagnosticsClientImpl(this); this.managedEnvironmentDiagnostics = new ManagedEnvironmentDiagnosticsClientImpl(this); this.managedEnvironmentsDiagnostics = new ManagedEnvironmentsDiagnosticsClientImpl(this); this.jobs = new JobsClientImpl(this); + this.dotNetComponents = new DotNetComponentsClientImpl(this); + this.functionsExtensions = new FunctionsExtensionsClientImpl(this); this.operations = new OperationsClientImpl(this); + this.javaComponents = new JavaComponentsClientImpl(this); this.jobsExecutions = new JobsExecutionsClientImpl(this); this.resourceProviders = new ResourceProvidersClientImpl(this); + this.logicApps = new LogicAppsClientImpl(this); this.managedEnvironments = new ManagedEnvironmentsClientImpl(this); this.certificates = new CertificatesClientImpl(this); this.managedCertificates = new ManagedCertificatesClientImpl(this); this.namespaces = new NamespacesClientImpl(this); + this.managedEnvironmentPrivateEndpointConnections + = new ManagedEnvironmentPrivateEndpointConnectionsClientImpl(this); + this.managedEnvironmentPrivateLinkResources = new ManagedEnvironmentPrivateLinkResourcesClientImpl(this); + this.daprComponentResiliencyPolicies = new DaprComponentResiliencyPoliciesClientImpl(this); this.daprComponents = new DaprComponentsClientImpl(this); + this.daprSubscriptions = new DaprSubscriptionsClientImpl(this); this.managedEnvironmentsStorages = new ManagedEnvironmentsStoragesClientImpl(this); + this.containerAppsSessionPools = new ContainerAppsSessionPoolsClientImpl(this); this.containerAppsSourceControls = new ContainerAppsSourceControlsClientImpl(this); this.usages = new UsagesClientImpl(this); this.managedEnvironmentUsages = new ManagedEnvironmentUsagesClientImpl(this); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildResourceImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildResourceImpl.java new file mode 100644 index 0000000000000..0140fcd8e5368 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildResourceImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsBuildResourceInner; +import com.azure.resourcemanager.appcontainers.models.BuildProvisioningState; +import com.azure.resourcemanager.appcontainers.models.BuildStatus; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsBuildConfiguration; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsBuildResource; +import com.azure.resourcemanager.appcontainers.models.ContainerRegistryWithCustomImage; + +public final class ContainerAppsBuildResourceImpl implements ContainerAppsBuildResource { + private ContainerAppsBuildResourceInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + ContainerAppsBuildResourceImpl(ContainerAppsBuildResourceInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public BuildProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public BuildStatus buildStatus() { + return this.innerModel().buildStatus(); + } + + public ContainerRegistryWithCustomImage destinationContainerRegistry() { + return this.innerModel().destinationContainerRegistry(); + } + + public ContainerAppsBuildConfiguration configuration() { + return this.innerModel().configuration(); + } + + public String logStreamEndpoint() { + return this.innerModel().logStreamEndpoint(); + } + + public ContainerAppsBuildResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsByContainerAppsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsByContainerAppsClientImpl.java new file mode 100644 index 0000000000000..cbdc525440ca7 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsByContainerAppsClientImpl.java @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsBuildsByContainerAppsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsBuildResourceInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsBuildCollection; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ContainerAppsBuildsByContainerAppsClient. + */ +public final class ContainerAppsBuildsByContainerAppsClientImpl implements ContainerAppsBuildsByContainerAppsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ContainerAppsBuildsByContainerAppsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppsBuildsByContainerAppsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppsBuildsByContainerAppsClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(ContainerAppsBuildsByContainerAppsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerAppsBuildsByContainerApps to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface ContainerAppsBuildsByContainerAppsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Container Apps Build resources by Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String containerAppName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Container Apps Build resources by Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String containerAppName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Container Apps Build resources by Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String containerAppName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, containerAppName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Container Apps Build resources by Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String containerAppName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, containerAppName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List Container Apps Build resources by Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String containerAppName) { + return new PagedIterable<>(listAsync(resourceGroupName, containerAppName)); + } + + /** + * List Container Apps Build resources by Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String containerAppName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, containerAppName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsByContainerAppsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsByContainerAppsImpl.java new file mode 100644 index 0000000000000..f5ff5268f874d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsByContainerAppsImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsBuildsByContainerAppsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsBuildResourceInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsBuildResource; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsBuildsByContainerApps; + +public final class ContainerAppsBuildsByContainerAppsImpl implements ContainerAppsBuildsByContainerApps { + private static final ClientLogger LOGGER = new ClientLogger(ContainerAppsBuildsByContainerAppsImpl.class); + + private final ContainerAppsBuildsByContainerAppsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public ContainerAppsBuildsByContainerAppsImpl(ContainerAppsBuildsByContainerAppsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String containerAppName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, containerAppName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ContainerAppsBuildResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String containerAppName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, containerAppName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ContainerAppsBuildResourceImpl(inner1, this.manager())); + } + + private ContainerAppsBuildsByContainerAppsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsClientImpl.java new file mode 100644 index 0000000000000..0a9b6a1c79325 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsClientImpl.java @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsBuildsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsBuildResourceInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ContainerAppsBuildsClient. + */ +public final class ContainerAppsBuildsClientImpl implements ContainerAppsBuildsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ContainerAppsBuildsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppsBuildsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppsBuildsClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(ContainerAppsBuildsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerAppsBuilds to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface ContainerAppsBuildsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("buildName") String buildName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("buildName") String buildName, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Build resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String containerAppName, String buildName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, buildName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Build resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String containerAppName, String buildName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, buildName, accept, context); + } + + /** + * Get a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Build resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String containerAppName, + String buildName) { + return getWithResponseAsync(resourceGroupName, containerAppName, buildName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Build resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String containerAppName, + String buildName, Context context) { + return getWithResponseAsync(resourceGroupName, containerAppName, buildName, context).block(); + } + + /** + * Get a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Build resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAppsBuildResourceInner get(String resourceGroupName, String containerAppName, String buildName) { + return getWithResponse(resourceGroupName, containerAppName, buildName, Context.NONE).getValue(); + } + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String containerAppName, + String buildName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, buildName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String containerAppName, + String buildName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, buildName, accept, context); + } + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String containerAppName, + String buildName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerAppName, buildName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String containerAppName, + String buildName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, containerAppName, buildName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String containerAppName, + String buildName) { + return this.beginDeleteAsync(resourceGroupName, containerAppName, buildName).getSyncPoller(); + } + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String containerAppName, + String buildName, Context context) { + return this.beginDeleteAsync(resourceGroupName, containerAppName, buildName, context).getSyncPoller(); + } + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String containerAppName, String buildName) { + return beginDeleteAsync(resourceGroupName, containerAppName, buildName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String containerAppName, String buildName, + Context context) { + return beginDeleteAsync(resourceGroupName, containerAppName, buildName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String containerAppName, String buildName) { + deleteAsync(resourceGroupName, containerAppName, buildName).block(); + } + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String containerAppName, String buildName, Context context) { + deleteAsync(resourceGroupName, containerAppName, buildName, context).block(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsImpl.java new file mode 100644 index 0000000000000..2e9fdac76510c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsBuildsImpl.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsBuildsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsBuildResourceInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsBuildResource; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsBuilds; + +public final class ContainerAppsBuildsImpl implements ContainerAppsBuilds { + private static final ClientLogger LOGGER = new ClientLogger(ContainerAppsBuildsImpl.class); + + private final ContainerAppsBuildsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public ContainerAppsBuildsImpl(ContainerAppsBuildsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String containerAppName, + String buildName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, containerAppName, buildName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ContainerAppsBuildResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContainerAppsBuildResource get(String resourceGroupName, String containerAppName, String buildName) { + ContainerAppsBuildResourceInner inner + = this.serviceClient().get(resourceGroupName, containerAppName, buildName); + if (inner != null) { + return new ContainerAppsBuildResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String containerAppName, String buildName) { + this.serviceClient().delete(resourceGroupName, containerAppName, buildName); + } + + public void delete(String resourceGroupName, String containerAppName, String buildName, Context context) { + this.serviceClient().delete(resourceGroupName, containerAppName, buildName, context); + } + + private ContainerAppsBuildsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsPatchResourceImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsPatchResourceImpl.java new file mode 100644 index 0000000000000..da5d66fd22e13 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsPatchResourceImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsPatchResourceInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsPatchResource; +import com.azure.resourcemanager.appcontainers.models.PatchProperties; + +public final class ContainerAppsPatchResourceImpl implements ContainerAppsPatchResource { + private ContainerAppsPatchResourceInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + ContainerAppsPatchResourceImpl(ContainerAppsPatchResourceInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public PatchProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ContainerAppsPatchResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsPatchesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsPatchesClientImpl.java new file mode 100644 index 0000000000000..3116fd1df17ab --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsPatchesClientImpl.java @@ -0,0 +1,1202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsPatchesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsPatchResourceInner; +import com.azure.resourcemanager.appcontainers.models.PatchCollection; +import com.azure.resourcemanager.appcontainers.models.PatchSkipConfig; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ContainerAppsPatchesClient. + */ +public final class ContainerAppsPatchesClientImpl implements ContainerAppsPatchesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ContainerAppsPatchesService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppsPatchesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppsPatchesClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(ContainerAppsPatchesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerAppsPatches to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface ContainerAppsPatchesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByContainerApp(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("patchName") String patchName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("patchName") String patchName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}/skipConfig") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> skipConfigure(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("patchName") String patchName, + @BodyParam("application/json") PatchSkipConfig patchSkipConfig, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}/apply") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> apply(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("patchName") String patchName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByContainerAppNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param filter The filter to apply on the operation. For example, $filter=properties/patchApplyStatus eq + * 'Succeeded'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByContainerAppSinglePageAsync(String resourceGroupName, String containerAppName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByContainerApp(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param filter The filter to apply on the operation. For example, $filter=properties/patchApplyStatus eq + * 'Succeeded'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByContainerAppSinglePageAsync( + String resourceGroupName, String containerAppName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByContainerApp(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, filter, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param filter The filter to apply on the operation. For example, $filter=properties/patchApplyStatus eq + * 'Succeeded'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByContainerAppAsync(String resourceGroupName, + String containerAppName, String filter) { + return new PagedFlux<>(() -> listByContainerAppSinglePageAsync(resourceGroupName, containerAppName, filter), + nextLink -> listByContainerAppNextSinglePageAsync(nextLink)); + } + + /** + * List Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByContainerAppAsync(String resourceGroupName, + String containerAppName) { + final String filter = null; + return new PagedFlux<>(() -> listByContainerAppSinglePageAsync(resourceGroupName, containerAppName, filter), + nextLink -> listByContainerAppNextSinglePageAsync(nextLink)); + } + + /** + * List Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param filter The filter to apply on the operation. For example, $filter=properties/patchApplyStatus eq + * 'Succeeded'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByContainerAppAsync(String resourceGroupName, + String containerAppName, String filter, Context context) { + return new PagedFlux<>( + () -> listByContainerAppSinglePageAsync(resourceGroupName, containerAppName, filter, context), + nextLink -> listByContainerAppNextSinglePageAsync(nextLink, context)); + } + + /** + * List Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByContainerApp(String resourceGroupName, + String containerAppName) { + final String filter = null; + return new PagedIterable<>(listByContainerAppAsync(resourceGroupName, containerAppName, filter)); + } + + /** + * List Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param filter The filter to apply on the operation. For example, $filter=properties/patchApplyStatus eq + * 'Succeeded'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByContainerApp(String resourceGroupName, + String containerAppName, String filter, Context context) { + return new PagedIterable<>(listByContainerAppAsync(resourceGroupName, containerAppName, filter, context)); + } + + /** + * Get details for specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details for specific Container Apps Patch by patch name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String containerAppName, String patchName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (patchName == null) { + return Mono.error(new IllegalArgumentException("Parameter patchName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, patchName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get details for specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details for specific Container Apps Patch by patch name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String containerAppName, String patchName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (patchName == null) { + return Mono.error(new IllegalArgumentException("Parameter patchName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, patchName, accept, context); + } + + /** + * Get details for specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details for specific Container Apps Patch by patch name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String containerAppName, + String patchName) { + return getWithResponseAsync(resourceGroupName, containerAppName, patchName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get details for specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details for specific Container Apps Patch by patch name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String containerAppName, + String patchName, Context context) { + return getWithResponseAsync(resourceGroupName, containerAppName, patchName, context).block(); + } + + /** + * Get details for specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details for specific Container Apps Patch by patch name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAppsPatchResourceInner get(String resourceGroupName, String containerAppName, String patchName) { + return getWithResponse(resourceGroupName, containerAppName, patchName, Context.NONE).getValue(); + } + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String containerAppName, + String patchName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (patchName == null) { + return Mono.error(new IllegalArgumentException("Parameter patchName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, patchName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String containerAppName, + String patchName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (patchName == null) { + return Mono.error(new IllegalArgumentException("Parameter patchName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, patchName, accept, context); + } + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String containerAppName, + String patchName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerAppName, patchName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String containerAppName, + String patchName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, containerAppName, patchName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String containerAppName, + String patchName) { + return this.beginDeleteAsync(resourceGroupName, containerAppName, patchName).getSyncPoller(); + } + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String containerAppName, + String patchName, Context context) { + return this.beginDeleteAsync(resourceGroupName, containerAppName, patchName, context).getSyncPoller(); + } + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String containerAppName, String patchName) { + return beginDeleteAsync(resourceGroupName, containerAppName, patchName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String containerAppName, String patchName, + Context context) { + return beginDeleteAsync(resourceGroupName, containerAppName, patchName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String containerAppName, String patchName) { + deleteAsync(resourceGroupName, containerAppName, patchName).block(); + } + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String containerAppName, String patchName, Context context) { + deleteAsync(resourceGroupName, containerAppName, patchName, context).block(); + } + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> skipConfigureWithResponseAsync(String resourceGroupName, + String containerAppName, String patchName, PatchSkipConfig patchSkipConfig) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (patchName == null) { + return Mono.error(new IllegalArgumentException("Parameter patchName is required and cannot be null.")); + } + if (patchSkipConfig == null) { + return Mono + .error(new IllegalArgumentException("Parameter patchSkipConfig is required and cannot be null.")); + } else { + patchSkipConfig.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.skipConfigure(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, patchName, patchSkipConfig, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> skipConfigureWithResponseAsync(String resourceGroupName, + String containerAppName, String patchName, PatchSkipConfig patchSkipConfig, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (patchName == null) { + return Mono.error(new IllegalArgumentException("Parameter patchName is required and cannot be null.")); + } + if (patchSkipConfig == null) { + return Mono + .error(new IllegalArgumentException("Parameter patchSkipConfig is required and cannot be null.")); + } else { + patchSkipConfig.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.skipConfigure(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, patchName, patchSkipConfig, accept, + context); + } + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginSkipConfigureAsync(String resourceGroupName, + String containerAppName, String patchName, PatchSkipConfig patchSkipConfig) { + Mono>> mono + = skipConfigureWithResponseAsync(resourceGroupName, containerAppName, patchName, patchSkipConfig); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginSkipConfigureAsync(String resourceGroupName, + String containerAppName, String patchName, PatchSkipConfig patchSkipConfig, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = skipConfigureWithResponseAsync(resourceGroupName, containerAppName, patchName, patchSkipConfig, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginSkipConfigure(String resourceGroupName, String containerAppName, + String patchName, PatchSkipConfig patchSkipConfig) { + return this.beginSkipConfigureAsync(resourceGroupName, containerAppName, patchName, patchSkipConfig) + .getSyncPoller(); + } + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginSkipConfigure(String resourceGroupName, String containerAppName, + String patchName, PatchSkipConfig patchSkipConfig, Context context) { + return this.beginSkipConfigureAsync(resourceGroupName, containerAppName, patchName, patchSkipConfig, context) + .getSyncPoller(); + } + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono skipConfigureAsync(String resourceGroupName, String containerAppName, String patchName, + PatchSkipConfig patchSkipConfig) { + return beginSkipConfigureAsync(resourceGroupName, containerAppName, patchName, patchSkipConfig).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono skipConfigureAsync(String resourceGroupName, String containerAppName, String patchName, + PatchSkipConfig patchSkipConfig, Context context) { + return beginSkipConfigureAsync(resourceGroupName, containerAppName, patchName, patchSkipConfig, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void skipConfigure(String resourceGroupName, String containerAppName, String patchName, + PatchSkipConfig patchSkipConfig) { + skipConfigureAsync(resourceGroupName, containerAppName, patchName, patchSkipConfig).block(); + } + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void skipConfigure(String resourceGroupName, String containerAppName, String patchName, + PatchSkipConfig patchSkipConfig, Context context) { + skipConfigureAsync(resourceGroupName, containerAppName, patchName, patchSkipConfig, context).block(); + } + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Patch along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> applyWithResponseAsync(String resourceGroupName, String containerAppName, + String patchName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (patchName == null) { + return Mono.error(new IllegalArgumentException("Parameter patchName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.apply(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, patchName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Patch along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> applyWithResponseAsync(String resourceGroupName, String containerAppName, + String patchName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (patchName == null) { + return Mono.error(new IllegalArgumentException("Parameter patchName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.apply(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, patchName, accept, context); + } + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App Patch. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerAppsPatchResourceInner> + beginApplyAsync(String resourceGroupName, String containerAppName, String patchName) { + Mono>> mono = applyWithResponseAsync(resourceGroupName, containerAppName, patchName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ContainerAppsPatchResourceInner.class, ContainerAppsPatchResourceInner.class, + this.client.getContext()); + } + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App Patch. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerAppsPatchResourceInner> + beginApplyAsync(String resourceGroupName, String containerAppName, String patchName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = applyWithResponseAsync(resourceGroupName, containerAppName, patchName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ContainerAppsPatchResourceInner.class, ContainerAppsPatchResourceInner.class, + context); + } + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Patch. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerAppsPatchResourceInner> + beginApply(String resourceGroupName, String containerAppName, String patchName) { + return this.beginApplyAsync(resourceGroupName, containerAppName, patchName).getSyncPoller(); + } + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Patch. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerAppsPatchResourceInner> + beginApply(String resourceGroupName, String containerAppName, String patchName, Context context) { + return this.beginApplyAsync(resourceGroupName, containerAppName, patchName, context).getSyncPoller(); + } + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Patch on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono applyAsync(String resourceGroupName, String containerAppName, + String patchName) { + return beginApplyAsync(resourceGroupName, containerAppName, patchName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Patch on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono applyAsync(String resourceGroupName, String containerAppName, + String patchName, Context context) { + return beginApplyAsync(resourceGroupName, containerAppName, patchName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Patch. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAppsPatchResourceInner apply(String resourceGroupName, String containerAppName, String patchName) { + return applyAsync(resourceGroupName, containerAppName, patchName).block(); + } + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Patch. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAppsPatchResourceInner apply(String resourceGroupName, String containerAppName, String patchName, + Context context) { + return applyAsync(resourceGroupName, containerAppName, patchName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByContainerAppNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByContainerAppNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByContainerAppNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByContainerAppNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsPatchesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsPatchesImpl.java new file mode 100644 index 0000000000000..e37f354e487cd --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsPatchesImpl.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsPatchesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsPatchResourceInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsPatches; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsPatchResource; +import com.azure.resourcemanager.appcontainers.models.PatchSkipConfig; + +public final class ContainerAppsPatchesImpl implements ContainerAppsPatches { + private static final ClientLogger LOGGER = new ClientLogger(ContainerAppsPatchesImpl.class); + + private final ContainerAppsPatchesClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public ContainerAppsPatchesImpl(ContainerAppsPatchesClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByContainerApp(String resourceGroupName, + String containerAppName) { + PagedIterable inner + = this.serviceClient().listByContainerApp(resourceGroupName, containerAppName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ContainerAppsPatchResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByContainerApp(String resourceGroupName, + String containerAppName, String filter, Context context) { + PagedIterable inner + = this.serviceClient().listByContainerApp(resourceGroupName, containerAppName, filter, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ContainerAppsPatchResourceImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String containerAppName, + String patchName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, containerAppName, patchName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ContainerAppsPatchResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContainerAppsPatchResource get(String resourceGroupName, String containerAppName, String patchName) { + ContainerAppsPatchResourceInner inner + = this.serviceClient().get(resourceGroupName, containerAppName, patchName); + if (inner != null) { + return new ContainerAppsPatchResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String containerAppName, String patchName) { + this.serviceClient().delete(resourceGroupName, containerAppName, patchName); + } + + public void delete(String resourceGroupName, String containerAppName, String patchName, Context context) { + this.serviceClient().delete(resourceGroupName, containerAppName, patchName, context); + } + + public void skipConfigure(String resourceGroupName, String containerAppName, String patchName, + PatchSkipConfig patchSkipConfig) { + this.serviceClient().skipConfigure(resourceGroupName, containerAppName, patchName, patchSkipConfig); + } + + public void skipConfigure(String resourceGroupName, String containerAppName, String patchName, + PatchSkipConfig patchSkipConfig, Context context) { + this.serviceClient().skipConfigure(resourceGroupName, containerAppName, patchName, patchSkipConfig, context); + } + + public ContainerAppsPatchResource apply(String resourceGroupName, String containerAppName, String patchName) { + ContainerAppsPatchResourceInner inner + = this.serviceClient().apply(resourceGroupName, containerAppName, patchName); + if (inner != null) { + return new ContainerAppsPatchResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public ContainerAppsPatchResource apply(String resourceGroupName, String containerAppName, String patchName, + Context context) { + ContainerAppsPatchResourceInner inner + = this.serviceClient().apply(resourceGroupName, containerAppName, patchName, context); + if (inner != null) { + return new ContainerAppsPatchResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private ContainerAppsPatchesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSessionPoolsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSessionPoolsClientImpl.java new file mode 100644 index 0000000000000..e929403abe0f7 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSessionPoolsClientImpl.java @@ -0,0 +1,1358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsSessionPoolsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.SessionPoolInner; +import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; +import com.azure.resourcemanager.appcontainers.models.SessionPoolCollection; +import com.azure.resourcemanager.appcontainers.models.SessionPoolUpdatableProperties; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ContainerAppsSessionPoolsClient. + */ +public final class ContainerAppsSessionPoolsClientImpl implements ContainerAppsSessionPoolsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ContainerAppsSessionPoolsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppsSessionPoolsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppsSessionPoolsClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(ContainerAppsSessionPoolsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerAppsSessionPools to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface ContainerAppsSessionPoolsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/sessionPools") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sessionPoolName") String sessionPoolName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sessionPoolName") String sessionPoolName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SessionPoolInner sessionPoolEnvelope, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sessionPoolName") String sessionPoolName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SessionPoolUpdatableProperties sessionPoolEnvelope, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sessionPoolName") String sessionPoolName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the session pools in a given subscription. + * + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the session pools in a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the session pools in a given subscription. + * + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Get the session pools in a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the session pools in a given subscription. + * + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Get the session pools in a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the session pools in a given resource group of a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given resource group of a subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the session pools in a given resource group of a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given resource group of a subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the session pools in a given resource group of a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given resource group of a subscription as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Get the session pools in a given resource group of a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given resource group of a subscription as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the session pools in a given resource group of a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given resource group of a subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Get the session pools in a given resource group of a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given resource group of a subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the properties of a session pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String sessionPoolName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sessionPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sessionPoolName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the properties of a session pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String sessionPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sessionPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sessionPoolName, this.client.getApiVersion(), accept, context); + } + + /** + * Get the properties of a session pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String sessionPoolName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sessionPoolName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the properties of a session pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String sessionPoolName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sessionPoolName, context).block(); + } + + /** + * Get the properties of a session pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionPoolInner getByResourceGroup(String resourceGroupName, String sessionPoolName) { + return getByResourceGroupWithResponse(resourceGroupName, sessionPoolName, Context.NONE).getValue(); + } + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String sessionPoolName, SessionPoolInner sessionPoolEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sessionPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); + } + if (sessionPoolEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolEnvelope is required and cannot be null.")); + } else { + sessionPoolEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sessionPoolName, this.client.getApiVersion(), sessionPoolEnvelope, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String sessionPoolName, SessionPoolInner sessionPoolEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sessionPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); + } + if (sessionPoolEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolEnvelope is required and cannot be null.")); + } else { + sessionPoolEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sessionPoolName, this.client.getApiVersion(), sessionPoolEnvelope, accept, context); + } + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SessionPoolInner> beginCreateOrUpdateAsync( + String resourceGroupName, String sessionPoolName, SessionPoolInner sessionPoolEnvelope) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SessionPoolInner.class, SessionPoolInner.class, this.client.getContext()); + } + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SessionPoolInner> beginCreateOrUpdateAsync( + String resourceGroupName, String sessionPoolName, SessionPoolInner sessionPoolEnvelope, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SessionPoolInner.class, SessionPoolInner.class, context); + } + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SessionPoolInner> beginCreateOrUpdate(String resourceGroupName, + String sessionPoolName, SessionPoolInner sessionPoolEnvelope) { + return this.beginCreateOrUpdateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope).getSyncPoller(); + } + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SessionPoolInner> beginCreateOrUpdate(String resourceGroupName, + String sessionPoolName, SessionPoolInner sessionPoolEnvelope, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope, context) + .getSyncPoller(); + } + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String sessionPoolName, + SessionPoolInner sessionPoolEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String sessionPoolName, + SessionPoolInner sessionPoolEnvelope, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionPoolInner createOrUpdate(String resourceGroupName, String sessionPoolName, + SessionPoolInner sessionPoolEnvelope) { + return createOrUpdateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope).block(); + } + + /** + * Create or update a session pool. + * + * Create or update a session pool with the given properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionPoolInner createOrUpdate(String resourceGroupName, String sessionPoolName, + SessionPoolInner sessionPoolEnvelope, Context context) { + return createOrUpdateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope, context).block(); + } + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String sessionPoolName, + SessionPoolUpdatableProperties sessionPoolEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sessionPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); + } + if (sessionPoolEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolEnvelope is required and cannot be null.")); + } else { + sessionPoolEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sessionPoolName, this.client.getApiVersion(), sessionPoolEnvelope, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String sessionPoolName, + SessionPoolUpdatableProperties sessionPoolEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sessionPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); + } + if (sessionPoolEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolEnvelope is required and cannot be null.")); + } else { + sessionPoolEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sessionPoolName, this.client.getApiVersion(), sessionPoolEnvelope, accept, context); + } + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SessionPoolInner> beginUpdateAsync(String resourceGroupName, + String sessionPoolName, SessionPoolUpdatableProperties sessionPoolEnvelope) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SessionPoolInner.class, SessionPoolInner.class, this.client.getContext()); + } + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SessionPoolInner> beginUpdateAsync(String resourceGroupName, + String sessionPoolName, SessionPoolUpdatableProperties sessionPoolEnvelope, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SessionPoolInner.class, SessionPoolInner.class, context); + } + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SessionPoolInner> beginUpdate(String resourceGroupName, + String sessionPoolName, SessionPoolUpdatableProperties sessionPoolEnvelope) { + return this.beginUpdateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope).getSyncPoller(); + } + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App session pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SessionPoolInner> beginUpdate(String resourceGroupName, + String sessionPoolName, SessionPoolUpdatableProperties sessionPoolEnvelope, Context context) { + return this.beginUpdateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope, context).getSyncPoller(); + } + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String sessionPoolName, + SessionPoolUpdatableProperties sessionPoolEnvelope) { + return beginUpdateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String sessionPoolName, + SessionPoolUpdatableProperties sessionPoolEnvelope, Context context) { + return beginUpdateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionPoolInner update(String resourceGroupName, String sessionPoolName, + SessionPoolUpdatableProperties sessionPoolEnvelope) { + return updateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope).block(); + } + + /** + * Update properties of a session pool + * + * Patches a session pool using JSON merge patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param sessionPoolEnvelope Properties used to create a session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App session pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SessionPoolInner update(String resourceGroupName, String sessionPoolName, + SessionPoolUpdatableProperties sessionPoolEnvelope, Context context) { + return updateAsync(resourceGroupName, sessionPoolName, sessionPoolEnvelope, context).block(); + } + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String sessionPoolName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sessionPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, sessionPoolName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String sessionPoolName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sessionPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + sessionPoolName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String sessionPoolName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, sessionPoolName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String sessionPoolName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, sessionPoolName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String sessionPoolName) { + return this.beginDeleteAsync(resourceGroupName, sessionPoolName).getSyncPoller(); + } + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String sessionPoolName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, sessionPoolName, context).getSyncPoller(); + } + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sessionPoolName) { + return beginDeleteAsync(resourceGroupName, sessionPoolName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sessionPoolName, Context context) { + return beginDeleteAsync(resourceGroupName, sessionPoolName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sessionPoolName) { + deleteAsync(resourceGroupName, sessionPoolName).block(); + } + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sessionPoolName, Context context) { + deleteAsync(resourceGroupName, sessionPoolName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return session pool collection Azure resource along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return session pool collection Azure resource along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return session pool collection Azure resource along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return session pool collection Azure resource along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSessionPoolsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSessionPoolsImpl.java new file mode 100644 index 0000000000000..d2d3a49315af2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSessionPoolsImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsSessionPoolsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.SessionPoolInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsSessionPools; +import com.azure.resourcemanager.appcontainers.models.SessionPool; + +public final class ContainerAppsSessionPoolsImpl implements ContainerAppsSessionPools { + private static final ClientLogger LOGGER = new ClientLogger(ContainerAppsSessionPoolsImpl.class); + + private final ContainerAppsSessionPoolsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public ContainerAppsSessionPoolsImpl(ContainerAppsSessionPoolsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionPoolImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionPoolImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionPoolImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionPoolImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String sessionPoolName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, sessionPoolName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SessionPoolImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SessionPool getByResourceGroup(String resourceGroupName, String sessionPoolName) { + SessionPoolInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, sessionPoolName); + if (inner != null) { + return new SessionPoolImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String sessionPoolName) { + this.serviceClient().delete(resourceGroupName, sessionPoolName); + } + + public void delete(String resourceGroupName, String sessionPoolName, Context context) { + this.serviceClient().delete(resourceGroupName, sessionPoolName, context); + } + + public SessionPool getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sessionPoolName = ResourceManagerUtils.getValueFromIdByName(id, "sessionPools"); + if (sessionPoolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sessionPools'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sessionPoolName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sessionPoolName = ResourceManagerUtils.getValueFromIdByName(id, "sessionPools"); + if (sessionPoolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sessionPools'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sessionPoolName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sessionPoolName = ResourceManagerUtils.getValueFromIdByName(id, "sessionPools"); + if (sessionPoolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sessionPools'.", id))); + } + this.delete(resourceGroupName, sessionPoolName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sessionPoolName = ResourceManagerUtils.getValueFromIdByName(id, "sessionPools"); + if (sessionPoolName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sessionPools'.", id))); + } + this.delete(resourceGroupName, sessionPoolName, context); + } + + private ContainerAppsSessionPoolsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public SessionPoolImpl define(String name) { + return new SessionPoolImpl(name, this.manager()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSourceControlsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSourceControlsClientImpl.java index d3602c2f77aa2..301892a4f4486 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSourceControlsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSourceControlsClientImpl.java @@ -99,7 +99,9 @@ Mono>> createOrUpdate(@HostParam("$host") String endpo @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, - @PathParam("sourceControlName") String sourceControlName, @QueryParam("api-version") String apiVersion, + @PathParam("sourceControlName") String sourceControlName, + @HeaderParam("x-ms-github-auxiliary") String xMsGithubAuxiliary, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") SourceControlInner sourceControlEnvelope, @HeaderParam("Accept") String accept, Context context); @@ -111,7 +113,10 @@ Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, - @PathParam("sourceControlName") String sourceControlName, @QueryParam("api-version") String apiVersion, + @PathParam("sourceControlName") String sourceControlName, + @HeaderParam("x-ms-github-auxiliary") String xMsGithubAuxiliary, + @QueryParam("ignoreWorkflowDeletionFailure") Boolean ignoreWorkflowDeletionFailure, + @QueryParam("deleteWorkflow") Boolean deleteWorkflow, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -412,6 +417,7 @@ public SourceControlInner get(String resourceGroupName, String containerAppName, * @param containerAppName Name of the Container App. * @param sourceControlName Name of the Container App SourceControl. * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -419,7 +425,8 @@ public SourceControlInner get(String resourceGroupName, String containerAppName, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String containerAppName, String sourceControlName, SourceControlInner sourceControlEnvelope) { + String containerAppName, String sourceControlName, SourceControlInner sourceControlEnvelope, + String xMsGithubAuxiliary) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -449,7 +456,7 @@ private Mono>> createOrUpdateWithResponseAsync(String final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, sourceControlName, this.client.getApiVersion(), + resourceGroupName, containerAppName, sourceControlName, xMsGithubAuxiliary, this.client.getApiVersion(), sourceControlEnvelope, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -461,6 +468,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param containerAppName Name of the Container App. * @param sourceControlName Name of the Container App SourceControl. * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -469,7 +477,8 @@ private Mono>> createOrUpdateWithResponseAsync(String */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String containerAppName, String sourceControlName, SourceControlInner sourceControlEnvelope, Context context) { + String containerAppName, String sourceControlName, SourceControlInner sourceControlEnvelope, + String xMsGithubAuxiliary, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -499,7 +508,31 @@ private Mono>> createOrUpdateWithResponseAsync(String final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, sourceControlName, this.client.getApiVersion(), sourceControlEnvelope, accept, context); + containerAppName, sourceControlName, xMsGithubAuxiliary, this.client.getApiVersion(), sourceControlEnvelope, + accept, context); + } + + /** + * Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param sourceControlName Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App SourceControl. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SourceControlInner> beginCreateOrUpdateAsync( + String resourceGroupName, String containerAppName, String sourceControlName, + SourceControlInner sourceControlEnvelope, String xMsGithubAuxiliary) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, containerAppName, + sourceControlName, sourceControlEnvelope, xMsGithubAuxiliary); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SourceControlInner.class, SourceControlInner.class, this.client.getContext()); } /** @@ -518,8 +551,9 @@ private Mono>> createOrUpdateWithResponseAsync(String private PollerFlux, SourceControlInner> beginCreateOrUpdateAsync( String resourceGroupName, String containerAppName, String sourceControlName, SourceControlInner sourceControlEnvelope) { + final String xMsGithubAuxiliary = null; Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, containerAppName, - sourceControlName, sourceControlEnvelope); + sourceControlName, sourceControlEnvelope, xMsGithubAuxiliary); return this.client.getLroResult(mono, this.client.getHttpPipeline(), SourceControlInner.class, SourceControlInner.class, this.client.getContext()); } @@ -531,6 +565,7 @@ private PollerFlux, SourceControlInner> beginCrea * @param containerAppName Name of the Container App. * @param sourceControlName Name of the Container App SourceControl. * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -540,10 +575,10 @@ private PollerFlux, SourceControlInner> beginCrea @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SourceControlInner> beginCreateOrUpdateAsync( String resourceGroupName, String containerAppName, String sourceControlName, - SourceControlInner sourceControlEnvelope, Context context) { + SourceControlInner sourceControlEnvelope, String xMsGithubAuxiliary, Context context) { context = this.client.mergeContext(context); Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, containerAppName, - sourceControlName, sourceControlEnvelope, context); + sourceControlName, sourceControlEnvelope, xMsGithubAuxiliary, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), SourceControlInner.class, SourceControlInner.class, context); } @@ -563,8 +598,10 @@ private PollerFlux, SourceControlInner> beginCrea @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SourceControlInner> beginCreateOrUpdate(String resourceGroupName, String containerAppName, String sourceControlName, SourceControlInner sourceControlEnvelope) { + final String xMsGithubAuxiliary = null; return this - .beginCreateOrUpdateAsync(resourceGroupName, containerAppName, sourceControlName, sourceControlEnvelope) + .beginCreateOrUpdateAsync(resourceGroupName, containerAppName, sourceControlName, sourceControlEnvelope, + xMsGithubAuxiliary) .getSyncPoller(); } @@ -575,6 +612,7 @@ public SyncPoller, SourceControlInner> beginCreat * @param containerAppName Name of the Container App. * @param sourceControlName Name of the Container App SourceControl. * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -583,13 +621,34 @@ public SyncPoller, SourceControlInner> beginCreat */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SourceControlInner> beginCreateOrUpdate(String resourceGroupName, - String containerAppName, String sourceControlName, SourceControlInner sourceControlEnvelope, Context context) { + String containerAppName, String sourceControlName, SourceControlInner sourceControlEnvelope, + String xMsGithubAuxiliary, Context context) { return this .beginCreateOrUpdateAsync(resourceGroupName, containerAppName, sourceControlName, sourceControlEnvelope, - context) + xMsGithubAuxiliary, context) .getSyncPoller(); } + /** + * Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param sourceControlName Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App SourceControl on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String containerAppName, + String sourceControlName, SourceControlInner sourceControlEnvelope, String xMsGithubAuxiliary) { + return beginCreateOrUpdateAsync(resourceGroupName, containerAppName, sourceControlName, sourceControlEnvelope, + xMsGithubAuxiliary).last().flatMap(this.client::getLroFinalResultOrError); + } + /** * Create or update the SourceControl for a Container App. * @@ -605,9 +664,9 @@ public SyncPoller, SourceControlInner> beginCreat @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String containerAppName, String sourceControlName, SourceControlInner sourceControlEnvelope) { - return beginCreateOrUpdateAsync(resourceGroupName, containerAppName, sourceControlName, sourceControlEnvelope) - .last() - .flatMap(this.client::getLroFinalResultOrError); + final String xMsGithubAuxiliary = null; + return beginCreateOrUpdateAsync(resourceGroupName, containerAppName, sourceControlName, sourceControlEnvelope, + xMsGithubAuxiliary).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -617,6 +676,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, S * @param containerAppName Name of the Container App. * @param sourceControlName Name of the Container App SourceControl. * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -625,9 +685,10 @@ private Mono createOrUpdateAsync(String resourceGroupName, S */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String containerAppName, - String sourceControlName, SourceControlInner sourceControlEnvelope, Context context) { + String sourceControlName, SourceControlInner sourceControlEnvelope, String xMsGithubAuxiliary, + Context context) { return beginCreateOrUpdateAsync(resourceGroupName, containerAppName, sourceControlName, sourceControlEnvelope, - context).last().flatMap(this.client::getLroFinalResultOrError); + xMsGithubAuxiliary, context).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -645,8 +706,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) public SourceControlInner createOrUpdate(String resourceGroupName, String containerAppName, String sourceControlName, SourceControlInner sourceControlEnvelope) { - return createOrUpdateAsync(resourceGroupName, containerAppName, sourceControlName, sourceControlEnvelope) - .block(); + final String xMsGithubAuxiliary = null; + return createOrUpdateAsync(resourceGroupName, containerAppName, sourceControlName, sourceControlEnvelope, + xMsGithubAuxiliary).block(); } /** @@ -656,6 +718,7 @@ public SourceControlInner createOrUpdate(String resourceGroupName, String contai * @param containerAppName Name of the Container App. * @param sourceControlName Name of the Container App SourceControl. * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -664,9 +727,10 @@ public SourceControlInner createOrUpdate(String resourceGroupName, String contai */ @ServiceMethod(returns = ReturnType.SINGLE) public SourceControlInner createOrUpdate(String resourceGroupName, String containerAppName, - String sourceControlName, SourceControlInner sourceControlEnvelope, Context context) { + String sourceControlName, SourceControlInner sourceControlEnvelope, String xMsGithubAuxiliary, + Context context) { return createOrUpdateAsync(resourceGroupName, containerAppName, sourceControlName, sourceControlEnvelope, - context).block(); + xMsGithubAuxiliary, context).block(); } /** @@ -675,6 +739,9 @@ public SourceControlInner createOrUpdate(String resourceGroupName, String contai * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @param sourceControlName Name of the Container App SourceControl. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. + * @param ignoreWorkflowDeletionFailure Ignore Workflow Deletion Failure. + * @param deleteWorkflow Delete workflow. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -682,7 +749,8 @@ public SourceControlInner createOrUpdate(String resourceGroupName, String contai */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String containerAppName, - String sourceControlName) { + String sourceControlName, String xMsGithubAuxiliary, Boolean ignoreWorkflowDeletionFailure, + Boolean deleteWorkflow) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -706,7 +774,8 @@ private Mono>> deleteWithResponseAsync(String resource final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, sourceControlName, this.client.getApiVersion(), accept, context)) + resourceGroupName, containerAppName, sourceControlName, xMsGithubAuxiliary, + ignoreWorkflowDeletionFailure, deleteWorkflow, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -716,6 +785,9 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @param sourceControlName Name of the Container App SourceControl. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. + * @param ignoreWorkflowDeletionFailure Ignore Workflow Deletion Failure. + * @param deleteWorkflow Delete workflow. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -724,7 +796,8 @@ private Mono>> deleteWithResponseAsync(String resource */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String containerAppName, - String sourceControlName, Context context) { + String sourceControlName, String xMsGithubAuxiliary, Boolean ignoreWorkflowDeletionFailure, + Boolean deleteWorkflow, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -748,7 +821,32 @@ private Mono>> deleteWithResponseAsync(String resource final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, sourceControlName, this.client.getApiVersion(), accept, context); + containerAppName, sourceControlName, xMsGithubAuxiliary, ignoreWorkflowDeletionFailure, deleteWorkflow, + this.client.getApiVersion(), accept, context); + } + + /** + * Delete a Container App SourceControl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param sourceControlName Name of the Container App SourceControl. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. + * @param ignoreWorkflowDeletionFailure Ignore Workflow Deletion Failure. + * @param deleteWorkflow Delete workflow. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String containerAppName, + String sourceControlName, String xMsGithubAuxiliary, Boolean ignoreWorkflowDeletionFailure, + Boolean deleteWorkflow) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerAppName, + sourceControlName, xMsGithubAuxiliary, ignoreWorkflowDeletionFailure, deleteWorkflow); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** @@ -765,8 +863,11 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String containerAppName, String sourceControlName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, containerAppName, sourceControlName); + final String xMsGithubAuxiliary = null; + final Boolean ignoreWorkflowDeletionFailure = null; + final Boolean deleteWorkflow = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerAppName, + sourceControlName, xMsGithubAuxiliary, ignoreWorkflowDeletionFailure, deleteWorkflow); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } @@ -777,6 +878,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @param sourceControlName Name of the Container App SourceControl. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. + * @param ignoreWorkflowDeletionFailure Ignore Workflow Deletion Failure. + * @param deleteWorkflow Delete workflow. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -785,10 +889,11 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String containerAppName, - String sourceControlName, Context context) { + String sourceControlName, String xMsGithubAuxiliary, Boolean ignoreWorkflowDeletionFailure, + Boolean deleteWorkflow, Context context) { context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, containerAppName, sourceControlName, context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerAppName, + sourceControlName, xMsGithubAuxiliary, ignoreWorkflowDeletionFailure, deleteWorkflow, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } @@ -807,7 +912,13 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String containerAppName, String sourceControlName) { - return this.beginDeleteAsync(resourceGroupName, containerAppName, sourceControlName).getSyncPoller(); + final String xMsGithubAuxiliary = null; + final Boolean ignoreWorkflowDeletionFailure = null; + final Boolean deleteWorkflow = null; + return this + .beginDeleteAsync(resourceGroupName, containerAppName, sourceControlName, xMsGithubAuxiliary, + ignoreWorkflowDeletionFailure, deleteWorkflow) + .getSyncPoller(); } /** @@ -816,6 +927,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @param sourceControlName Name of the Container App SourceControl. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. + * @param ignoreWorkflowDeletionFailure Ignore Workflow Deletion Failure. + * @param deleteWorkflow Delete workflow. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -824,8 +938,33 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String containerAppName, - String sourceControlName, Context context) { - return this.beginDeleteAsync(resourceGroupName, containerAppName, sourceControlName, context).getSyncPoller(); + String sourceControlName, String xMsGithubAuxiliary, Boolean ignoreWorkflowDeletionFailure, + Boolean deleteWorkflow, Context context) { + return this + .beginDeleteAsync(resourceGroupName, containerAppName, sourceControlName, xMsGithubAuxiliary, + ignoreWorkflowDeletionFailure, deleteWorkflow, context) + .getSyncPoller(); + } + + /** + * Delete a Container App SourceControl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param sourceControlName Name of the Container App SourceControl. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. + * @param ignoreWorkflowDeletionFailure Ignore Workflow Deletion Failure. + * @param deleteWorkflow Delete workflow. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String containerAppName, String sourceControlName, + String xMsGithubAuxiliary, Boolean ignoreWorkflowDeletionFailure, Boolean deleteWorkflow) { + return beginDeleteAsync(resourceGroupName, containerAppName, sourceControlName, xMsGithubAuxiliary, + ignoreWorkflowDeletionFailure, deleteWorkflow).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -841,8 +980,11 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String containerAppName, String sourceControlName) { - return beginDeleteAsync(resourceGroupName, containerAppName, sourceControlName).last() - .flatMap(this.client::getLroFinalResultOrError); + final String xMsGithubAuxiliary = null; + final Boolean ignoreWorkflowDeletionFailure = null; + final Boolean deleteWorkflow = null; + return beginDeleteAsync(resourceGroupName, containerAppName, sourceControlName, xMsGithubAuxiliary, + ignoreWorkflowDeletionFailure, deleteWorkflow).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -851,6 +993,9 @@ private Mono deleteAsync(String resourceGroupName, String containerAppName * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @param sourceControlName Name of the Container App SourceControl. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. + * @param ignoreWorkflowDeletionFailure Ignore Workflow Deletion Failure. + * @param deleteWorkflow Delete workflow. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -859,8 +1004,9 @@ private Mono deleteAsync(String resourceGroupName, String containerAppName */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String containerAppName, String sourceControlName, - Context context) { - return beginDeleteAsync(resourceGroupName, containerAppName, sourceControlName, context).last() + String xMsGithubAuxiliary, Boolean ignoreWorkflowDeletionFailure, Boolean deleteWorkflow, Context context) { + return beginDeleteAsync(resourceGroupName, containerAppName, sourceControlName, xMsGithubAuxiliary, + ignoreWorkflowDeletionFailure, deleteWorkflow, context).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -876,7 +1022,11 @@ private Mono deleteAsync(String resourceGroupName, String containerAppName */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String containerAppName, String sourceControlName) { - deleteAsync(resourceGroupName, containerAppName, sourceControlName).block(); + final String xMsGithubAuxiliary = null; + final Boolean ignoreWorkflowDeletionFailure = null; + final Boolean deleteWorkflow = null; + deleteAsync(resourceGroupName, containerAppName, sourceControlName, xMsGithubAuxiliary, + ignoreWorkflowDeletionFailure, deleteWorkflow).block(); } /** @@ -885,14 +1035,19 @@ public void delete(String resourceGroupName, String containerAppName, String sou * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @param sourceControlName Name of the Container App SourceControl. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. + * @param ignoreWorkflowDeletionFailure Ignore Workflow Deletion Failure. + * @param deleteWorkflow Delete workflow. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String containerAppName, String sourceControlName, Context context) { - deleteAsync(resourceGroupName, containerAppName, sourceControlName, context).block(); + public void delete(String resourceGroupName, String containerAppName, String sourceControlName, + String xMsGithubAuxiliary, Boolean ignoreWorkflowDeletionFailure, Boolean deleteWorkflow, Context context) { + deleteAsync(resourceGroupName, containerAppName, sourceControlName, xMsGithubAuxiliary, + ignoreWorkflowDeletionFailure, deleteWorkflow, context).block(); } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSourceControlsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSourceControlsImpl.java index 4f33cd3ab4779..cae13bfce1675 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSourceControlsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSourceControlsImpl.java @@ -65,8 +65,11 @@ public void delete(String resourceGroupName, String containerAppName, String sou this.serviceClient().delete(resourceGroupName, containerAppName, sourceControlName); } - public void delete(String resourceGroupName, String containerAppName, String sourceControlName, Context context) { - this.serviceClient().delete(resourceGroupName, containerAppName, sourceControlName, context); + public void delete(String resourceGroupName, String containerAppName, String sourceControlName, + String xMsGithubAuxiliary, Boolean ignoreWorkflowDeletionFailure, Boolean deleteWorkflow, Context context) { + this.serviceClient() + .delete(resourceGroupName, containerAppName, sourceControlName, xMsGithubAuxiliary, + ignoreWorkflowDeletionFailure, deleteWorkflow, context); } public SourceControl getById(String id) { @@ -123,10 +126,15 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'sourcecontrols'.", id))); } - this.delete(resourceGroupName, containerAppName, sourceControlName, Context.NONE); + String localXMsGithubAuxiliary = null; + Boolean localIgnoreWorkflowDeletionFailure = null; + Boolean localDeleteWorkflow = null; + this.delete(resourceGroupName, containerAppName, sourceControlName, localXMsGithubAuxiliary, + localIgnoreWorkflowDeletionFailure, localDeleteWorkflow, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { + public void deleteByIdWithResponse(String id, String xMsGithubAuxiliary, Boolean ignoreWorkflowDeletionFailure, + Boolean deleteWorkflow, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -142,7 +150,8 @@ public void deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'sourcecontrols'.", id))); } - this.delete(resourceGroupName, containerAppName, sourceControlName, context); + this.delete(resourceGroupName, containerAppName, sourceControlName, xMsGithubAuxiliary, + ignoreWorkflowDeletionFailure, deleteWorkflow, context); } private ContainerAppsSourceControlsClient serviceClient() { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentImpl.java index 38c2e00d71ad8..011522485f377 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentImpl.java @@ -9,6 +9,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentInner; import com.azure.resourcemanager.appcontainers.models.DaprComponent; +import com.azure.resourcemanager.appcontainers.models.DaprComponentServiceBinding; import com.azure.resourcemanager.appcontainers.models.DaprMetadata; import com.azure.resourcemanager.appcontainers.models.DaprSecretsCollection; import com.azure.resourcemanager.appcontainers.models.Secret; @@ -83,6 +84,15 @@ public List scopes() { } } + public List serviceComponentBind() { + List inner = this.innerModel().serviceComponentBind(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public String resourceGroupName() { return resourceGroupName; } @@ -229,4 +239,9 @@ public DaprComponentImpl withScopes(List scopes) { this.innerModel().withScopes(scopes); return this; } + + public DaprComponentImpl withServiceComponentBind(List serviceComponentBind) { + this.innerModel().withServiceComponentBind(serviceComponentBind); + return this; + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPoliciesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPoliciesClientImpl.java new file mode 100644 index 0000000000000..24a68f487a403 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPoliciesClientImpl.java @@ -0,0 +1,808 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.appcontainers.fluent.DaprComponentResiliencyPoliciesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentResiliencyPolicyInner; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPoliciesCollection; +import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DaprComponentResiliencyPoliciesClient. + */ +public final class DaprComponentResiliencyPoliciesClientImpl implements DaprComponentResiliencyPoliciesClient { + /** + * The proxy service used to perform REST calls. + */ + private final DaprComponentResiliencyPoliciesService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of DaprComponentResiliencyPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DaprComponentResiliencyPoliciesClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(DaprComponentResiliencyPoliciesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientDaprComponentResiliencyPolicies to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface DaprComponentResiliencyPoliciesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("componentName") String componentName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("componentName") String componentName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("componentName") String componentName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DaprComponentResiliencyPolicyInner daprComponentResiliencyPolicyEnvelope, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("componentName") String componentName, + @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the resiliency policies for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resiliency policies for a Dapr component along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String environmentName, String componentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, componentName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the resiliency policies for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resiliency policies for a Dapr component along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String environmentName, String componentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, environmentName, + componentName, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the resiliency policies for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resiliency policies for a Dapr component as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String environmentName, + String componentName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, environmentName, componentName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get the resiliency policies for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resiliency policies for a Dapr component as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String environmentName, + String componentName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, environmentName, componentName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the resiliency policies for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resiliency policies for a Dapr component as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName, + String componentName) { + return new PagedIterable<>(listAsync(resourceGroupName, environmentName, componentName)); + } + + /** + * Get the resiliency policies for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resiliency policies for a Dapr component as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName, + String componentName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, environmentName, componentName, context)); + } + + /** + * Get a Dapr component resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Dapr component resiliency policy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String environmentName, String componentName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, componentName, name, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Dapr component resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Dapr component resiliency policy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String environmentName, String componentName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, componentName, name, this.client.getApiVersion(), accept, context); + } + + /** + * Get a Dapr component resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Dapr component resiliency policy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String environmentName, + String componentName, String name) { + return getWithResponseAsync(resourceGroupName, environmentName, componentName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Dapr component resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Dapr component resiliency policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String environmentName, String componentName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, environmentName, componentName, name, context).block(); + } + + /** + * Get a Dapr component resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Dapr component resiliency policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DaprComponentResiliencyPolicyInner get(String resourceGroupName, String environmentName, + String componentName, String name) { + return getWithResponse(resourceGroupName, environmentName, componentName, name, Context.NONE).getValue(); + } + + /** + * Creates or updates a Dapr component resiliency policy. + * + * Creates or updates a resiliency policy for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @param daprComponentResiliencyPolicyEnvelope Configuration details of the Dapr Component Resiliency Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dapr Component Resiliency Policy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String environmentName, String componentName, String name, + DaprComponentResiliencyPolicyInner daprComponentResiliencyPolicyEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (daprComponentResiliencyPolicyEnvelope == null) { + return Mono.error(new IllegalArgumentException( + "Parameter daprComponentResiliencyPolicyEnvelope is required and cannot be null.")); + } else { + daprComponentResiliencyPolicyEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, componentName, name, this.client.getApiVersion(), + daprComponentResiliencyPolicyEnvelope, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a Dapr component resiliency policy. + * + * Creates or updates a resiliency policy for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @param daprComponentResiliencyPolicyEnvelope Configuration details of the Dapr Component Resiliency Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dapr Component Resiliency Policy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String environmentName, String componentName, String name, + DaprComponentResiliencyPolicyInner daprComponentResiliencyPolicyEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (daprComponentResiliencyPolicyEnvelope == null) { + return Mono.error(new IllegalArgumentException( + "Parameter daprComponentResiliencyPolicyEnvelope is required and cannot be null.")); + } else { + daprComponentResiliencyPolicyEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, componentName, name, this.client.getApiVersion(), daprComponentResiliencyPolicyEnvelope, + accept, context); + } + + /** + * Creates or updates a Dapr component resiliency policy. + * + * Creates or updates a resiliency policy for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @param daprComponentResiliencyPolicyEnvelope Configuration details of the Dapr Component Resiliency Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dapr Component Resiliency Policy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String environmentName, String componentName, String name, + DaprComponentResiliencyPolicyInner daprComponentResiliencyPolicyEnvelope) { + return createOrUpdateWithResponseAsync(resourceGroupName, environmentName, componentName, name, + daprComponentResiliencyPolicyEnvelope).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a Dapr component resiliency policy. + * + * Creates or updates a resiliency policy for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @param daprComponentResiliencyPolicyEnvelope Configuration details of the Dapr Component Resiliency Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dapr Component Resiliency Policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String environmentName, String componentName, String name, + DaprComponentResiliencyPolicyInner daprComponentResiliencyPolicyEnvelope, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, environmentName, componentName, name, + daprComponentResiliencyPolicyEnvelope, context).block(); + } + + /** + * Creates or updates a Dapr component resiliency policy. + * + * Creates or updates a resiliency policy for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @param daprComponentResiliencyPolicyEnvelope Configuration details of the Dapr Component Resiliency Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dapr Component Resiliency Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DaprComponentResiliencyPolicyInner createOrUpdate(String resourceGroupName, String environmentName, + String componentName, String name, DaprComponentResiliencyPolicyInner daprComponentResiliencyPolicyEnvelope) { + return createOrUpdateWithResponse(resourceGroupName, environmentName, componentName, name, + daprComponentResiliencyPolicyEnvelope, Context.NONE).getValue(); + } + + /** + * Delete a Dapr component resiliency policy. + * + * Delete a resiliency policy for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String environmentName, + String componentName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, componentName, name, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Dapr component resiliency policy. + * + * Delete a resiliency policy for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String environmentName, + String componentName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (componentName == null) { + return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, componentName, name, this.client.getApiVersion(), accept, context); + } + + /** + * Delete a Dapr component resiliency policy. + * + * Delete a resiliency policy for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String environmentName, String componentName, + String name) { + return deleteWithResponseAsync(resourceGroupName, environmentName, componentName, name) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a Dapr component resiliency policy. + * + * Delete a resiliency policy for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String environmentName, String componentName, + String name, Context context) { + return deleteWithResponseAsync(resourceGroupName, environmentName, componentName, name, context).block(); + } + + /** + * Delete a Dapr component resiliency policy. + * + * Delete a resiliency policy for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String environmentName, String componentName, String name) { + deleteWithResponse(resourceGroupName, environmentName, componentName, name, Context.NONE); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dapr Component Resiliency Policies ARM resource along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dapr Component Resiliency Policies ARM resource along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPoliciesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPoliciesImpl.java new file mode 100644 index 0000000000000..112e635dd578e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPoliciesImpl.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.DaprComponentResiliencyPoliciesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentResiliencyPolicyInner; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicies; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicy; + +public final class DaprComponentResiliencyPoliciesImpl implements DaprComponentResiliencyPolicies { + private static final ClientLogger LOGGER = new ClientLogger(DaprComponentResiliencyPoliciesImpl.class); + + private final DaprComponentResiliencyPoliciesClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public DaprComponentResiliencyPoliciesImpl(DaprComponentResiliencyPoliciesClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String environmentName, + String componentName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, environmentName, componentName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new DaprComponentResiliencyPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String environmentName, + String componentName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, environmentName, componentName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new DaprComponentResiliencyPolicyImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String environmentName, + String componentName, String name, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, environmentName, componentName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DaprComponentResiliencyPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DaprComponentResiliencyPolicy get(String resourceGroupName, String environmentName, String componentName, + String name) { + DaprComponentResiliencyPolicyInner inner + = this.serviceClient().get(resourceGroupName, environmentName, componentName, name); + if (inner != null) { + return new DaprComponentResiliencyPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String environmentName, String componentName, + String name, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, environmentName, componentName, name, context); + } + + public void delete(String resourceGroupName, String environmentName, String componentName, String name) { + this.serviceClient().delete(resourceGroupName, environmentName, componentName, name); + } + + public DaprComponentResiliencyPolicy getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String componentName = ResourceManagerUtils.getValueFromIdByName(id, "daprComponents"); + if (componentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'daprComponents'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "resiliencyPolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resiliencyPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, environmentName, componentName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String componentName = ResourceManagerUtils.getValueFromIdByName(id, "daprComponents"); + if (componentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'daprComponents'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "resiliencyPolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resiliencyPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, environmentName, componentName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String componentName = ResourceManagerUtils.getValueFromIdByName(id, "daprComponents"); + if (componentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'daprComponents'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "resiliencyPolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resiliencyPolicies'.", id))); + } + this.deleteWithResponse(resourceGroupName, environmentName, componentName, name, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String componentName = ResourceManagerUtils.getValueFromIdByName(id, "daprComponents"); + if (componentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'daprComponents'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "resiliencyPolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resiliencyPolicies'.", id))); + } + return this.deleteWithResponse(resourceGroupName, environmentName, componentName, name, context); + } + + private DaprComponentResiliencyPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public DaprComponentResiliencyPolicyImpl define(String name) { + return new DaprComponentResiliencyPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPolicyImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPolicyImpl.java new file mode 100644 index 0000000000000..0e62331b7cfff --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPolicyImpl.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentResiliencyPolicyInner; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicy; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicyConfiguration; + +public final class DaprComponentResiliencyPolicyImpl implements DaprComponentResiliencyPolicy, + DaprComponentResiliencyPolicy.Definition, DaprComponentResiliencyPolicy.Update { + private DaprComponentResiliencyPolicyInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DaprComponentResiliencyPolicyConfiguration inboundPolicy() { + return this.innerModel().inboundPolicy(); + } + + public DaprComponentResiliencyPolicyConfiguration outboundPolicy() { + return this.innerModel().outboundPolicy(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DaprComponentResiliencyPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String environmentName; + + private String componentName; + + private String name; + + public DaprComponentResiliencyPolicyImpl withExistingDaprComponent(String resourceGroupName, String environmentName, + String componentName) { + this.resourceGroupName = resourceGroupName; + this.environmentName = environmentName; + this.componentName = componentName; + return this; + } + + public DaprComponentResiliencyPolicy create() { + this.innerObject = serviceManager.serviceClient() + .getDaprComponentResiliencyPolicies() + .createOrUpdateWithResponse(resourceGroupName, environmentName, componentName, name, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public DaprComponentResiliencyPolicy create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDaprComponentResiliencyPolicies() + .createOrUpdateWithResponse(resourceGroupName, environmentName, componentName, name, this.innerModel(), + context) + .getValue(); + return this; + } + + DaprComponentResiliencyPolicyImpl(String name, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = new DaprComponentResiliencyPolicyInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public DaprComponentResiliencyPolicyImpl update() { + return this; + } + + public DaprComponentResiliencyPolicy apply() { + this.innerObject = serviceManager.serviceClient() + .getDaprComponentResiliencyPolicies() + .createOrUpdateWithResponse(resourceGroupName, environmentName, componentName, name, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public DaprComponentResiliencyPolicy apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDaprComponentResiliencyPolicies() + .createOrUpdateWithResponse(resourceGroupName, environmentName, componentName, name, this.innerModel(), + context) + .getValue(); + return this; + } + + DaprComponentResiliencyPolicyImpl(DaprComponentResiliencyPolicyInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.environmentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "managedEnvironments"); + this.componentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "daprComponents"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resiliencyPolicies"); + } + + public DaprComponentResiliencyPolicy refresh() { + this.innerObject = serviceManager.serviceClient() + .getDaprComponentResiliencyPolicies() + .getWithResponse(resourceGroupName, environmentName, componentName, name, Context.NONE) + .getValue(); + return this; + } + + public DaprComponentResiliencyPolicy refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDaprComponentResiliencyPolicies() + .getWithResponse(resourceGroupName, environmentName, componentName, name, context) + .getValue(); + return this; + } + + public DaprComponentResiliencyPolicyImpl + withInboundPolicy(DaprComponentResiliencyPolicyConfiguration inboundPolicy) { + this.innerModel().withInboundPolicy(inboundPolicy); + return this; + } + + public DaprComponentResiliencyPolicyImpl + withOutboundPolicy(DaprComponentResiliencyPolicyConfiguration outboundPolicy) { + this.innerModel().withOutboundPolicy(outboundPolicy); + return this; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSubscriptionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSubscriptionImpl.java new file mode 100644 index 0000000000000..daee523a614a0 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSubscriptionImpl.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.DaprSubscriptionInner; +import com.azure.resourcemanager.appcontainers.models.DaprSubscription; +import com.azure.resourcemanager.appcontainers.models.DaprSubscriptionBulkSubscribeOptions; +import com.azure.resourcemanager.appcontainers.models.DaprSubscriptionRoutes; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class DaprSubscriptionImpl + implements DaprSubscription, DaprSubscription.Definition, DaprSubscription.Update { + private DaprSubscriptionInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String pubsubName() { + return this.innerModel().pubsubName(); + } + + public String topic() { + return this.innerModel().topic(); + } + + public String deadLetterTopic() { + return this.innerModel().deadLetterTopic(); + } + + public DaprSubscriptionRoutes routes() { + return this.innerModel().routes(); + } + + public List scopes() { + List inner = this.innerModel().scopes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Map metadata() { + Map inner = this.innerModel().metadata(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public DaprSubscriptionBulkSubscribeOptions bulkSubscribe() { + return this.innerModel().bulkSubscribe(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DaprSubscriptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String environmentName; + + private String name; + + public DaprSubscriptionImpl withExistingManagedEnvironment(String resourceGroupName, String environmentName) { + this.resourceGroupName = resourceGroupName; + this.environmentName = environmentName; + return this; + } + + public DaprSubscription create() { + this.innerObject = serviceManager.serviceClient() + .getDaprSubscriptions() + .createOrUpdateWithResponse(resourceGroupName, environmentName, name, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public DaprSubscription create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDaprSubscriptions() + .createOrUpdateWithResponse(resourceGroupName, environmentName, name, this.innerModel(), context) + .getValue(); + return this; + } + + DaprSubscriptionImpl(String name, com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = new DaprSubscriptionInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public DaprSubscriptionImpl update() { + return this; + } + + public DaprSubscription apply() { + this.innerObject = serviceManager.serviceClient() + .getDaprSubscriptions() + .createOrUpdateWithResponse(resourceGroupName, environmentName, name, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public DaprSubscription apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDaprSubscriptions() + .createOrUpdateWithResponse(resourceGroupName, environmentName, name, this.innerModel(), context) + .getValue(); + return this; + } + + DaprSubscriptionImpl(DaprSubscriptionInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.environmentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "managedEnvironments"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "daprSubscriptions"); + } + + public DaprSubscription refresh() { + this.innerObject = serviceManager.serviceClient() + .getDaprSubscriptions() + .getWithResponse(resourceGroupName, environmentName, name, Context.NONE) + .getValue(); + return this; + } + + public DaprSubscription refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDaprSubscriptions() + .getWithResponse(resourceGroupName, environmentName, name, context) + .getValue(); + return this; + } + + public DaprSubscriptionImpl withPubsubName(String pubsubName) { + this.innerModel().withPubsubName(pubsubName); + return this; + } + + public DaprSubscriptionImpl withTopic(String topic) { + this.innerModel().withTopic(topic); + return this; + } + + public DaprSubscriptionImpl withDeadLetterTopic(String deadLetterTopic) { + this.innerModel().withDeadLetterTopic(deadLetterTopic); + return this; + } + + public DaprSubscriptionImpl withRoutes(DaprSubscriptionRoutes routes) { + this.innerModel().withRoutes(routes); + return this; + } + + public DaprSubscriptionImpl withScopes(List scopes) { + this.innerModel().withScopes(scopes); + return this; + } + + public DaprSubscriptionImpl withMetadata(Map metadata) { + this.innerModel().withMetadata(metadata); + return this; + } + + public DaprSubscriptionImpl withBulkSubscribe(DaprSubscriptionBulkSubscribeOptions bulkSubscribe) { + this.innerModel().withBulkSubscribe(bulkSubscribe); + return this; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSubscriptionsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSubscriptionsClientImpl.java new file mode 100644 index 0000000000000..9971195dff6ec --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSubscriptionsClientImpl.java @@ -0,0 +1,749 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.appcontainers.fluent.DaprSubscriptionsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.DaprSubscriptionInner; +import com.azure.resourcemanager.appcontainers.models.DaprSubscriptionsCollection; +import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DaprSubscriptionsClient. + */ +public final class DaprSubscriptionsClientImpl implements DaprSubscriptionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final DaprSubscriptionsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of DaprSubscriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DaprSubscriptionsClientImpl(ContainerAppsApiClientImpl client) { + this.service + = RestProxy.create(DaprSubscriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientDaprSubscriptions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface DaprSubscriptionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DaprSubscriptionInner daprSubscriptionEnvelope, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the Dapr subscriptions for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Dapr subscriptions for a managed environment along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String environmentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the Dapr subscriptions for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Dapr subscriptions for a managed environment along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String environmentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, environmentName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the Dapr subscriptions for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Dapr subscriptions for a managed environment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String environmentName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, environmentName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get the Dapr subscriptions for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Dapr subscriptions for a managed environment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String environmentName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, environmentName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the Dapr subscriptions for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Dapr subscriptions for a managed environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName) { + return new PagedIterable<>(listAsync(resourceGroupName, environmentName)); + } + + /** + * Get the Dapr subscriptions for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Dapr subscriptions for a managed environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, environmentName, context)); + } + + /** + * Get a dapr subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a dapr subscription along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String environmentName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, name, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a dapr subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a dapr subscription along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String environmentName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, name, this.client.getApiVersion(), accept, context); + } + + /** + * Get a dapr subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a dapr subscription on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String environmentName, String name) { + return getWithResponseAsync(resourceGroupName, environmentName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a dapr subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a dapr subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String environmentName, + String name, Context context) { + return getWithResponseAsync(resourceGroupName, environmentName, name, context).block(); + } + + /** + * Get a dapr subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a dapr subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DaprSubscriptionInner get(String resourceGroupName, String environmentName, String name) { + return getWithResponse(resourceGroupName, environmentName, name, Context.NONE).getValue(); + } + + /** + * Creates or updates a Dapr subscription. + * + * Creates or updates a Dapr subscription in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @param daprSubscriptionEnvelope Configuration details of the Dapr subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dapr PubSub Event Subscription along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String environmentName, String name, DaprSubscriptionInner daprSubscriptionEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (daprSubscriptionEnvelope == null) { + return Mono.error( + new IllegalArgumentException("Parameter daprSubscriptionEnvelope is required and cannot be null.")); + } else { + daprSubscriptionEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, name, this.client.getApiVersion(), daprSubscriptionEnvelope, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a Dapr subscription. + * + * Creates or updates a Dapr subscription in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @param daprSubscriptionEnvelope Configuration details of the Dapr subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dapr PubSub Event Subscription along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String environmentName, String name, DaprSubscriptionInner daprSubscriptionEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (daprSubscriptionEnvelope == null) { + return Mono.error( + new IllegalArgumentException("Parameter daprSubscriptionEnvelope is required and cannot be null.")); + } else { + daprSubscriptionEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, name, this.client.getApiVersion(), daprSubscriptionEnvelope, accept, context); + } + + /** + * Creates or updates a Dapr subscription. + * + * Creates or updates a Dapr subscription in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @param daprSubscriptionEnvelope Configuration details of the Dapr subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dapr PubSub Event Subscription on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String environmentName, + String name, DaprSubscriptionInner daprSubscriptionEnvelope) { + return createOrUpdateWithResponseAsync(resourceGroupName, environmentName, name, daprSubscriptionEnvelope) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a Dapr subscription. + * + * Creates or updates a Dapr subscription in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @param daprSubscriptionEnvelope Configuration details of the Dapr subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dapr PubSub Event Subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, + String name, DaprSubscriptionInner daprSubscriptionEnvelope, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, environmentName, name, daprSubscriptionEnvelope, + context).block(); + } + + /** + * Creates or updates a Dapr subscription. + * + * Creates or updates a Dapr subscription in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @param daprSubscriptionEnvelope Configuration details of the Dapr subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dapr PubSub Event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DaprSubscriptionInner createOrUpdate(String resourceGroupName, String environmentName, String name, + DaprSubscriptionInner daprSubscriptionEnvelope) { + return createOrUpdateWithResponse(resourceGroupName, environmentName, name, daprSubscriptionEnvelope, + Context.NONE).getValue(); + } + + /** + * Delete a Dapr subscription. + * + * Delete a Dapr subscription from a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String environmentName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, name, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Dapr subscription. + * + * Delete a Dapr subscription from a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String environmentName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, name, this.client.getApiVersion(), accept, context); + } + + /** + * Delete a Dapr subscription. + * + * Delete a Dapr subscription from a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String environmentName, String name) { + return deleteWithResponseAsync(resourceGroupName, environmentName, name).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a Dapr subscription. + * + * Delete a Dapr subscription from a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String environmentName, String name, + Context context) { + return deleteWithResponseAsync(resourceGroupName, environmentName, name, context).block(); + } + + /** + * Delete a Dapr subscription. + * + * Delete a Dapr subscription from a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String environmentName, String name) { + deleteWithResponse(resourceGroupName, environmentName, name, Context.NONE); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dapr Subscriptions ARM resource along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dapr Subscriptions ARM resource along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSubscriptionsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSubscriptionsImpl.java new file mode 100644 index 0000000000000..168ba34fb53da --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSubscriptionsImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.DaprSubscriptionsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.DaprSubscriptionInner; +import com.azure.resourcemanager.appcontainers.models.DaprSubscription; +import com.azure.resourcemanager.appcontainers.models.DaprSubscriptions; + +public final class DaprSubscriptionsImpl implements DaprSubscriptions { + private static final ClientLogger LOGGER = new ClientLogger(DaprSubscriptionsImpl.class); + + private final DaprSubscriptionsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public DaprSubscriptionsImpl(DaprSubscriptionsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String environmentName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, environmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DaprSubscriptionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String environmentName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, environmentName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DaprSubscriptionImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String environmentName, String name, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, environmentName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DaprSubscriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DaprSubscription get(String resourceGroupName, String environmentName, String name) { + DaprSubscriptionInner inner = this.serviceClient().get(resourceGroupName, environmentName, name); + if (inner != null) { + return new DaprSubscriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String environmentName, String name, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, environmentName, name, context); + } + + public void delete(String resourceGroupName, String environmentName, String name) { + this.serviceClient().delete(resourceGroupName, environmentName, name); + } + + public DaprSubscription getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "daprSubscriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'daprSubscriptions'.", id))); + } + return this.getWithResponse(resourceGroupName, environmentName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "daprSubscriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'daprSubscriptions'.", id))); + } + return this.getWithResponse(resourceGroupName, environmentName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "daprSubscriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'daprSubscriptions'.", id))); + } + this.deleteWithResponse(resourceGroupName, environmentName, name, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "daprSubscriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'daprSubscriptions'.", id))); + } + return this.deleteWithResponse(resourceGroupName, environmentName, name, context); + } + + private DaprSubscriptionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public DaprSubscriptionImpl define(String name) { + return new DaprSubscriptionImpl(name, this.manager()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DotNetComponentImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DotNetComponentImpl.java new file mode 100644 index 0000000000000..f6049ff1496bb --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DotNetComponentImpl.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.DotNetComponentInner; +import com.azure.resourcemanager.appcontainers.models.DotNetComponent; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentConfigurationProperty; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentProvisioningState; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentServiceBind; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentType; +import java.util.Collections; +import java.util.List; + +public final class DotNetComponentImpl implements DotNetComponent, DotNetComponent.Definition, DotNetComponent.Update { + private DotNetComponentInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DotNetComponentType componentType() { + return this.innerModel().componentType(); + } + + public DotNetComponentProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List configurations() { + List inner = this.innerModel().configurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List serviceBinds() { + List inner = this.innerModel().serviceBinds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DotNetComponentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String environmentName; + + private String name; + + public DotNetComponentImpl withExistingManagedEnvironment(String resourceGroupName, String environmentName) { + this.resourceGroupName = resourceGroupName; + this.environmentName = environmentName; + return this; + } + + public DotNetComponent create() { + this.innerObject = serviceManager.serviceClient() + .getDotNetComponents() + .createOrUpdate(resourceGroupName, environmentName, name, this.innerModel(), Context.NONE); + return this; + } + + public DotNetComponent create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDotNetComponents() + .createOrUpdate(resourceGroupName, environmentName, name, this.innerModel(), context); + return this; + } + + DotNetComponentImpl(String name, com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = new DotNetComponentInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public DotNetComponentImpl update() { + return this; + } + + public DotNetComponent apply() { + this.innerObject = serviceManager.serviceClient() + .getDotNetComponents() + .update(resourceGroupName, environmentName, name, this.innerModel(), Context.NONE); + return this; + } + + public DotNetComponent apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDotNetComponents() + .update(resourceGroupName, environmentName, name, this.innerModel(), context); + return this; + } + + DotNetComponentImpl(DotNetComponentInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.environmentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "managedEnvironments"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "dotNetComponents"); + } + + public DotNetComponent refresh() { + this.innerObject = serviceManager.serviceClient() + .getDotNetComponents() + .getWithResponse(resourceGroupName, environmentName, name, Context.NONE) + .getValue(); + return this; + } + + public DotNetComponent refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDotNetComponents() + .getWithResponse(resourceGroupName, environmentName, name, context) + .getValue(); + return this; + } + + public DotNetComponentImpl withComponentType(DotNetComponentType componentType) { + this.innerModel().withComponentType(componentType); + return this; + } + + public DotNetComponentImpl withConfigurations(List configurations) { + this.innerModel().withConfigurations(configurations); + return this; + } + + public DotNetComponentImpl withServiceBinds(List serviceBinds) { + this.innerModel().withServiceBinds(serviceBinds); + return this; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DotNetComponentsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DotNetComponentsClientImpl.java new file mode 100644 index 0000000000000..4b764f94ed6c4 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DotNetComponentsClientImpl.java @@ -0,0 +1,1235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appcontainers.fluent.DotNetComponentsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.DotNetComponentInner; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentsCollection; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DotNetComponentsClient. + */ +public final class DotNetComponentsClientImpl implements DotNetComponentsClient { + /** + * The proxy service used to perform REST calls. + */ + private final DotNetComponentsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of DotNetComponentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DotNetComponentsClientImpl(ContainerAppsApiClientImpl client) { + this.service + = RestProxy.create(DotNetComponentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientDotNetComponents to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface DotNetComponentsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DotNetComponentInner dotNetComponentEnvelope, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DotNetComponentInner dotNetComponentEnvelope, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the .NET Components for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the .NET Components for a managed environment along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String environmentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the .NET Components for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the .NET Components for a managed environment along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String environmentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, environmentName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the .NET Components for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the .NET Components for a managed environment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String environmentName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, environmentName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get the .NET Components for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the .NET Components for a managed environment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String environmentName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, environmentName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the .NET Components for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the .NET Components for a managed environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName) { + return new PagedIterable<>(listAsync(resourceGroupName, environmentName)); + } + + /** + * Get the .NET Components for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the .NET Components for a managed environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, environmentName, context)); + } + + /** + * Get a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a .NET Component along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String environmentName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, name, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a .NET Component along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String environmentName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, name, this.client.getApiVersion(), accept, context); + } + + /** + * Get a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a .NET Component on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String environmentName, String name) { + return getWithResponseAsync(resourceGroupName, environmentName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a .NET Component along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String environmentName, String name, + Context context) { + return getWithResponseAsync(resourceGroupName, environmentName, name, context).block(); + } + + /** + * Get a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a .NET Component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DotNetComponentInner get(String resourceGroupName, String environmentName, String name) { + return getWithResponse(resourceGroupName, environmentName, name, Context.NONE).getValue(); + } + + /** + * Creates or updates a .NET Component. + * + * Creates or updates a .NET Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return .NET Component along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String environmentName, String name, DotNetComponentInner dotNetComponentEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (dotNetComponentEnvelope == null) { + return Mono.error( + new IllegalArgumentException("Parameter dotNetComponentEnvelope is required and cannot be null.")); + } else { + dotNetComponentEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, name, this.client.getApiVersion(), dotNetComponentEnvelope, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a .NET Component. + * + * Creates or updates a .NET Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return .NET Component along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String environmentName, String name, DotNetComponentInner dotNetComponentEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (dotNetComponentEnvelope == null) { + return Mono.error( + new IllegalArgumentException("Parameter dotNetComponentEnvelope is required and cannot be null.")); + } else { + dotNetComponentEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, name, this.client.getApiVersion(), dotNetComponentEnvelope, accept, context); + } + + /** + * Creates or updates a .NET Component. + * + * Creates or updates a .NET Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of .NET Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DotNetComponentInner> beginCreateOrUpdateAsync( + String resourceGroupName, String environmentName, String name, DotNetComponentInner dotNetComponentEnvelope) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, environmentName, name, dotNetComponentEnvelope); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DotNetComponentInner.class, DotNetComponentInner.class, this.client.getContext()); + } + + /** + * Creates or updates a .NET Component. + * + * Creates or updates a .NET Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of .NET Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DotNetComponentInner> beginCreateOrUpdateAsync( + String resourceGroupName, String environmentName, String name, DotNetComponentInner dotNetComponentEnvelope, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, environmentName, + name, dotNetComponentEnvelope, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DotNetComponentInner.class, DotNetComponentInner.class, context); + } + + /** + * Creates or updates a .NET Component. + * + * Creates or updates a .NET Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of .NET Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DotNetComponentInner> beginCreateOrUpdate( + String resourceGroupName, String environmentName, String name, DotNetComponentInner dotNetComponentEnvelope) { + return this.beginCreateOrUpdateAsync(resourceGroupName, environmentName, name, dotNetComponentEnvelope) + .getSyncPoller(); + } + + /** + * Creates or updates a .NET Component. + * + * Creates or updates a .NET Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of .NET Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DotNetComponentInner> beginCreateOrUpdate( + String resourceGroupName, String environmentName, String name, DotNetComponentInner dotNetComponentEnvelope, + Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, environmentName, name, dotNetComponentEnvelope, context) + .getSyncPoller(); + } + + /** + * Creates or updates a .NET Component. + * + * Creates or updates a .NET Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return .NET Component on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String environmentName, + String name, DotNetComponentInner dotNetComponentEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, environmentName, name, dotNetComponentEnvelope).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a .NET Component. + * + * Creates or updates a .NET Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return .NET Component on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String environmentName, + String name, DotNetComponentInner dotNetComponentEnvelope, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, environmentName, name, dotNetComponentEnvelope, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a .NET Component. + * + * Creates or updates a .NET Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return .NET Component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DotNetComponentInner createOrUpdate(String resourceGroupName, String environmentName, String name, + DotNetComponentInner dotNetComponentEnvelope) { + return createOrUpdateAsync(resourceGroupName, environmentName, name, dotNetComponentEnvelope).block(); + } + + /** + * Creates or updates a .NET Component. + * + * Creates or updates a .NET Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return .NET Component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DotNetComponentInner createOrUpdate(String resourceGroupName, String environmentName, String name, + DotNetComponentInner dotNetComponentEnvelope, Context context) { + return createOrUpdateAsync(resourceGroupName, environmentName, name, dotNetComponentEnvelope, context).block(); + } + + /** + * Update properties of a .NET Component + * + * Patches a .NET Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return .NET Component along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String environmentName, + String name, DotNetComponentInner dotNetComponentEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (dotNetComponentEnvelope == null) { + return Mono.error( + new IllegalArgumentException("Parameter dotNetComponentEnvelope is required and cannot be null.")); + } else { + dotNetComponentEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, name, this.client.getApiVersion(), dotNetComponentEnvelope, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update properties of a .NET Component + * + * Patches a .NET Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return .NET Component along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String environmentName, + String name, DotNetComponentInner dotNetComponentEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (dotNetComponentEnvelope == null) { + return Mono.error( + new IllegalArgumentException("Parameter dotNetComponentEnvelope is required and cannot be null.")); + } else { + dotNetComponentEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, name, this.client.getApiVersion(), dotNetComponentEnvelope, accept, context); + } + + /** + * Update properties of a .NET Component + * + * Patches a .NET Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of .NET Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DotNetComponentInner> beginUpdateAsync( + String resourceGroupName, String environmentName, String name, DotNetComponentInner dotNetComponentEnvelope) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, environmentName, name, dotNetComponentEnvelope); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DotNetComponentInner.class, DotNetComponentInner.class, this.client.getContext()); + } + + /** + * Update properties of a .NET Component + * + * Patches a .NET Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of .NET Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DotNetComponentInner> beginUpdateAsync( + String resourceGroupName, String environmentName, String name, DotNetComponentInner dotNetComponentEnvelope, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, environmentName, name, dotNetComponentEnvelope, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DotNetComponentInner.class, DotNetComponentInner.class, context); + } + + /** + * Update properties of a .NET Component + * + * Patches a .NET Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of .NET Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DotNetComponentInner> beginUpdate(String resourceGroupName, + String environmentName, String name, DotNetComponentInner dotNetComponentEnvelope) { + return this.beginUpdateAsync(resourceGroupName, environmentName, name, dotNetComponentEnvelope).getSyncPoller(); + } + + /** + * Update properties of a .NET Component + * + * Patches a .NET Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of .NET Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DotNetComponentInner> beginUpdate(String resourceGroupName, + String environmentName, String name, DotNetComponentInner dotNetComponentEnvelope, Context context) { + return this.beginUpdateAsync(resourceGroupName, environmentName, name, dotNetComponentEnvelope, context) + .getSyncPoller(); + } + + /** + * Update properties of a .NET Component + * + * Patches a .NET Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return .NET Component on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String environmentName, String name, + DotNetComponentInner dotNetComponentEnvelope) { + return beginUpdateAsync(resourceGroupName, environmentName, name, dotNetComponentEnvelope).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update properties of a .NET Component + * + * Patches a .NET Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return .NET Component on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String environmentName, String name, + DotNetComponentInner dotNetComponentEnvelope, Context context) { + return beginUpdateAsync(resourceGroupName, environmentName, name, dotNetComponentEnvelope, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update properties of a .NET Component + * + * Patches a .NET Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return .NET Component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DotNetComponentInner update(String resourceGroupName, String environmentName, String name, + DotNetComponentInner dotNetComponentEnvelope) { + return updateAsync(resourceGroupName, environmentName, name, dotNetComponentEnvelope).block(); + } + + /** + * Update properties of a .NET Component + * + * Patches a .NET Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param dotNetComponentEnvelope Configuration details of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return .NET Component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DotNetComponentInner update(String resourceGroupName, String environmentName, String name, + DotNetComponentInner dotNetComponentEnvelope, Context context) { + return updateAsync(resourceGroupName, environmentName, name, dotNetComponentEnvelope, context).block(); + } + + /** + * Delete a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String environmentName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, name, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String environmentName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, name, this.client.getApiVersion(), accept, context); + } + + /** + * Delete a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String environmentName, + String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, environmentName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String environmentName, + String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, environmentName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String environmentName, + String name) { + return this.beginDeleteAsync(resourceGroupName, environmentName, name).getSyncPoller(); + } + + /** + * Delete a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String environmentName, String name, + Context context) { + return this.beginDeleteAsync(resourceGroupName, environmentName, name, context).getSyncPoller(); + } + + /** + * Delete a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String environmentName, String name) { + return beginDeleteAsync(resourceGroupName, environmentName, name).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String environmentName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, environmentName, name, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String environmentName, String name) { + deleteAsync(resourceGroupName, environmentName, name).block(); + } + + /** + * Delete a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String environmentName, String name, Context context) { + deleteAsync(resourceGroupName, environmentName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return .NET Components ARM resource along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return .NET Components ARM resource along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DotNetComponentsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DotNetComponentsImpl.java new file mode 100644 index 0000000000000..82351e9b232fb --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DotNetComponentsImpl.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.DotNetComponentsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.DotNetComponentInner; +import com.azure.resourcemanager.appcontainers.models.DotNetComponent; +import com.azure.resourcemanager.appcontainers.models.DotNetComponents; + +public final class DotNetComponentsImpl implements DotNetComponents { + private static final ClientLogger LOGGER = new ClientLogger(DotNetComponentsImpl.class); + + private final DotNetComponentsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public DotNetComponentsImpl(DotNetComponentsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String environmentName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, environmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DotNetComponentImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String environmentName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, environmentName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DotNetComponentImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String environmentName, String name, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, environmentName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DotNetComponentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DotNetComponent get(String resourceGroupName, String environmentName, String name) { + DotNetComponentInner inner = this.serviceClient().get(resourceGroupName, environmentName, name); + if (inner != null) { + return new DotNetComponentImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String environmentName, String name) { + this.serviceClient().delete(resourceGroupName, environmentName, name); + } + + public void delete(String resourceGroupName, String environmentName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, environmentName, name, context); + } + + public DotNetComponent getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "dotNetComponents"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dotNetComponents'.", id))); + } + return this.getWithResponse(resourceGroupName, environmentName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "dotNetComponents"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dotNetComponents'.", id))); + } + return this.getWithResponse(resourceGroupName, environmentName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "dotNetComponents"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dotNetComponents'.", id))); + } + this.delete(resourceGroupName, environmentName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "dotNetComponents"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dotNetComponents'.", id))); + } + this.delete(resourceGroupName, environmentName, name, context); + } + + private DotNetComponentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public DotNetComponentImpl define(String name) { + return new DotNetComponentImpl(name, this.manager()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/FunctionsExtensionsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/FunctionsExtensionsClientImpl.java new file mode 100644 index 0000000000000..5843c01b5c77b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/FunctionsExtensionsClientImpl.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.appcontainers.fluent.FunctionsExtensionsClient; +import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FunctionsExtensionsClient. + */ +public final class FunctionsExtensionsClientImpl implements FunctionsExtensionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final FunctionsExtensionsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of FunctionsExtensionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FunctionsExtensionsClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(FunctionsExtensionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientFunctionsExtensions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface FunctionsExtensionsService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/providers/Microsoft.App/functions/{functionAppName}/invoke") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> invokeFunctionsHost(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, + @PathParam("functionAppName") String functionAppName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Proxies a Functions host call to the function app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision, the parent resource. + * @param functionAppName Name of the Function App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> invokeFunctionsHostWithResponseAsync(String resourceGroupName, + String containerAppName, String revisionName, String functionAppName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (revisionName == null) { + return Mono.error(new IllegalArgumentException("Parameter revisionName is required and cannot be null.")); + } + if (functionAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter functionAppName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.invokeFunctionsHost(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, revisionName, functionAppName, + this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Proxies a Functions host call to the function app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision, the parent resource. + * @param functionAppName Name of the Function App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> invokeFunctionsHostWithResponseAsync(String resourceGroupName, + String containerAppName, String revisionName, String functionAppName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (revisionName == null) { + return Mono.error(new IllegalArgumentException("Parameter revisionName is required and cannot be null.")); + } + if (functionAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter functionAppName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.invokeFunctionsHost(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, revisionName, functionAppName, this.client.getApiVersion(), accept, + context); + } + + /** + * Proxies a Functions host call to the function app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision, the parent resource. + * @param functionAppName Name of the Function App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono invokeFunctionsHostAsync(String resourceGroupName, String containerAppName, + String revisionName, String functionAppName) { + return invokeFunctionsHostWithResponseAsync(resourceGroupName, containerAppName, revisionName, functionAppName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Proxies a Functions host call to the function app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision, the parent resource. + * @param functionAppName Name of the Function App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response invokeFunctionsHostWithResponse(String resourceGroupName, String containerAppName, + String revisionName, String functionAppName, Context context) { + return invokeFunctionsHostWithResponseAsync(resourceGroupName, containerAppName, revisionName, functionAppName, + context).block(); + } + + /** + * Proxies a Functions host call to the function app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision, the parent resource. + * @param functionAppName Name of the Function App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public String invokeFunctionsHost(String resourceGroupName, String containerAppName, String revisionName, + String functionAppName) { + return invokeFunctionsHostWithResponse(resourceGroupName, containerAppName, revisionName, functionAppName, + Context.NONE).getValue(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/FunctionsExtensionsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/FunctionsExtensionsImpl.java new file mode 100644 index 0000000000000..8db782ad9313e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/FunctionsExtensionsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.FunctionsExtensionsClient; +import com.azure.resourcemanager.appcontainers.models.FunctionsExtensions; + +public final class FunctionsExtensionsImpl implements FunctionsExtensions { + private static final ClientLogger LOGGER = new ClientLogger(FunctionsExtensionsImpl.class); + + private final FunctionsExtensionsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public FunctionsExtensionsImpl(FunctionsExtensionsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response invokeFunctionsHostWithResponse(String resourceGroupName, String containerAppName, + String revisionName, String functionAppName, Context context) { + return this.serviceClient() + .invokeFunctionsHostWithResponse(resourceGroupName, containerAppName, revisionName, functionAppName, + context); + } + + public String invokeFunctionsHost(String resourceGroupName, String containerAppName, String revisionName, + String functionAppName) { + return this.serviceClient() + .invokeFunctionsHost(resourceGroupName, containerAppName, revisionName, functionAppName); + } + + private FunctionsExtensionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JavaComponentImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JavaComponentImpl.java new file mode 100644 index 0000000000000..e061b5f4d0886 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JavaComponentImpl.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.JavaComponentInner; +import com.azure.resourcemanager.appcontainers.models.JavaComponent; +import com.azure.resourcemanager.appcontainers.models.JavaComponentProperties; + +public final class JavaComponentImpl implements JavaComponent, JavaComponent.Definition, JavaComponent.Update { + private JavaComponentInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public JavaComponentProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public JavaComponentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String environmentName; + + private String name; + + public JavaComponentImpl withExistingManagedEnvironment(String resourceGroupName, String environmentName) { + this.resourceGroupName = resourceGroupName; + this.environmentName = environmentName; + return this; + } + + public JavaComponent create() { + this.innerObject = serviceManager.serviceClient() + .getJavaComponents() + .createOrUpdate(resourceGroupName, environmentName, name, this.innerModel(), Context.NONE); + return this; + } + + public JavaComponent create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getJavaComponents() + .createOrUpdate(resourceGroupName, environmentName, name, this.innerModel(), context); + return this; + } + + JavaComponentImpl(String name, com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = new JavaComponentInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public JavaComponentImpl update() { + return this; + } + + public JavaComponent apply() { + this.innerObject = serviceManager.serviceClient() + .getJavaComponents() + .update(resourceGroupName, environmentName, name, this.innerModel(), Context.NONE); + return this; + } + + public JavaComponent apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getJavaComponents() + .update(resourceGroupName, environmentName, name, this.innerModel(), context); + return this; + } + + JavaComponentImpl(JavaComponentInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.environmentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "managedEnvironments"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "javaComponents"); + } + + public JavaComponent refresh() { + this.innerObject = serviceManager.serviceClient() + .getJavaComponents() + .getWithResponse(resourceGroupName, environmentName, name, Context.NONE) + .getValue(); + return this; + } + + public JavaComponent refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getJavaComponents() + .getWithResponse(resourceGroupName, environmentName, name, context) + .getValue(); + return this; + } + + public JavaComponentImpl withProperties(JavaComponentProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JavaComponentsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JavaComponentsClientImpl.java new file mode 100644 index 0000000000000..9c7add9910d6f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JavaComponentsClientImpl.java @@ -0,0 +1,1231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appcontainers.fluent.JavaComponentsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.JavaComponentInner; +import com.azure.resourcemanager.appcontainers.models.JavaComponentsCollection; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in JavaComponentsClient. + */ +public final class JavaComponentsClientImpl implements JavaComponentsClient { + /** + * The proxy service used to perform REST calls. + */ + private final JavaComponentsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of JavaComponentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + JavaComponentsClientImpl(ContainerAppsApiClientImpl client) { + this.service + = RestProxy.create(JavaComponentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientJavaComponents to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface JavaComponentsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") JavaComponentInner javaComponentEnvelope, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") JavaComponentInner javaComponentEnvelope, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the Java Components for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Java Components for a managed environment along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String environmentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the Java Components for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Java Components for a managed environment along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String environmentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, environmentName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the Java Components for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Java Components for a managed environment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String environmentName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, environmentName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get the Java Components for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Java Components for a managed environment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String environmentName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, environmentName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the Java Components for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Java Components for a managed environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName) { + return new PagedIterable<>(listAsync(resourceGroupName, environmentName)); + } + + /** + * Get the Java Components for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Java Components for a managed environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, environmentName, context)); + } + + /** + * Get a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Java Component along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String environmentName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, name, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Java Component along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String environmentName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, name, this.client.getApiVersion(), accept, context); + } + + /** + * Get a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Java Component on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String environmentName, String name) { + return getWithResponseAsync(resourceGroupName, environmentName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Java Component along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String environmentName, String name, + Context context) { + return getWithResponseAsync(resourceGroupName, environmentName, name, context).block(); + } + + /** + * Get a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Java Component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JavaComponentInner get(String resourceGroupName, String environmentName, String name) { + return getWithResponse(resourceGroupName, environmentName, name, Context.NONE).getValue(); + } + + /** + * Creates or updates a Java Component. + * + * Creates or updates a Java Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return java Component along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String environmentName, String name, JavaComponentInner javaComponentEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (javaComponentEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter javaComponentEnvelope is required and cannot be null.")); + } else { + javaComponentEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, name, this.client.getApiVersion(), javaComponentEnvelope, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a Java Component. + * + * Creates or updates a Java Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return java Component along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String environmentName, String name, JavaComponentInner javaComponentEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (javaComponentEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter javaComponentEnvelope is required and cannot be null.")); + } else { + javaComponentEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, name, this.client.getApiVersion(), javaComponentEnvelope, accept, context); + } + + /** + * Creates or updates a Java Component. + * + * Creates or updates a Java Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of java Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JavaComponentInner> beginCreateOrUpdateAsync( + String resourceGroupName, String environmentName, String name, JavaComponentInner javaComponentEnvelope) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, environmentName, name, javaComponentEnvelope); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + JavaComponentInner.class, JavaComponentInner.class, this.client.getContext()); + } + + /** + * Creates or updates a Java Component. + * + * Creates or updates a Java Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of java Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JavaComponentInner> beginCreateOrUpdateAsync( + String resourceGroupName, String environmentName, String name, JavaComponentInner javaComponentEnvelope, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, environmentName, name, javaComponentEnvelope, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + JavaComponentInner.class, JavaComponentInner.class, context); + } + + /** + * Creates or updates a Java Component. + * + * Creates or updates a Java Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of java Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JavaComponentInner> beginCreateOrUpdate(String resourceGroupName, + String environmentName, String name, JavaComponentInner javaComponentEnvelope) { + return this.beginCreateOrUpdateAsync(resourceGroupName, environmentName, name, javaComponentEnvelope) + .getSyncPoller(); + } + + /** + * Creates or updates a Java Component. + * + * Creates or updates a Java Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of java Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JavaComponentInner> beginCreateOrUpdate(String resourceGroupName, + String environmentName, String name, JavaComponentInner javaComponentEnvelope, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, environmentName, name, javaComponentEnvelope, context) + .getSyncPoller(); + } + + /** + * Creates or updates a Java Component. + * + * Creates or updates a Java Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return java Component on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String environmentName, String name, + JavaComponentInner javaComponentEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, environmentName, name, javaComponentEnvelope).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Java Component. + * + * Creates or updates a Java Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return java Component on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String environmentName, String name, + JavaComponentInner javaComponentEnvelope, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, environmentName, name, javaComponentEnvelope, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Java Component. + * + * Creates or updates a Java Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return java Component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JavaComponentInner createOrUpdate(String resourceGroupName, String environmentName, String name, + JavaComponentInner javaComponentEnvelope) { + return createOrUpdateAsync(resourceGroupName, environmentName, name, javaComponentEnvelope).block(); + } + + /** + * Creates or updates a Java Component. + * + * Creates or updates a Java Component in a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return java Component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JavaComponentInner createOrUpdate(String resourceGroupName, String environmentName, String name, + JavaComponentInner javaComponentEnvelope, Context context) { + return createOrUpdateAsync(resourceGroupName, environmentName, name, javaComponentEnvelope, context).block(); + } + + /** + * Update properties of a Java Component + * + * Patches a Java Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return java Component along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String environmentName, + String name, JavaComponentInner javaComponentEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (javaComponentEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter javaComponentEnvelope is required and cannot be null.")); + } else { + javaComponentEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, name, this.client.getApiVersion(), javaComponentEnvelope, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update properties of a Java Component + * + * Patches a Java Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return java Component along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String environmentName, + String name, JavaComponentInner javaComponentEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (javaComponentEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter javaComponentEnvelope is required and cannot be null.")); + } else { + javaComponentEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, name, this.client.getApiVersion(), javaComponentEnvelope, accept, context); + } + + /** + * Update properties of a Java Component + * + * Patches a Java Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of java Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JavaComponentInner> beginUpdateAsync(String resourceGroupName, + String environmentName, String name, JavaComponentInner javaComponentEnvelope) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, environmentName, name, javaComponentEnvelope); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + JavaComponentInner.class, JavaComponentInner.class, this.client.getContext()); + } + + /** + * Update properties of a Java Component + * + * Patches a Java Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of java Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JavaComponentInner> beginUpdateAsync(String resourceGroupName, + String environmentName, String name, JavaComponentInner javaComponentEnvelope, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, environmentName, name, javaComponentEnvelope, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + JavaComponentInner.class, JavaComponentInner.class, context); + } + + /** + * Update properties of a Java Component + * + * Patches a Java Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of java Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JavaComponentInner> beginUpdate(String resourceGroupName, + String environmentName, String name, JavaComponentInner javaComponentEnvelope) { + return this.beginUpdateAsync(resourceGroupName, environmentName, name, javaComponentEnvelope).getSyncPoller(); + } + + /** + * Update properties of a Java Component + * + * Patches a Java Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of java Component. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JavaComponentInner> beginUpdate(String resourceGroupName, + String environmentName, String name, JavaComponentInner javaComponentEnvelope, Context context) { + return this.beginUpdateAsync(resourceGroupName, environmentName, name, javaComponentEnvelope, context) + .getSyncPoller(); + } + + /** + * Update properties of a Java Component + * + * Patches a Java Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return java Component on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String environmentName, String name, + JavaComponentInner javaComponentEnvelope) { + return beginUpdateAsync(resourceGroupName, environmentName, name, javaComponentEnvelope).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update properties of a Java Component + * + * Patches a Java Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return java Component on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String environmentName, String name, + JavaComponentInner javaComponentEnvelope, Context context) { + return beginUpdateAsync(resourceGroupName, environmentName, name, javaComponentEnvelope, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update properties of a Java Component + * + * Patches a Java Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return java Component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JavaComponentInner update(String resourceGroupName, String environmentName, String name, + JavaComponentInner javaComponentEnvelope) { + return updateAsync(resourceGroupName, environmentName, name, javaComponentEnvelope).block(); + } + + /** + * Update properties of a Java Component + * + * Patches a Java Component using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param javaComponentEnvelope Configuration details of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return java Component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JavaComponentInner update(String resourceGroupName, String environmentName, String name, + JavaComponentInner javaComponentEnvelope, Context context) { + return updateAsync(resourceGroupName, environmentName, name, javaComponentEnvelope, context).block(); + } + + /** + * Delete a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String environmentName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, name, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String environmentName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, name, this.client.getApiVersion(), accept, context); + } + + /** + * Delete a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String environmentName, + String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, environmentName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String environmentName, + String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, environmentName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String environmentName, + String name) { + return this.beginDeleteAsync(resourceGroupName, environmentName, name).getSyncPoller(); + } + + /** + * Delete a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String environmentName, String name, + Context context) { + return this.beginDeleteAsync(resourceGroupName, environmentName, name, context).getSyncPoller(); + } + + /** + * Delete a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String environmentName, String name) { + return beginDeleteAsync(resourceGroupName, environmentName, name).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String environmentName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, environmentName, name, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String environmentName, String name) { + deleteAsync(resourceGroupName, environmentName, name).block(); + } + + /** + * Delete a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String environmentName, String name, Context context) { + deleteAsync(resourceGroupName, environmentName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return java Components ARM resource along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return java Components ARM resource along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JavaComponentsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JavaComponentsImpl.java new file mode 100644 index 0000000000000..1c820fa61d338 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JavaComponentsImpl.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.JavaComponentsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.JavaComponentInner; +import com.azure.resourcemanager.appcontainers.models.JavaComponent; +import com.azure.resourcemanager.appcontainers.models.JavaComponents; + +public final class JavaComponentsImpl implements JavaComponents { + private static final ClientLogger LOGGER = new ClientLogger(JavaComponentsImpl.class); + + private final JavaComponentsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public JavaComponentsImpl(JavaComponentsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String environmentName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, environmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new JavaComponentImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String environmentName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, environmentName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new JavaComponentImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String environmentName, String name, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, environmentName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new JavaComponentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public JavaComponent get(String resourceGroupName, String environmentName, String name) { + JavaComponentInner inner = this.serviceClient().get(resourceGroupName, environmentName, name); + if (inner != null) { + return new JavaComponentImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String environmentName, String name) { + this.serviceClient().delete(resourceGroupName, environmentName, name); + } + + public void delete(String resourceGroupName, String environmentName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, environmentName, name, context); + } + + public JavaComponent getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "javaComponents"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'javaComponents'.", id))); + } + return this.getWithResponse(resourceGroupName, environmentName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "javaComponents"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'javaComponents'.", id))); + } + return this.getWithResponse(resourceGroupName, environmentName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "javaComponents"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'javaComponents'.", id))); + } + this.delete(resourceGroupName, environmentName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "javaComponents"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'javaComponents'.", id))); + } + this.delete(resourceGroupName, environmentName, name, context); + } + + private JavaComponentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public JavaComponentImpl define(String name) { + return new JavaComponentImpl(name, this.manager()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobExecutionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobExecutionImpl.java index a763cde3740e3..48488c9bbf214 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobExecutionImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobExecutionImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.appcontainers.implementation; import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionInner; +import com.azure.resourcemanager.appcontainers.models.ExecutionStatus; import com.azure.resourcemanager.appcontainers.models.JobExecution; import com.azure.resourcemanager.appcontainers.models.JobExecutionRunningState; import com.azure.resourcemanager.appcontainers.models.JobExecutionTemplate; @@ -49,6 +50,10 @@ public JobExecutionTemplate template() { return this.innerModel().template(); } + public ExecutionStatus detailedStatus() { + return this.innerModel().detailedStatus(); + } + public JobExecutionInner innerModel() { return this.innerObject; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobImpl.java index 37cbe47a999a4..014e8ff7f026b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobImpl.java @@ -10,6 +10,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.appcontainers.fluent.models.JobInner; import com.azure.resourcemanager.appcontainers.models.ContainerAppJobExecutions; +import com.azure.resourcemanager.appcontainers.models.ExtendedLocation; import com.azure.resourcemanager.appcontainers.models.Job; import com.azure.resourcemanager.appcontainers.models.JobConfiguration; import com.azure.resourcemanager.appcontainers.models.JobExecutionBase; @@ -17,6 +18,7 @@ import com.azure.resourcemanager.appcontainers.models.JobPatchProperties; import com.azure.resourcemanager.appcontainers.models.JobPatchPropertiesProperties; import com.azure.resourcemanager.appcontainers.models.JobProvisioningState; +import com.azure.resourcemanager.appcontainers.models.JobRunningState; import com.azure.resourcemanager.appcontainers.models.JobSecretsCollection; import com.azure.resourcemanager.appcontainers.models.JobTemplate; import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; @@ -54,6 +56,10 @@ public Map tags() { } } + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + public ManagedServiceIdentity identity() { return this.innerModel().identity(); } @@ -66,6 +72,10 @@ public JobProvisioningState provisioningState() { return this.innerModel().provisioningState(); } + public JobRunningState runningState() { + return this.innerModel().runningState(); + } + public String environmentId() { return this.innerModel().environmentId(); } @@ -211,6 +221,22 @@ public JobSecretsCollection listSecrets() { return serviceManager.jobs().listSecrets(resourceGroupName, jobName); } + public Job resume() { + return serviceManager.jobs().resume(resourceGroupName, jobName); + } + + public Job resume(Context context) { + return serviceManager.jobs().resume(resourceGroupName, jobName, context); + } + + public Job suspend() { + return serviceManager.jobs().suspend(resourceGroupName, jobName); + } + + public Job suspend(Context context) { + return serviceManager.jobs().suspend(resourceGroupName, jobName, context); + } + public JobImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -231,6 +257,16 @@ public JobImpl withTags(Map tags) { } } + public JobImpl withExtendedLocation(ExtendedLocation extendedLocation) { + if (isInCreateMode()) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } else { + this.updateJobEnvelope.withExtendedLocation(extendedLocation); + return this; + } + } + public JobImpl withIdentity(ManagedServiceIdentity identity) { if (isInCreateMode()) { this.innerModel().withIdentity(identity); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsClientImpl.java index ceca65786bdb3..fb5d145690582 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsClientImpl.java @@ -27,6 +27,7 @@ import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; @@ -200,6 +201,24 @@ Mono> listSecrets(@HostParam("$host") String @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/resume") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resume(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/suspend") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> suspend(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -520,11 +539,12 @@ public DiagnosticsInner getDetector(String resourceGroupName, String jobName, St } /** + * Get the properties for a given Container App Job. + * * Get the properties of a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param apiName Proxy API Name for Container App Job. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -532,8 +552,7 @@ public DiagnosticsInner getDetector(String resourceGroupName, String jobName, St * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> proxyGetWithResponseAsync(String resourceGroupName, String jobName, - String apiName) { + private Mono> proxyGetWithResponseAsync(String resourceGroupName, String jobName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -549,9 +568,7 @@ private Mono> proxyGetWithResponseAsync(String resourceGroupN if (jobName == null) { return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); } - if (apiName == null) { - return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null.")); - } + final String apiName = "rootApi"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.proxyGet(this.client.getEndpoint(), this.client.getSubscriptionId(), @@ -560,11 +577,12 @@ private Mono> proxyGetWithResponseAsync(String resourceGroupN } /** + * Get the properties for a given Container App Job. + * * Get the properties of a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param apiName Proxy API Name for Container App Job. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -573,7 +591,7 @@ private Mono> proxyGetWithResponseAsync(String resourceGroupN * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> proxyGetWithResponseAsync(String resourceGroupName, String jobName, String apiName, + private Mono> proxyGetWithResponseAsync(String resourceGroupName, String jobName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -590,9 +608,7 @@ private Mono> proxyGetWithResponseAsync(String resourceGroupN if (jobName == null) { return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); } - if (apiName == null) { - return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null.")); - } + final String apiName = "rootApi"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.proxyGet(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, jobName, @@ -600,28 +616,29 @@ private Mono> proxyGetWithResponseAsync(String resourceGroupN } /** + * Get the properties for a given Container App Job. + * * Get the properties of a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param apiName Proxy API Name for Container App Job. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App Job on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono proxyGetAsync(String resourceGroupName, String jobName, String apiName) { - return proxyGetWithResponseAsync(resourceGroupName, jobName, apiName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono proxyGetAsync(String resourceGroupName, String jobName) { + return proxyGetWithResponseAsync(resourceGroupName, jobName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** + * Get the properties for a given Container App Job. + * * Get the properties of a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param apiName Proxy API Name for Container App Job. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -629,25 +646,25 @@ private Mono proxyGetAsync(String resourceGroupName, String jobName, S * @return the properties of a Container App Job along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response proxyGetWithResponse(String resourceGroupName, String jobName, String apiName, - Context context) { - return proxyGetWithResponseAsync(resourceGroupName, jobName, apiName, context).block(); + public Response proxyGetWithResponse(String resourceGroupName, String jobName, Context context) { + return proxyGetWithResponseAsync(resourceGroupName, jobName, context).block(); } /** + * Get the properties for a given Container App Job. + * * Get the properties of a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param apiName Proxy API Name for Container App Job. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App Job. */ @ServiceMethod(returns = ReturnType.SINGLE) - public JobInner proxyGet(String resourceGroupName, String jobName, String apiName) { - return proxyGetWithResponse(resourceGroupName, jobName, apiName, Context.NONE).getValue(); + public JobInner proxyGet(String resourceGroupName, String jobName) { + return proxyGetWithResponse(resourceGroupName, jobName, Context.NONE).getValue(); } /** @@ -2500,6 +2517,408 @@ public JobSecretsCollectionInner listSecrets(String resourceGroupName, String jo return listSecretsWithResponse(resourceGroupName, jobName, Context.NONE).getValue(); } + /** + * Resumes a suspended job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resumeWithResponseAsync(String resourceGroupName, String jobName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.resume(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resumes a suspended job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resumeWithResponseAsync(String resourceGroupName, String jobName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.resume(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), jobName, accept, context); + } + + /** + * Resumes a suspended job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobInner> beginResumeAsync(String resourceGroupName, String jobName) { + Mono>> mono = resumeWithResponseAsync(resourceGroupName, jobName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), JobInner.class, + JobInner.class, this.client.getContext()); + } + + /** + * Resumes a suspended job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobInner> beginResumeAsync(String resourceGroupName, String jobName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = resumeWithResponseAsync(resourceGroupName, jobName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), JobInner.class, + JobInner.class, context); + } + + /** + * Resumes a suspended job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobInner> beginResume(String resourceGroupName, String jobName) { + return this.beginResumeAsync(resourceGroupName, jobName).getSyncPoller(); + } + + /** + * Resumes a suspended job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobInner> beginResume(String resourceGroupName, String jobName, + Context context) { + return this.beginResumeAsync(resourceGroupName, jobName, context).getSyncPoller(); + } + + /** + * Resumes a suspended job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumeAsync(String resourceGroupName, String jobName) { + return beginResumeAsync(resourceGroupName, jobName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resumes a suspended job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumeAsync(String resourceGroupName, String jobName, Context context) { + return beginResumeAsync(resourceGroupName, jobName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resumes a suspended job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner resume(String resourceGroupName, String jobName) { + return resumeAsync(resourceGroupName, jobName).block(); + } + + /** + * Resumes a suspended job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner resume(String resourceGroupName, String jobName, Context context) { + return resumeAsync(resourceGroupName, jobName, context).block(); + } + + /** + * Suspends a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> suspendWithResponseAsync(String resourceGroupName, String jobName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.suspend(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Suspends a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> suspendWithResponseAsync(String resourceGroupName, String jobName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.suspend(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), jobName, accept, context); + } + + /** + * Suspends a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobInner> beginSuspendAsync(String resourceGroupName, String jobName) { + Mono>> mono = suspendWithResponseAsync(resourceGroupName, jobName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), JobInner.class, + JobInner.class, this.client.getContext()); + } + + /** + * Suspends a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobInner> beginSuspendAsync(String resourceGroupName, String jobName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = suspendWithResponseAsync(resourceGroupName, jobName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), JobInner.class, + JobInner.class, context); + } + + /** + * Suspends a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobInner> beginSuspend(String resourceGroupName, String jobName) { + return this.beginSuspendAsync(resourceGroupName, jobName).getSyncPoller(); + } + + /** + * Suspends a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobInner> beginSuspend(String resourceGroupName, String jobName, + Context context) { + return this.beginSuspendAsync(resourceGroupName, jobName, context).getSyncPoller(); + } + + /** + * Suspends a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono suspendAsync(String resourceGroupName, String jobName) { + return beginSuspendAsync(resourceGroupName, jobName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Suspends a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono suspendAsync(String resourceGroupName, String jobName, Context context) { + return beginSuspendAsync(resourceGroupName, jobName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Suspends a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner suspend(String resourceGroupName, String jobName) { + return suspendAsync(resourceGroupName, jobName).block(); + } + + /** + * Suspends a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner suspend(String resourceGroupName, String jobName, Context context) { + return suspendAsync(resourceGroupName, jobName, context).block(); + } + /** * Get the next page of items. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsImpl.java index 230692244b95b..0cefdf55e27b9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsImpl.java @@ -67,10 +67,8 @@ public Diagnostics getDetector(String resourceGroupName, String jobName, String } } - public Response proxyGetWithResponse(String resourceGroupName, String jobName, String apiName, - Context context) { - Response inner - = this.serviceClient().proxyGetWithResponse(resourceGroupName, jobName, apiName, context); + public Response proxyGetWithResponse(String resourceGroupName, String jobName, Context context) { + Response inner = this.serviceClient().proxyGetWithResponse(resourceGroupName, jobName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new JobImpl(inner.getValue(), this.manager())); @@ -79,8 +77,8 @@ public Response proxyGetWithResponse(String resourceGroupName, String jobNa } } - public Job proxyGet(String resourceGroupName, String jobName, String apiName) { - JobInner inner = this.serviceClient().proxyGet(resourceGroupName, jobName, apiName); + public Job proxyGet(String resourceGroupName, String jobName) { + JobInner inner = this.serviceClient().proxyGet(resourceGroupName, jobName); if (inner != null) { return new JobImpl(inner, this.manager()); } else { @@ -203,6 +201,42 @@ public JobSecretsCollection listSecrets(String resourceGroupName, String jobName } } + public Job resume(String resourceGroupName, String jobName) { + JobInner inner = this.serviceClient().resume(resourceGroupName, jobName); + if (inner != null) { + return new JobImpl(inner, this.manager()); + } else { + return null; + } + } + + public Job resume(String resourceGroupName, String jobName, Context context) { + JobInner inner = this.serviceClient().resume(resourceGroupName, jobName, context); + if (inner != null) { + return new JobImpl(inner, this.manager()); + } else { + return null; + } + } + + public Job suspend(String resourceGroupName, String jobName) { + JobInner inner = this.serviceClient().suspend(resourceGroupName, jobName); + if (inner != null) { + return new JobImpl(inner, this.manager()); + } else { + return null; + } + } + + public Job suspend(String resourceGroupName, String jobName, Context context) { + JobInner inner = this.serviceClient().suspend(resourceGroupName, jobName, context); + if (inner != null) { + return new JobImpl(inner, this.manager()); + } else { + return null; + } + } + public Job getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LogicAppImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LogicAppImpl.java new file mode 100644 index 0000000000000..101a332d0e4ed --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LogicAppImpl.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.LogicAppInner; +import com.azure.resourcemanager.appcontainers.models.LogicApp; +import com.azure.resourcemanager.appcontainers.models.WorkflowArtifacts; +import com.azure.resourcemanager.appcontainers.models.WorkflowEnvelope; + +public final class LogicAppImpl implements LogicApp, LogicApp.Definition, LogicApp.Update { + private LogicAppInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Object properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public LogicAppInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String containerAppName; + + private String logicAppName; + + public LogicAppImpl withExistingContainerApp(String resourceGroupName, String containerAppName) { + this.resourceGroupName = resourceGroupName; + this.containerAppName = containerAppName; + return this; + } + + public LogicApp create() { + this.innerObject = serviceManager.serviceClient() + .getLogicApps() + .createOrUpdateWithResponse(resourceGroupName, containerAppName, logicAppName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public LogicApp create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLogicApps() + .createOrUpdateWithResponse(resourceGroupName, containerAppName, logicAppName, this.innerModel(), context) + .getValue(); + return this; + } + + LogicAppImpl(String name, com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = new LogicAppInner(); + this.serviceManager = serviceManager; + this.logicAppName = name; + } + + public LogicAppImpl update() { + return this; + } + + public LogicApp apply() { + this.innerObject = serviceManager.serviceClient() + .getLogicApps() + .createOrUpdateWithResponse(resourceGroupName, containerAppName, logicAppName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public LogicApp apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLogicApps() + .createOrUpdateWithResponse(resourceGroupName, containerAppName, logicAppName, this.innerModel(), context) + .getValue(); + return this; + } + + LogicAppImpl(LogicAppInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.containerAppName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "containerApps"); + this.logicAppName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "logicApps"); + } + + public LogicApp refresh() { + this.innerObject = serviceManager.serviceClient() + .getLogicApps() + .getWithResponse(resourceGroupName, containerAppName, logicAppName, Context.NONE) + .getValue(); + return this; + } + + public LogicApp refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLogicApps() + .getWithResponse(resourceGroupName, containerAppName, logicAppName, context) + .getValue(); + return this; + } + + public Response deployWorkflowArtifactsWithResponse(WorkflowArtifacts workflowArtifacts, Context context) { + return serviceManager.logicApps() + .deployWorkflowArtifactsWithResponse(resourceGroupName, containerAppName, logicAppName, workflowArtifacts, + context); + } + + public void deployWorkflowArtifacts() { + serviceManager.logicApps().deployWorkflowArtifacts(resourceGroupName, containerAppName, logicAppName); + } + + public Response listWorkflowsConnectionsWithResponse(Context context) { + return serviceManager.logicApps() + .listWorkflowsConnectionsWithResponse(resourceGroupName, containerAppName, logicAppName, context); + } + + public WorkflowEnvelope listWorkflowsConnections() { + return serviceManager.logicApps().listWorkflowsConnections(resourceGroupName, containerAppName, logicAppName); + } + + public LogicAppImpl withProperties(Object properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LogicAppsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LogicAppsClientImpl.java new file mode 100644 index 0000000000000..8c6c8f39a707e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LogicAppsClientImpl.java @@ -0,0 +1,1386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.appcontainers.fluent.LogicAppsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.LogicAppInner; +import com.azure.resourcemanager.appcontainers.fluent.models.WorkflowEnvelopeInner; +import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; +import com.azure.resourcemanager.appcontainers.models.LogicAppsProxyMethod; +import com.azure.resourcemanager.appcontainers.models.WorkflowArtifacts; +import com.azure.resourcemanager.appcontainers.models.WorkflowEnvelopeCollection; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in LogicAppsClient. + */ +public final class LogicAppsClientImpl implements LogicAppsClient { + /** + * The proxy service used to perform REST calls. + */ + private final LogicAppsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of LogicAppsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LogicAppsClientImpl(ContainerAppsApiClientImpl client) { + this.service + = RestProxy.create(LogicAppsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientLogicApps to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface LogicAppsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("logicAppName") String logicAppName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("logicAppName") String logicAppName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") LogicAppInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("logicAppName") String logicAppName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listWorkflows(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("logicAppName") String logicAppName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows/{workflowName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> getWorkflow(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("logicAppName") String logicAppName, + @PathParam("workflowName") String workflowName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/deployWorkflowArtifacts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> deployWorkflowArtifacts(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("logicAppName") String logicAppName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") WorkflowArtifacts workflowArtifacts, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/listWorkflowsConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listWorkflowsConnections(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("logicAppName") String logicAppName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/invoke") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> invoke(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("logicAppName") String logicAppName, + @HeaderParam("x-ms-logicApps-proxy-path") String xMsLogicAppsProxyPath, + @HeaderParam("x-ms-logicApps-proxy-method") LogicAppsProxyMethod xMsLogicAppsProxyMethod, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listWorkflowsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a logic app extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String containerAppName, + String logicAppName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, logicAppName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a logic app extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String containerAppName, + String logicAppName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + containerAppName, logicAppName, this.client.getApiVersion(), accept, context); + } + + /** + * Gets a logic app extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String containerAppName, String logicAppName) { + return getWithResponseAsync(resourceGroupName, containerAppName, logicAppName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a logic app extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, Context context) { + return getWithResponseAsync(resourceGroupName, containerAppName, logicAppName, context).block(); + } + + /** + * Gets a logic app extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogicAppInner get(String resourceGroupName, String containerAppName, String logicAppName) { + return getWithResponse(resourceGroupName, containerAppName, logicAppName, Context.NONE).getValue(); + } + + /** + * Create or update a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param resource Logic app resource properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String containerAppName, String logicAppName, LogicAppInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, logicAppName, this.client.getApiVersion(), resource, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param resource Logic app resource properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String containerAppName, String logicAppName, LogicAppInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + containerAppName, logicAppName, this.client.getApiVersion(), resource, accept, context); + } + + /** + * Create or update a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param resource Logic app resource properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String containerAppName, + String logicAppName, LogicAppInner resource) { + return createOrUpdateWithResponseAsync(resourceGroupName, containerAppName, logicAppName, resource) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param resource Logic app resource properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, LogicAppInner resource, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, containerAppName, logicAppName, resource, context) + .block(); + } + + /** + * Create or update a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param resource Logic app resource properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogicAppInner createOrUpdate(String resourceGroupName, String containerAppName, String logicAppName, + LogicAppInner resource) { + return createOrUpdateWithResponse(resourceGroupName, containerAppName, logicAppName, resource, Context.NONE) + .getValue(); + } + + /** + * Deletes a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String containerAppName, + String logicAppName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, logicAppName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String containerAppName, + String logicAppName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + containerAppName, logicAppName, this.client.getApiVersion(), accept, context); + } + + /** + * Deletes a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String containerAppName, String logicAppName) { + return deleteWithResponseAsync(resourceGroupName, containerAppName, logicAppName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, containerAppName, logicAppName, context).block(); + } + + /** + * Deletes a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String containerAppName, String logicAppName) { + deleteWithResponse(resourceGroupName, containerAppName, logicAppName, Context.NONE); + } + + /** + * List the workflows for a logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWorkflowsSinglePageAsync(String resourceGroupName, + String containerAppName, String logicAppName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listWorkflows(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, logicAppName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the workflows for a logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWorkflowsSinglePageAsync(String resourceGroupName, + String containerAppName, String logicAppName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listWorkflows(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + containerAppName, logicAppName, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List the workflows for a logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listWorkflowsAsync(String resourceGroupName, String containerAppName, + String logicAppName) { + return new PagedFlux<>(() -> listWorkflowsSinglePageAsync(resourceGroupName, containerAppName, logicAppName), + nextLink -> listWorkflowsNextSinglePageAsync(nextLink)); + } + + /** + * List the workflows for a logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listWorkflowsAsync(String resourceGroupName, String containerAppName, + String logicAppName, Context context) { + return new PagedFlux<>( + () -> listWorkflowsSinglePageAsync(resourceGroupName, containerAppName, logicAppName, context), + nextLink -> listWorkflowsNextSinglePageAsync(nextLink, context)); + } + + /** + * List the workflows for a logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + String logicAppName) { + return new PagedIterable<>(listWorkflowsAsync(resourceGroupName, containerAppName, logicAppName)); + } + + /** + * List the workflows for a logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + String logicAppName, Context context) { + return new PagedIterable<>(listWorkflowsAsync(resourceGroupName, containerAppName, logicAppName, context)); + } + + /** + * Get workflow information by its name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowName Workflow name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflow information by its name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWorkflowWithResponseAsync(String resourceGroupName, + String containerAppName, String logicAppName, String workflowName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + if (workflowName == null) { + return Mono.error(new IllegalArgumentException("Parameter workflowName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getWorkflow(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, logicAppName, workflowName, this.client.getApiVersion(), accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get workflow information by its name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowName Workflow name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflow information by its name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWorkflowWithResponseAsync(String resourceGroupName, + String containerAppName, String logicAppName, String workflowName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + if (workflowName == null) { + return Mono.error(new IllegalArgumentException("Parameter workflowName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getWorkflow(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + containerAppName, logicAppName, workflowName, this.client.getApiVersion(), accept, context); + } + + /** + * Get workflow information by its name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowName Workflow name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflow information by its name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWorkflowAsync(String resourceGroupName, String containerAppName, + String logicAppName, String workflowName) { + return getWorkflowWithResponseAsync(resourceGroupName, containerAppName, logicAppName, workflowName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get workflow information by its name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowName Workflow name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflow information by its name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWorkflowWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, String workflowName, Context context) { + return getWorkflowWithResponseAsync(resourceGroupName, containerAppName, logicAppName, workflowName, context) + .block(); + } + + /** + * Get workflow information by its name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowName Workflow name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflow information by its name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkflowEnvelopeInner getWorkflow(String resourceGroupName, String containerAppName, String logicAppName, + String workflowName) { + return getWorkflowWithResponse(resourceGroupName, containerAppName, logicAppName, workflowName, Context.NONE) + .getValue(); + } + + /** + * Creates or updates the artifacts for the logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowArtifacts Application settings and files of the workflow. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deployWorkflowArtifactsWithResponseAsync(String resourceGroupName, + String containerAppName, String logicAppName, WorkflowArtifacts workflowArtifacts) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + if (workflowArtifacts != null) { + workflowArtifacts.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.deployWorkflowArtifacts(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, logicAppName, + this.client.getApiVersion(), workflowArtifacts, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the artifacts for the logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowArtifacts Application settings and files of the workflow. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deployWorkflowArtifactsWithResponseAsync(String resourceGroupName, + String containerAppName, String logicAppName, WorkflowArtifacts workflowArtifacts, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + if (workflowArtifacts != null) { + workflowArtifacts.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.deployWorkflowArtifacts(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, logicAppName, this.client.getApiVersion(), workflowArtifacts, accept, + context); + } + + /** + * Creates or updates the artifacts for the logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deployWorkflowArtifactsAsync(String resourceGroupName, String containerAppName, + String logicAppName) { + final WorkflowArtifacts workflowArtifacts = null; + return deployWorkflowArtifactsWithResponseAsync(resourceGroupName, containerAppName, logicAppName, + workflowArtifacts).flatMap(ignored -> Mono.empty()); + } + + /** + * Creates or updates the artifacts for the logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowArtifacts Application settings and files of the workflow. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deployWorkflowArtifactsWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, WorkflowArtifacts workflowArtifacts, Context context) { + return deployWorkflowArtifactsWithResponseAsync(resourceGroupName, containerAppName, logicAppName, + workflowArtifacts, context).block(); + } + + /** + * Creates or updates the artifacts for the logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deployWorkflowArtifacts(String resourceGroupName, String containerAppName, String logicAppName) { + final WorkflowArtifacts workflowArtifacts = null; + deployWorkflowArtifactsWithResponse(resourceGroupName, containerAppName, logicAppName, workflowArtifacts, + Context.NONE); + } + + /** + * Gets logic app's connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWorkflowsConnectionsWithResponseAsync(String resourceGroupName, + String containerAppName, String logicAppName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listWorkflowsConnections(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, logicAppName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets logic app's connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWorkflowsConnectionsWithResponseAsync(String resourceGroupName, + String containerAppName, String logicAppName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listWorkflowsConnections(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, logicAppName, this.client.getApiVersion(), accept, context); + } + + /** + * Gets logic app's connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listWorkflowsConnectionsAsync(String resourceGroupName, String containerAppName, + String logicAppName) { + return listWorkflowsConnectionsWithResponseAsync(resourceGroupName, containerAppName, logicAppName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets logic app's connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWorkflowsConnectionsWithResponse(String resourceGroupName, + String containerAppName, String logicAppName, Context context) { + return listWorkflowsConnectionsWithResponseAsync(resourceGroupName, containerAppName, logicAppName, context) + .block(); + } + + /** + * Gets logic app's connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkflowEnvelopeInner listWorkflowsConnections(String resourceGroupName, String containerAppName, + String logicAppName) { + return listWorkflowsConnectionsWithResponse(resourceGroupName, containerAppName, logicAppName, Context.NONE) + .getValue(); + } + + /** + * Proxies a the API call to the logic app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the LogicApp App, the extension resource. + * @param xMsLogicAppsProxyPath The proxy path for the API call. + * @param xMsLogicAppsProxyMethod The proxy method for the API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> invokeWithResponseAsync(String resourceGroupName, String containerAppName, + String logicAppName, String xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + if (xMsLogicAppsProxyPath == null) { + return Mono + .error(new IllegalArgumentException("Parameter xMsLogicAppsProxyPath is required and cannot be null.")); + } + if (xMsLogicAppsProxyMethod == null) { + return Mono.error( + new IllegalArgumentException("Parameter xMsLogicAppsProxyMethod is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.invoke(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, logicAppName, xMsLogicAppsProxyPath, xMsLogicAppsProxyMethod, + this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Proxies a the API call to the logic app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the LogicApp App, the extension resource. + * @param xMsLogicAppsProxyPath The proxy path for the API call. + * @param xMsLogicAppsProxyMethod The proxy method for the API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> invokeWithResponseAsync(String resourceGroupName, String containerAppName, + String logicAppName, String xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (logicAppName == null) { + return Mono.error(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); + } + if (xMsLogicAppsProxyPath == null) { + return Mono + .error(new IllegalArgumentException("Parameter xMsLogicAppsProxyPath is required and cannot be null.")); + } + if (xMsLogicAppsProxyMethod == null) { + return Mono.error( + new IllegalArgumentException("Parameter xMsLogicAppsProxyMethod is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.invoke(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + containerAppName, logicAppName, xMsLogicAppsProxyPath, xMsLogicAppsProxyMethod, this.client.getApiVersion(), + accept, context); + } + + /** + * Proxies a the API call to the logic app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the LogicApp App, the extension resource. + * @param xMsLogicAppsProxyPath The proxy path for the API call. + * @param xMsLogicAppsProxyMethod The proxy method for the API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono invokeAsync(String resourceGroupName, String containerAppName, String logicAppName, + String xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod) { + return invokeWithResponseAsync(resourceGroupName, containerAppName, logicAppName, xMsLogicAppsProxyPath, + xMsLogicAppsProxyMethod).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Proxies a the API call to the logic app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the LogicApp App, the extension resource. + * @param xMsLogicAppsProxyPath The proxy path for the API call. + * @param xMsLogicAppsProxyMethod The proxy method for the API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response invokeWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + String xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod, Context context) { + return invokeWithResponseAsync(resourceGroupName, containerAppName, logicAppName, xMsLogicAppsProxyPath, + xMsLogicAppsProxyMethod, context).block(); + } + + /** + * Proxies a the API call to the logic app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the LogicApp App, the extension resource. + * @param xMsLogicAppsProxyPath The proxy path for the API call. + * @param xMsLogicAppsProxyMethod The proxy method for the API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Object invoke(String resourceGroupName, String containerAppName, String logicAppName, + String xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod) { + return invokeWithResponse(resourceGroupName, containerAppName, logicAppName, xMsLogicAppsProxyPath, + xMsLogicAppsProxyMethod, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWorkflowsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listWorkflowsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWorkflowsNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listWorkflowsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LogicAppsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LogicAppsImpl.java new file mode 100644 index 0000000000000..80699ff512c12 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LogicAppsImpl.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.LogicAppsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.LogicAppInner; +import com.azure.resourcemanager.appcontainers.fluent.models.WorkflowEnvelopeInner; +import com.azure.resourcemanager.appcontainers.models.LogicApp; +import com.azure.resourcemanager.appcontainers.models.LogicApps; +import com.azure.resourcemanager.appcontainers.models.LogicAppsProxyMethod; +import com.azure.resourcemanager.appcontainers.models.WorkflowArtifacts; +import com.azure.resourcemanager.appcontainers.models.WorkflowEnvelope; + +public final class LogicAppsImpl implements LogicApps { + private static final ClientLogger LOGGER = new ClientLogger(LogicAppsImpl.class); + + private final LogicAppsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public LogicAppsImpl(LogicAppsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, containerAppName, logicAppName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LogicAppImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LogicApp get(String resourceGroupName, String containerAppName, String logicAppName) { + LogicAppInner inner = this.serviceClient().get(resourceGroupName, containerAppName, logicAppName); + if (inner != null) { + return new LogicAppImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, containerAppName, logicAppName, context); + } + + public void delete(String resourceGroupName, String containerAppName, String logicAppName) { + this.serviceClient().delete(resourceGroupName, containerAppName, logicAppName); + } + + public PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + String logicAppName) { + PagedIterable inner + = this.serviceClient().listWorkflows(resourceGroupName, containerAppName, logicAppName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkflowEnvelopeImpl(inner1, this.manager())); + } + + public PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + String logicAppName, Context context) { + PagedIterable inner + = this.serviceClient().listWorkflows(resourceGroupName, containerAppName, logicAppName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkflowEnvelopeImpl(inner1, this.manager())); + } + + public Response getWorkflowWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, String workflowName, Context context) { + Response inner = this.serviceClient() + .getWorkflowWithResponse(resourceGroupName, containerAppName, logicAppName, workflowName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WorkflowEnvelopeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public WorkflowEnvelope getWorkflow(String resourceGroupName, String containerAppName, String logicAppName, + String workflowName) { + WorkflowEnvelopeInner inner + = this.serviceClient().getWorkflow(resourceGroupName, containerAppName, logicAppName, workflowName); + if (inner != null) { + return new WorkflowEnvelopeImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deployWorkflowArtifactsWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, WorkflowArtifacts workflowArtifacts, Context context) { + return this.serviceClient() + .deployWorkflowArtifactsWithResponse(resourceGroupName, containerAppName, logicAppName, workflowArtifacts, + context); + } + + public void deployWorkflowArtifacts(String resourceGroupName, String containerAppName, String logicAppName) { + this.serviceClient().deployWorkflowArtifacts(resourceGroupName, containerAppName, logicAppName); + } + + public Response listWorkflowsConnectionsWithResponse(String resourceGroupName, + String containerAppName, String logicAppName, Context context) { + Response inner = this.serviceClient() + .listWorkflowsConnectionsWithResponse(resourceGroupName, containerAppName, logicAppName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WorkflowEnvelopeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public WorkflowEnvelope listWorkflowsConnections(String resourceGroupName, String containerAppName, + String logicAppName) { + WorkflowEnvelopeInner inner + = this.serviceClient().listWorkflowsConnections(resourceGroupName, containerAppName, logicAppName); + if (inner != null) { + return new WorkflowEnvelopeImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response invokeWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + String xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod, Context context) { + return this.serviceClient() + .invokeWithResponse(resourceGroupName, containerAppName, logicAppName, xMsLogicAppsProxyPath, + xMsLogicAppsProxyMethod, context); + } + + public Object invoke(String resourceGroupName, String containerAppName, String logicAppName, + String xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod) { + return this.serviceClient() + .invoke(resourceGroupName, containerAppName, logicAppName, xMsLogicAppsProxyPath, xMsLogicAppsProxyMethod); + } + + public LogicApp getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerAppName = ResourceManagerUtils.getValueFromIdByName(id, "containerApps"); + if (containerAppName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String logicAppName = ResourceManagerUtils.getValueFromIdByName(id, "logicApps"); + if (logicAppName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logicApps'.", id))); + } + return this.getWithResponse(resourceGroupName, containerAppName, logicAppName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerAppName = ResourceManagerUtils.getValueFromIdByName(id, "containerApps"); + if (containerAppName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String logicAppName = ResourceManagerUtils.getValueFromIdByName(id, "logicApps"); + if (logicAppName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logicApps'.", id))); + } + return this.getWithResponse(resourceGroupName, containerAppName, logicAppName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerAppName = ResourceManagerUtils.getValueFromIdByName(id, "containerApps"); + if (containerAppName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String logicAppName = ResourceManagerUtils.getValueFromIdByName(id, "logicApps"); + if (logicAppName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logicApps'.", id))); + } + this.deleteWithResponse(resourceGroupName, containerAppName, logicAppName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerAppName = ResourceManagerUtils.getValueFromIdByName(id, "containerApps"); + if (containerAppName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String logicAppName = ResourceManagerUtils.getValueFromIdByName(id, "logicApps"); + if (logicAppName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logicApps'.", id))); + } + return this.deleteWithResponse(resourceGroupName, containerAppName, logicAppName, context); + } + + private LogicAppsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public LogicAppImpl define(String name) { + return new LogicAppImpl(name, this.manager()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentImpl.java index ee527bf6eb9db..ac1df30cdd614 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentImpl.java @@ -9,6 +9,8 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.appcontainers.fluent.models.ManagedEnvironmentInner; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.appcontainers.models.AppInsightsConfiguration; import com.azure.resourcemanager.appcontainers.models.AppLogsConfiguration; import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; import com.azure.resourcemanager.appcontainers.models.DaprConfiguration; @@ -18,11 +20,16 @@ import com.azure.resourcemanager.appcontainers.models.ManagedEnvironment; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerAuthentication; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfiguration; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; +import com.azure.resourcemanager.appcontainers.models.OpenTelemetryConfiguration; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointConnection; +import com.azure.resourcemanager.appcontainers.models.PublicNetworkAccess; import com.azure.resourcemanager.appcontainers.models.VnetConfiguration; import com.azure.resourcemanager.appcontainers.models.WorkloadProfile; import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; public final class ManagedEnvironmentImpl implements ManagedEnvironment, ManagedEnvironment.Definition, ManagedEnvironment.Update { @@ -59,6 +66,10 @@ public String kind() { return this.innerModel().kind(); } + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -95,6 +106,14 @@ public AppLogsConfiguration appLogsConfiguration() { return this.innerModel().appLogsConfiguration(); } + public AppInsightsConfiguration appInsightsConfiguration() { + return this.innerModel().appInsightsConfiguration(); + } + + public OpenTelemetryConfiguration openTelemetryConfiguration() { + return this.innerModel().openTelemetryConfiguration(); + } + public Boolean zoneRedundant() { return this.innerModel().zoneRedundant(); } @@ -136,6 +155,21 @@ public ManagedEnvironmentPropertiesPeerTrafficConfiguration peerTrafficConfigura return this.innerModel().peerTrafficConfiguration(); } + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -257,6 +291,11 @@ public ManagedEnvironmentImpl withKind(String kind) { return this; } + public ManagedEnvironmentImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + public ManagedEnvironmentImpl withDaprAIInstrumentationKey(String daprAIInstrumentationKey) { this.innerModel().withDaprAIInstrumentationKey(daprAIInstrumentationKey); return this; @@ -277,6 +316,17 @@ public ManagedEnvironmentImpl withAppLogsConfiguration(AppLogsConfiguration appL return this; } + public ManagedEnvironmentImpl withAppInsightsConfiguration(AppInsightsConfiguration appInsightsConfiguration) { + this.innerModel().withAppInsightsConfiguration(appInsightsConfiguration); + return this; + } + + public ManagedEnvironmentImpl + withOpenTelemetryConfiguration(OpenTelemetryConfiguration openTelemetryConfiguration) { + this.innerModel().withOpenTelemetryConfiguration(openTelemetryConfiguration); + return this; + } + public ManagedEnvironmentImpl withZoneRedundant(Boolean zoneRedundant) { this.innerModel().withZoneRedundant(zoneRedundant); return this; @@ -318,4 +368,9 @@ public ManagedEnvironmentImpl withInfrastructureResourceGroup(String infrastruct this.innerModel().withPeerTrafficConfiguration(peerTrafficConfiguration); return this; } + + public ManagedEnvironmentImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateEndpointConnectionsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateEndpointConnectionsClientImpl.java new file mode 100644 index 0000000000000..fda1c378f6b16 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1000 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointConnectionListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ManagedEnvironmentPrivateEndpointConnectionsClient. + */ +public final class ManagedEnvironmentPrivateEndpointConnectionsClientImpl + implements ManagedEnvironmentPrivateEndpointConnectionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ManagedEnvironmentPrivateEndpointConnectionsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ManagedEnvironmentPrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedEnvironmentPrivateEndpointConnectionsClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(ManagedEnvironmentPrivateEndpointConnectionsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientManagedEnvironmentPrivateEndpointConnections to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface ManagedEnvironmentPrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List private endpoint connections for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String environmentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List private endpoint connections for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String environmentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, environmentName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List private endpoint connections for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String environmentName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, environmentName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List private endpoint connections for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String environmentName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, environmentName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List private endpoint connections for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName) { + return new PagedIterable<>(listAsync(resourceGroupName, environmentName)); + } + + /** + * List private endpoint connections for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, environmentName, context)); + } + + /** + * Get a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection for a given managed environment along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String environmentName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection for a given managed environment along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String environmentName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context); + } + + /** + * Get a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection for a given managed environment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String environmentName, + String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, environmentName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection for a given managed environment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, environmentName, privateEndpointConnectionName, context).block(); + } + + /** + * Get a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection for a given managed environment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get(String resourceGroupName, String environmentName, + String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, environmentName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String environmentName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnectionEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (privateEndpointConnectionEnvelope == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionEnvelope is required and cannot be null.")); + } else { + privateEndpointConnectionEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, privateEndpointConnectionName, this.client.getApiVersion(), + privateEndpointConnectionEnvelope, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String environmentName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (privateEndpointConnectionEnvelope == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionEnvelope is required and cannot be null.")); + } else { + privateEndpointConnectionEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, privateEndpointConnectionName, this.client.getApiVersion(), + privateEndpointConnectionEnvelope, accept, context); + } + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync(String resourceGroupName, String environmentName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnectionEnvelope) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, environmentName, + privateEndpointConnectionName, privateEndpointConnectionEnvelope); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, + this.client.getContext()); + } + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync(String resourceGroupName, String environmentName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, environmentName, + privateEndpointConnectionName, privateEndpointConnectionEnvelope, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, + context); + } + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String environmentName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnectionEnvelope) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, environmentName, privateEndpointConnectionName, + privateEndpointConnectionEnvelope) + .getSyncPoller(); + } + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String environmentName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, environmentName, privateEndpointConnectionName, + privateEndpointConnectionEnvelope, context) + .getSyncPoller(); + } + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, environmentName, privateEndpointConnectionName, + privateEndpointConnectionEnvelope).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, environmentName, privateEndpointConnectionName, + privateEndpointConnectionEnvelope, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope) { + return createOrUpdateAsync(resourceGroupName, environmentName, privateEndpointConnectionName, + privateEndpointConnectionEnvelope).block(); + } + + /** + * Update the state of a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param privateEndpointConnectionEnvelope The resource of private endpoint and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, + Context context) { + return createOrUpdateAsync(resourceGroupName, environmentName, privateEndpointConnectionName, + privateEndpointConnectionEnvelope, context).block(); + } + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String environmentName, + String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + environmentName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String environmentName, + String privateEndpointConnectionName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, environmentName, privateEndpointConnectionName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, environmentName, privateEndpointConnectionName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String environmentName, + String privateEndpointConnectionName) { + return this.beginDeleteAsync(resourceGroupName, environmentName, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, Context context) { + return this.beginDeleteAsync(resourceGroupName, environmentName, privateEndpointConnectionName, context) + .getSyncPoller(); + } + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String environmentName, + String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, environmentName, privateEndpointConnectionName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, environmentName, privateEndpointConnectionName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String environmentName, String privateEndpointConnectionName) { + deleteAsync(resourceGroupName, environmentName, privateEndpointConnectionName).block(); + } + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String environmentName, String privateEndpointConnectionName, + Context context) { + deleteAsync(resourceGroupName, environmentName, privateEndpointConnectionName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateEndpointConnectionsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..225993918b6cd --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateEndpointConnectionsImpl.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPrivateEndpointConnections; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointConnection; + +public final class ManagedEnvironmentPrivateEndpointConnectionsImpl + implements ManagedEnvironmentPrivateEndpointConnections { + private static final ClientLogger LOGGER = new ClientLogger(ManagedEnvironmentPrivateEndpointConnectionsImpl.class); + + private final ManagedEnvironmentPrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public ManagedEnvironmentPrivateEndpointConnectionsImpl( + ManagedEnvironmentPrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String environmentName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, environmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String environmentName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, environmentName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, environmentName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateEndpointConnection get(String resourceGroupName, String environmentName, + String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner + = this.serviceClient().get(resourceGroupName, environmentName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String environmentName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, environmentName, privateEndpointConnectionName); + } + + public void delete(String resourceGroupName, String environmentName, String privateEndpointConnectionName, + Context context) { + this.serviceClient().delete(resourceGroupName, environmentName, privateEndpointConnectionName, context); + } + + public PrivateEndpointConnection getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, environmentName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, environmentName, privateEndpointConnectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + this.delete(resourceGroupName, environmentName, privateEndpointConnectionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String environmentName = ResourceManagerUtils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + this.delete(resourceGroupName, environmentName, privateEndpointConnectionName, context); + } + + private ManagedEnvironmentPrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateLinkResourcesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateLinkResourcesClientImpl.java new file mode 100644 index 0000000000000..0c3f4e3e83b20 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateLinkResourcesClientImpl.java @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentPrivateLinkResourcesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.appcontainers.models.PrivateLinkResourceListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ManagedEnvironmentPrivateLinkResourcesClient. + */ +public final class ManagedEnvironmentPrivateLinkResourcesClientImpl + implements ManagedEnvironmentPrivateLinkResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ManagedEnvironmentPrivateLinkResourcesService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ManagedEnvironmentPrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedEnvironmentPrivateLinkResourcesClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(ManagedEnvironmentPrivateLinkResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientManagedEnvironmentPrivateLinkResources to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface ManagedEnvironmentPrivateLinkResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List private link resources for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String environmentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List private link resources for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String environmentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, environmentName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List private link resources for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String environmentName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, environmentName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List private link resources for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String environmentName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, environmentName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List private link resources for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName) { + return new PagedIterable<>(listAsync(resourceGroupName, environmentName)); + } + + /** + * List private link resources for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, environmentName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateLinkResourcesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..34a753a0e7d78 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateLinkResourcesImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentPrivateLinkResourcesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPrivateLinkResources; +import com.azure.resourcemanager.appcontainers.models.PrivateLinkResource; + +public final class ManagedEnvironmentPrivateLinkResourcesImpl implements ManagedEnvironmentPrivateLinkResources { + private static final ClientLogger LOGGER = new ClientLogger(ManagedEnvironmentPrivateLinkResourcesImpl.class); + + private final ManagedEnvironmentPrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public ManagedEnvironmentPrivateLinkResourcesImpl(ManagedEnvironmentPrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String environmentName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, environmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String environmentName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, environmentName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + private ManagedEnvironmentPrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/PrivateEndpointConnectionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..0f307d007854a --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpoint; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointConnection; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.appcontainers.models.PrivateLinkServiceConnectionState; +import java.util.Collections; +import java.util.List; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List groupIds() { + List inner = this.innerModel().groupIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String environmentName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingManagedEnvironment(String resourceGroupName, + String environmentName) { + this.resourceGroupName = resourceGroupName; + this.environmentName = environmentName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironmentPrivateEndpointConnections() + .createOrUpdate(resourceGroupName, environmentName, privateEndpointConnectionName, this.innerModel(), + Context.NONE); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironmentPrivateEndpointConnections() + .createOrUpdate(resourceGroupName, environmentName, privateEndpointConnectionName, this.innerModel(), + context); + return this; + } + + PrivateEndpointConnectionImpl(String name, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnectionImpl update() { + return this; + } + + public PrivateEndpointConnection apply() { + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironmentPrivateEndpointConnections() + .createOrUpdate(resourceGroupName, environmentName, privateEndpointConnectionName, this.innerModel(), + Context.NONE); + return this; + } + + public PrivateEndpointConnection apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironmentPrivateEndpointConnections() + .createOrUpdate(resourceGroupName, environmentName, privateEndpointConnectionName, this.innerModel(), + context); + return this; + } + + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.environmentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "managedEnvironments"); + this.privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + } + + public PrivateEndpointConnection refresh() { + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironmentPrivateEndpointConnections() + .getWithResponse(resourceGroupName, environmentName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagedEnvironmentPrivateEndpointConnections() + .getWithResponse(resourceGroupName, environmentName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.innerModel().withPrivateEndpoint(privateEndpoint); + return this; + } + + public PrivateEndpointConnectionImpl + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/PrivateLinkResourceImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 0000000000000..29bb3c4ededb5 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.appcontainers.models.PrivateLinkResource; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String groupId() { + return this.innerModel().groupId(); + } + + public List requiredMembers() { + List inner = this.innerModel().requiredMembers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List requiredZoneNames() { + List inner = this.innerModel().requiredZoneNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SessionPoolImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SessionPoolImpl.java new file mode 100644 index 0000000000000..a37b9bcc471e1 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SessionPoolImpl.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.SessionPoolInner; +import com.azure.resourcemanager.appcontainers.models.ContainerType; +import com.azure.resourcemanager.appcontainers.models.CustomContainerTemplate; +import com.azure.resourcemanager.appcontainers.models.DynamicPoolConfiguration; +import com.azure.resourcemanager.appcontainers.models.PoolManagementType; +import com.azure.resourcemanager.appcontainers.models.ScaleConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionNetworkConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionPool; +import com.azure.resourcemanager.appcontainers.models.SessionPoolProvisioningState; +import com.azure.resourcemanager.appcontainers.models.SessionPoolSecret; +import com.azure.resourcemanager.appcontainers.models.SessionPoolUpdatableProperties; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class SessionPoolImpl implements SessionPool, SessionPool.Definition, SessionPool.Update { + private SessionPoolInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String environmentId() { + return this.innerModel().environmentId(); + } + + public ContainerType containerType() { + return this.innerModel().containerType(); + } + + public PoolManagementType poolManagementType() { + return this.innerModel().poolManagementType(); + } + + public Integer nodeCount() { + return this.innerModel().nodeCount(); + } + + public ScaleConfiguration scaleConfiguration() { + return this.innerModel().scaleConfiguration(); + } + + public List secrets() { + List inner = this.innerModel().secrets(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DynamicPoolConfiguration dynamicPoolConfiguration() { + return this.innerModel().dynamicPoolConfiguration(); + } + + public CustomContainerTemplate customContainerTemplate() { + return this.innerModel().customContainerTemplate(); + } + + public SessionNetworkConfiguration sessionNetworkConfiguration() { + return this.innerModel().sessionNetworkConfiguration(); + } + + public String poolManagementEndpoint() { + return this.innerModel().poolManagementEndpoint(); + } + + public SessionPoolProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SessionPoolInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sessionPoolName; + + private SessionPoolUpdatableProperties updateSessionPoolEnvelope; + + public SessionPoolImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SessionPool create() { + this.innerObject = serviceManager.serviceClient() + .getContainerAppsSessionPools() + .createOrUpdate(resourceGroupName, sessionPoolName, this.innerModel(), Context.NONE); + return this; + } + + public SessionPool create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getContainerAppsSessionPools() + .createOrUpdate(resourceGroupName, sessionPoolName, this.innerModel(), context); + return this; + } + + SessionPoolImpl(String name, com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = new SessionPoolInner(); + this.serviceManager = serviceManager; + this.sessionPoolName = name; + } + + public SessionPoolImpl update() { + this.updateSessionPoolEnvelope = new SessionPoolUpdatableProperties(); + return this; + } + + public SessionPool apply() { + this.innerObject = serviceManager.serviceClient() + .getContainerAppsSessionPools() + .update(resourceGroupName, sessionPoolName, updateSessionPoolEnvelope, Context.NONE); + return this; + } + + public SessionPool apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getContainerAppsSessionPools() + .update(resourceGroupName, sessionPoolName, updateSessionPoolEnvelope, context); + return this; + } + + SessionPoolImpl(SessionPoolInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sessionPoolName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "sessionPools"); + } + + public SessionPool refresh() { + this.innerObject = serviceManager.serviceClient() + .getContainerAppsSessionPools() + .getByResourceGroupWithResponse(resourceGroupName, sessionPoolName, Context.NONE) + .getValue(); + return this; + } + + public SessionPool refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getContainerAppsSessionPools() + .getByResourceGroupWithResponse(resourceGroupName, sessionPoolName, context) + .getValue(); + return this; + } + + public SessionPoolImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SessionPoolImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SessionPoolImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public SessionPoolImpl withEnvironmentId(String environmentId) { + this.innerModel().withEnvironmentId(environmentId); + return this; + } + + public SessionPoolImpl withContainerType(ContainerType containerType) { + this.innerModel().withContainerType(containerType); + return this; + } + + public SessionPoolImpl withPoolManagementType(PoolManagementType poolManagementType) { + this.innerModel().withPoolManagementType(poolManagementType); + return this; + } + + public SessionPoolImpl withScaleConfiguration(ScaleConfiguration scaleConfiguration) { + if (isInCreateMode()) { + this.innerModel().withScaleConfiguration(scaleConfiguration); + return this; + } else { + this.updateSessionPoolEnvelope.withScaleConfiguration(scaleConfiguration); + return this; + } + } + + public SessionPoolImpl withSecrets(List secrets) { + if (isInCreateMode()) { + this.innerModel().withSecrets(secrets); + return this; + } else { + this.updateSessionPoolEnvelope.withSecrets(secrets); + return this; + } + } + + public SessionPoolImpl withDynamicPoolConfiguration(DynamicPoolConfiguration dynamicPoolConfiguration) { + if (isInCreateMode()) { + this.innerModel().withDynamicPoolConfiguration(dynamicPoolConfiguration); + return this; + } else { + this.updateSessionPoolEnvelope.withDynamicPoolConfiguration(dynamicPoolConfiguration); + return this; + } + } + + public SessionPoolImpl withCustomContainerTemplate(CustomContainerTemplate customContainerTemplate) { + if (isInCreateMode()) { + this.innerModel().withCustomContainerTemplate(customContainerTemplate); + return this; + } else { + this.updateSessionPoolEnvelope.withCustomContainerTemplate(customContainerTemplate); + return this; + } + } + + public SessionPoolImpl withSessionNetworkConfiguration(SessionNetworkConfiguration sessionNetworkConfiguration) { + if (isInCreateMode()) { + this.innerModel().withSessionNetworkConfiguration(sessionNetworkConfiguration); + return this; + } else { + this.updateSessionPoolEnvelope.withSessionNetworkConfiguration(sessionNetworkConfiguration); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SourceControlImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SourceControlImpl.java index 49070a189996b..8c464a3cb284a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SourceControlImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SourceControlImpl.java @@ -66,6 +66,10 @@ private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager( private String sourceControlName; + private String createXMsGithubAuxiliary; + + private String updateXMsGithubAuxiliary; + public SourceControlImpl withExistingContainerApp(String resourceGroupName, String containerAppName) { this.resourceGroupName = resourceGroupName; this.containerAppName = containerAppName; @@ -75,14 +79,16 @@ public SourceControlImpl withExistingContainerApp(String resourceGroupName, Stri public SourceControl create() { this.innerObject = serviceManager.serviceClient() .getContainerAppsSourceControls() - .createOrUpdate(resourceGroupName, containerAppName, sourceControlName, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, containerAppName, sourceControlName, this.innerModel(), + createXMsGithubAuxiliary, Context.NONE); return this; } public SourceControl create(Context context) { this.innerObject = serviceManager.serviceClient() .getContainerAppsSourceControls() - .createOrUpdate(resourceGroupName, containerAppName, sourceControlName, this.innerModel(), context); + .createOrUpdate(resourceGroupName, containerAppName, sourceControlName, this.innerModel(), + createXMsGithubAuxiliary, context); return this; } @@ -90,23 +96,27 @@ public SourceControl create(Context context) { this.innerObject = new SourceControlInner(); this.serviceManager = serviceManager; this.sourceControlName = name; + this.createXMsGithubAuxiliary = null; } public SourceControlImpl update() { + this.updateXMsGithubAuxiliary = null; return this; } public SourceControl apply() { this.innerObject = serviceManager.serviceClient() .getContainerAppsSourceControls() - .createOrUpdate(resourceGroupName, containerAppName, sourceControlName, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, containerAppName, sourceControlName, this.innerModel(), + updateXMsGithubAuxiliary, Context.NONE); return this; } public SourceControl apply(Context context) { this.innerObject = serviceManager.serviceClient() .getContainerAppsSourceControls() - .createOrUpdate(resourceGroupName, containerAppName, sourceControlName, this.innerModel(), context); + .createOrUpdate(resourceGroupName, containerAppName, sourceControlName, this.innerModel(), + updateXMsGithubAuxiliary, context); return this; } @@ -149,4 +159,18 @@ public SourceControlImpl withGithubActionConfiguration(GithubActionConfiguration this.innerModel().withGithubActionConfiguration(githubActionConfiguration); return this; } + + public SourceControlImpl withXMsGithubAuxiliary(String xMsGithubAuxiliary) { + if (isInCreateMode()) { + this.createXMsGithubAuxiliary = xMsGithubAuxiliary; + return this; + } else { + this.updateXMsGithubAuxiliary = xMsGithubAuxiliary; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/WorkflowEnvelopeImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/WorkflowEnvelopeImpl.java new file mode 100644 index 0000000000000..2da06b74375de --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/WorkflowEnvelopeImpl.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.resourcemanager.appcontainers.fluent.models.WorkflowEnvelopeInner; +import com.azure.resourcemanager.appcontainers.models.WorkflowEnvelope; +import com.azure.resourcemanager.appcontainers.models.WorkflowEnvelopeProperties; + +public final class WorkflowEnvelopeImpl implements WorkflowEnvelope { + private WorkflowEnvelopeInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + WorkflowEnvelopeImpl(WorkflowEnvelopeInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public String location() { + return this.innerModel().location(); + } + + public WorkflowEnvelopeProperties properties() { + return this.innerModel().properties(); + } + + public WorkflowEnvelopeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/package-info.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/package-info.java index 4afb39fb56527..d5c81f00f20c9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/package-info.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/package-info.java @@ -4,6 +4,8 @@ /** * Package containing the implementations for ContainerAppsApiClient. - * null. + * Functions is an extension resource to revisions and the api listed is used to proxy the call from Web RP to the + * function app's host process, this api is not exposed to users and only Web RP is allowed to invoke functions + * extension resource. */ package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppInsightsConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppInsightsConfiguration.java new file mode 100644 index 0000000000000..a3d7435c59a8c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppInsightsConfiguration.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration of Application Insights. + */ +@Fluent +public final class AppInsightsConfiguration implements JsonSerializable { + /* + * Application Insights connection string + */ + private String connectionString; + + /** + * Creates an instance of AppInsightsConfiguration class. + */ + public AppInsightsConfiguration() { + } + + /** + * Get the connectionString property: Application Insights connection string. + * + * @return the connectionString value. + */ + public String connectionString() { + return this.connectionString; + } + + /** + * Set the connectionString property: Application Insights connection string. + * + * @param connectionString the connectionString value to set. + * @return the AppInsightsConfiguration object itself. + */ + public AppInsightsConfiguration withConnectionString(String connectionString) { + this.connectionString = connectionString; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("connectionString", this.connectionString); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppInsightsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppInsightsConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AppInsightsConfiguration. + */ + public static AppInsightsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppInsightsConfiguration deserializedAppInsightsConfiguration = new AppInsightsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("connectionString".equals(fieldName)) { + deserializedAppInsightsConfiguration.connectionString = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAppInsightsConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppResiliencies.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppResiliencies.java new file mode 100644 index 0000000000000..06fb0d166368c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppResiliencies.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of AppResiliencies. + */ +public interface AppResiliencies { + /** + * Delete an application's resiliency policy. + * + * Delete container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String appName, String name, Context context); + + /** + * Delete an application's resiliency policy. + * + * Delete container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String appName, String name); + + /** + * Get an application's resiliency policy. + * + * Get container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container app resiliency policy along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String appName, String name, Context context); + + /** + * Get an application's resiliency policy. + * + * Get container app resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param name Name of the resiliency policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container app resiliency policy. + */ + AppResiliency get(String resourceGroupName, String appName, String name); + + /** + * List an application's resiliency policies. + * + * List container app resiliency policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of AppResiliency policies as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String appName); + + /** + * List an application's resiliency policies. + * + * List container app resiliency policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of AppResiliency policies as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String appName, Context context); + + /** + * Get an application's resiliency policy. + * + * Get container app resiliency policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container app resiliency policy along with {@link Response}. + */ + AppResiliency getById(String id); + + /** + * Get an application's resiliency policy. + * + * Get container app resiliency policy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container app resiliency policy along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete an application's resiliency policy. + * + * Delete container app resiliency policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete an application's resiliency policy. + * + * Delete container app resiliency policy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AppResiliency resource. + * + * @param name resource name. + * @return the first stage of the new AppResiliency definition. + */ + AppResiliency.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppResiliency.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppResiliency.java new file mode 100644 index 0000000000000..2ddc37d1845c0 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppResiliency.java @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.AppResiliencyInner; + +/** + * An immutable client-side representation of AppResiliency. + */ +public interface AppResiliency { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the timeoutPolicy property: Policy to set request timeouts. + * + * @return the timeoutPolicy value. + */ + TimeoutPolicy timeoutPolicy(); + + /** + * Gets the httpRetryPolicy property: Policy that defines http request retry conditions. + * + * @return the httpRetryPolicy value. + */ + HttpRetryPolicy httpRetryPolicy(); + + /** + * Gets the tcpRetryPolicy property: Policy that defines tcp request retry conditions. + * + * @return the tcpRetryPolicy value. + */ + TcpRetryPolicy tcpRetryPolicy(); + + /** + * Gets the circuitBreakerPolicy property: Policy that defines circuit breaker conditions. + * + * @return the circuitBreakerPolicy value. + */ + CircuitBreakerPolicy circuitBreakerPolicy(); + + /** + * Gets the httpConnectionPool property: Defines parameters for http connection pooling. + * + * @return the httpConnectionPool value. + */ + HttpConnectionPool httpConnectionPool(); + + /** + * Gets the tcpConnectionPool property: Defines parameters for tcp connection pooling. + * + * @return the tcpConnectionPool value. + */ + TcpConnectionPool tcpConnectionPool(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.AppResiliencyInner object. + * + * @return the inner object. + */ + AppResiliencyInner innerModel(); + + /** + * The entirety of the AppResiliency definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The AppResiliency definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the AppResiliency definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the AppResiliency definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, appName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Container App. + * @return the next definition stage. + */ + WithCreate withExistingContainerApp(String resourceGroupName, String appName); + } + + /** + * The stage of the AppResiliency definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTimeoutPolicy, DefinitionStages.WithHttpRetryPolicy, + DefinitionStages.WithTcpRetryPolicy, DefinitionStages.WithCircuitBreakerPolicy, + DefinitionStages.WithHttpConnectionPool, DefinitionStages.WithTcpConnectionPool { + /** + * Executes the create request. + * + * @return the created resource. + */ + AppResiliency create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AppResiliency create(Context context); + } + + /** + * The stage of the AppResiliency definition allowing to specify timeoutPolicy. + */ + interface WithTimeoutPolicy { + /** + * Specifies the timeoutPolicy property: Policy to set request timeouts. + * + * @param timeoutPolicy Policy to set request timeouts. + * @return the next definition stage. + */ + WithCreate withTimeoutPolicy(TimeoutPolicy timeoutPolicy); + } + + /** + * The stage of the AppResiliency definition allowing to specify httpRetryPolicy. + */ + interface WithHttpRetryPolicy { + /** + * Specifies the httpRetryPolicy property: Policy that defines http request retry conditions. + * + * @param httpRetryPolicy Policy that defines http request retry conditions. + * @return the next definition stage. + */ + WithCreate withHttpRetryPolicy(HttpRetryPolicy httpRetryPolicy); + } + + /** + * The stage of the AppResiliency definition allowing to specify tcpRetryPolicy. + */ + interface WithTcpRetryPolicy { + /** + * Specifies the tcpRetryPolicy property: Policy that defines tcp request retry conditions. + * + * @param tcpRetryPolicy Policy that defines tcp request retry conditions. + * @return the next definition stage. + */ + WithCreate withTcpRetryPolicy(TcpRetryPolicy tcpRetryPolicy); + } + + /** + * The stage of the AppResiliency definition allowing to specify circuitBreakerPolicy. + */ + interface WithCircuitBreakerPolicy { + /** + * Specifies the circuitBreakerPolicy property: Policy that defines circuit breaker conditions. + * + * @param circuitBreakerPolicy Policy that defines circuit breaker conditions. + * @return the next definition stage. + */ + WithCreate withCircuitBreakerPolicy(CircuitBreakerPolicy circuitBreakerPolicy); + } + + /** + * The stage of the AppResiliency definition allowing to specify httpConnectionPool. + */ + interface WithHttpConnectionPool { + /** + * Specifies the httpConnectionPool property: Defines parameters for http connection pooling. + * + * @param httpConnectionPool Defines parameters for http connection pooling. + * @return the next definition stage. + */ + WithCreate withHttpConnectionPool(HttpConnectionPool httpConnectionPool); + } + + /** + * The stage of the AppResiliency definition allowing to specify tcpConnectionPool. + */ + interface WithTcpConnectionPool { + /** + * Specifies the tcpConnectionPool property: Defines parameters for tcp connection pooling. + * + * @param tcpConnectionPool Defines parameters for tcp connection pooling. + * @return the next definition stage. + */ + WithCreate withTcpConnectionPool(TcpConnectionPool tcpConnectionPool); + } + } + + /** + * Begins update for the AppResiliency resource. + * + * @return the stage of resource update. + */ + AppResiliency.Update update(); + + /** + * The template for AppResiliency update. + */ + interface Update + extends UpdateStages.WithTimeoutPolicy, UpdateStages.WithHttpRetryPolicy, UpdateStages.WithTcpRetryPolicy, + UpdateStages.WithCircuitBreakerPolicy, UpdateStages.WithHttpConnectionPool, UpdateStages.WithTcpConnectionPool { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AppResiliency apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AppResiliency apply(Context context); + } + + /** + * The AppResiliency update stages. + */ + interface UpdateStages { + /** + * The stage of the AppResiliency update allowing to specify timeoutPolicy. + */ + interface WithTimeoutPolicy { + /** + * Specifies the timeoutPolicy property: Policy to set request timeouts. + * + * @param timeoutPolicy Policy to set request timeouts. + * @return the next definition stage. + */ + Update withTimeoutPolicy(TimeoutPolicy timeoutPolicy); + } + + /** + * The stage of the AppResiliency update allowing to specify httpRetryPolicy. + */ + interface WithHttpRetryPolicy { + /** + * Specifies the httpRetryPolicy property: Policy that defines http request retry conditions. + * + * @param httpRetryPolicy Policy that defines http request retry conditions. + * @return the next definition stage. + */ + Update withHttpRetryPolicy(HttpRetryPolicy httpRetryPolicy); + } + + /** + * The stage of the AppResiliency update allowing to specify tcpRetryPolicy. + */ + interface WithTcpRetryPolicy { + /** + * Specifies the tcpRetryPolicy property: Policy that defines tcp request retry conditions. + * + * @param tcpRetryPolicy Policy that defines tcp request retry conditions. + * @return the next definition stage. + */ + Update withTcpRetryPolicy(TcpRetryPolicy tcpRetryPolicy); + } + + /** + * The stage of the AppResiliency update allowing to specify circuitBreakerPolicy. + */ + interface WithCircuitBreakerPolicy { + /** + * Specifies the circuitBreakerPolicy property: Policy that defines circuit breaker conditions. + * + * @param circuitBreakerPolicy Policy that defines circuit breaker conditions. + * @return the next definition stage. + */ + Update withCircuitBreakerPolicy(CircuitBreakerPolicy circuitBreakerPolicy); + } + + /** + * The stage of the AppResiliency update allowing to specify httpConnectionPool. + */ + interface WithHttpConnectionPool { + /** + * Specifies the httpConnectionPool property: Defines parameters for http connection pooling. + * + * @param httpConnectionPool Defines parameters for http connection pooling. + * @return the next definition stage. + */ + Update withHttpConnectionPool(HttpConnectionPool httpConnectionPool); + } + + /** + * The stage of the AppResiliency update allowing to specify tcpConnectionPool. + */ + interface WithTcpConnectionPool { + /** + * Specifies the tcpConnectionPool property: Defines parameters for tcp connection pooling. + * + * @param tcpConnectionPool Defines parameters for tcp connection pooling. + * @return the next definition stage. + */ + Update withTcpConnectionPool(TcpConnectionPool tcpConnectionPool); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AppResiliency refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AppResiliency refresh(Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppResiliencyCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppResiliencyCollection.java new file mode 100644 index 0000000000000..66078d3846bdd --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppResiliencyCollection.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.fluent.models.AppResiliencyInner; +import java.io.IOException; +import java.util.List; + +/** + * Collection of AppResiliency policies. + */ +@Fluent +public final class AppResiliencyCollection implements JsonSerializable { + /* + * Collection of resources. + */ + private List value; + + /* + * Link to next page of resources. + */ + private String nextLink; + + /** + * Creates an instance of AppResiliencyCollection class. + */ + public AppResiliencyCollection() { + } + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the AppResiliencyCollection object itself. + */ + public AppResiliencyCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model AppResiliencyCollection")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AppResiliencyCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppResiliencyCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppResiliencyCollection if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AppResiliencyCollection. + */ + public static AppResiliencyCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppResiliencyCollection deserializedAppResiliencyCollection = new AppResiliencyCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AppResiliencyInner.fromJson(reader1)); + deserializedAppResiliencyCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAppResiliencyCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAppResiliencyCollection; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BaseContainer.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BaseContainer.java index 383b0f176233a..01e7df04856b4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BaseContainer.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BaseContainer.java @@ -22,6 +22,12 @@ public class BaseContainer implements JsonSerializable { */ private String image; + /* + * The type of the image. Set to CloudBuild to let the system manages the image, where user will not be able to + * update image through image field. Set to ContainerImage for user provided image. + */ + private ImageType imageType; + /* * Custom container name. */ @@ -78,6 +84,28 @@ public BaseContainer withImage(String image) { return this; } + /** + * Get the imageType property: The type of the image. Set to CloudBuild to let the system manages the image, where + * user will not be able to update image through image field. Set to ContainerImage for user provided image. + * + * @return the imageType value. + */ + public ImageType imageType() { + return this.imageType; + } + + /** + * Set the imageType property: The type of the image. Set to CloudBuild to let the system manages the image, where + * user will not be able to update image through image field. Set to ContainerImage for user provided image. + * + * @param imageType the imageType value to set. + * @return the BaseContainer object itself. + */ + public BaseContainer withImageType(ImageType imageType) { + this.imageType = imageType; + return this; + } + /** * Get the name property: Custom container name. * @@ -222,6 +250,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("image", this.image); + jsonWriter.writeStringField("imageType", this.imageType == null ? null : this.imageType.toString()); jsonWriter.writeStringField("name", this.name); jsonWriter.writeArrayField("command", this.command, (writer, element) -> writer.writeString(element)); jsonWriter.writeArrayField("args", this.args, (writer, element) -> writer.writeString(element)); @@ -248,6 +277,8 @@ public static BaseContainer fromJson(JsonReader jsonReader) throws IOException { if ("image".equals(fieldName)) { deserializedBaseContainer.image = reader.getString(); + } else if ("imageType".equals(fieldName)) { + deserializedBaseContainer.imageType = ImageType.fromString(reader.getString()); } else if ("name".equals(fieldName)) { deserializedBaseContainer.name = reader.getString(); } else if ("command".equals(fieldName)) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeter.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeter.java index 082c56d149b38..b24dae71df992 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeter.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeter.java @@ -5,9 +5,8 @@ package com.azure.resourcemanager.appcontainers.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; @@ -16,36 +15,33 @@ * Billing meter. */ @Fluent -public final class BillingMeter extends ProxyResource { +public final class BillingMeter implements JsonSerializable { /* - * Region for the billing meter. - */ - private String location; - - /* - * Revision resource specific properties + * Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{ + * resourceType}/{resourceName} */ - private BillingMeterProperties properties; + private String id; /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * The name of the resource */ - private SystemData systemData; + private String name; /* - * Fully qualified resource Id for the resource. + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */ - private String id; + private String type; /* - * The name of the resource. + * Region for the billing meter. */ - private String name; + private String location; /* - * The type of the resource. + * Revision resource specific properties */ - private String type; + private BillingMeterProperties properties; /** * Creates an instance of BillingMeter class. @@ -53,6 +49,35 @@ public final class BillingMeter extends ProxyResource { public BillingMeter() { } + /** + * Get the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + * "Microsoft.Storage/storageAccounts". + * + * @return the type value. + */ + public String type() { + return this.type; + } + /** * Get the location property: Region for the billing meter. * @@ -93,45 +118,6 @@ public BillingMeter withProperties(BillingMeterProperties properties) { return this; } - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - /** * Validates the instance. * @@ -160,7 +146,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of BillingMeter if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the BillingMeter. */ public static BillingMeter fromJson(JsonReader jsonReader) throws IOException { @@ -180,8 +165,6 @@ public static BillingMeter fromJson(JsonReader jsonReader) throws IOException { deserializedBillingMeter.location = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedBillingMeter.properties = BillingMeterProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedBillingMeter.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildAuthTokens.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildAuthTokens.java new file mode 100644 index 0000000000000..ac5dd37d1d4ba --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildAuthTokens.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of BuildAuthTokens. + */ +public interface BuildAuthTokens { + /** + * Gets the token used to connect to the endpoint where source code can be uploaded for a build. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the token used to connect to the endpoint where source code can be uploaded for a build along with + * {@link Response}. + */ + Response listWithResponse(String resourceGroupName, String builderName, String buildName, + Context context); + + /** + * Gets the token used to connect to the endpoint where source code can be uploaded for a build. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the token used to connect to the endpoint where source code can be uploaded for a build. + */ + BuildToken list(String resourceGroupName, String builderName, String buildName); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildCollection.java new file mode 100644 index 0000000000000..b0267e90fff9f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildCollection.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.fluent.models.BuildResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a BuildResource list operation. + */ +@Fluent +public final class BuildCollection implements JsonSerializable { + /* + * The BuildResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of BuildCollection class. + */ + public BuildCollection() { + } + + /** + * Get the value property: The BuildResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The BuildResource items on this page. + * + * @param value the value value to set. + * @return the BuildCollection object itself. + */ + public BuildCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the BuildCollection object itself. + */ + public BuildCollection withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model BuildCollection")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BuildCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BuildCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuildCollection if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BuildCollection. + */ + public static BuildCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuildCollection deserializedBuildCollection = new BuildCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> BuildResourceInner.fromJson(reader1)); + deserializedBuildCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedBuildCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBuildCollection; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildConfiguration.java new file mode 100644 index 0000000000000..bc194ad4c4f9a --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildConfiguration.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Configuration of the build. + */ +@Fluent +public final class BuildConfiguration implements JsonSerializable { + /* + * Base OS used to build and run the app. + */ + private String baseOs; + + /* + * Platform to be used to build and run the app. + */ + private String platform; + + /* + * Platform version to be used to build and run the app. + */ + private String platformVersion; + + /* + * List of environment variables to be passed to the build, secrets should not be used in environment variable. + */ + private List environmentVariables; + + /* + * List of steps to perform before the build. + */ + private List preBuildSteps; + + /** + * Creates an instance of BuildConfiguration class. + */ + public BuildConfiguration() { + } + + /** + * Get the baseOs property: Base OS used to build and run the app. + * + * @return the baseOs value. + */ + public String baseOs() { + return this.baseOs; + } + + /** + * Set the baseOs property: Base OS used to build and run the app. + * + * @param baseOs the baseOs value to set. + * @return the BuildConfiguration object itself. + */ + public BuildConfiguration withBaseOs(String baseOs) { + this.baseOs = baseOs; + return this; + } + + /** + * Get the platform property: Platform to be used to build and run the app. + * + * @return the platform value. + */ + public String platform() { + return this.platform; + } + + /** + * Set the platform property: Platform to be used to build and run the app. + * + * @param platform the platform value to set. + * @return the BuildConfiguration object itself. + */ + public BuildConfiguration withPlatform(String platform) { + this.platform = platform; + return this; + } + + /** + * Get the platformVersion property: Platform version to be used to build and run the app. + * + * @return the platformVersion value. + */ + public String platformVersion() { + return this.platformVersion; + } + + /** + * Set the platformVersion property: Platform version to be used to build and run the app. + * + * @param platformVersion the platformVersion value to set. + * @return the BuildConfiguration object itself. + */ + public BuildConfiguration withPlatformVersion(String platformVersion) { + this.platformVersion = platformVersion; + return this; + } + + /** + * Get the environmentVariables property: List of environment variables to be passed to the build, secrets should + * not be used in environment variable. + * + * @return the environmentVariables value. + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environmentVariables property: List of environment variables to be passed to the build, secrets should + * not be used in environment variable. + * + * @param environmentVariables the environmentVariables value to set. + * @return the BuildConfiguration object itself. + */ + public BuildConfiguration withEnvironmentVariables(List environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the preBuildSteps property: List of steps to perform before the build. + * + * @return the preBuildSteps value. + */ + public List preBuildSteps() { + return this.preBuildSteps; + } + + /** + * Set the preBuildSteps property: List of steps to perform before the build. + * + * @param preBuildSteps the preBuildSteps value to set. + * @return the BuildConfiguration object itself. + */ + public BuildConfiguration withPreBuildSteps(List preBuildSteps) { + this.preBuildSteps = preBuildSteps; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (environmentVariables() != null) { + environmentVariables().forEach(e -> e.validate()); + } + if (preBuildSteps() != null) { + preBuildSteps().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("baseOs", this.baseOs); + jsonWriter.writeStringField("platform", this.platform); + jsonWriter.writeStringField("platformVersion", this.platformVersion); + jsonWriter.writeArrayField("environmentVariables", this.environmentVariables, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("preBuildSteps", this.preBuildSteps, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BuildConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuildConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BuildConfiguration. + */ + public static BuildConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuildConfiguration deserializedBuildConfiguration = new BuildConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("baseOs".equals(fieldName)) { + deserializedBuildConfiguration.baseOs = reader.getString(); + } else if ("platform".equals(fieldName)) { + deserializedBuildConfiguration.platform = reader.getString(); + } else if ("platformVersion".equals(fieldName)) { + deserializedBuildConfiguration.platformVersion = reader.getString(); + } else if ("environmentVariables".equals(fieldName)) { + List environmentVariables + = reader.readArray(reader1 -> EnvironmentVariable.fromJson(reader1)); + deserializedBuildConfiguration.environmentVariables = environmentVariables; + } else if ("preBuildSteps".equals(fieldName)) { + List preBuildSteps = reader.readArray(reader1 -> PreBuildStep.fromJson(reader1)); + deserializedBuildConfiguration.preBuildSteps = preBuildSteps; + } else { + reader.skipChildren(); + } + } + + return deserializedBuildConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildProvisioningState.java new file mode 100644 index 0000000000000..5922fd28a4fd6 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildProvisioningState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Resource instance provisioning state. + */ +public final class BuildProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for BuildProvisioningState. + */ + public static final BuildProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for BuildProvisioningState. + */ + public static final BuildProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for BuildProvisioningState. + */ + public static final BuildProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Creating for BuildProvisioningState. + */ + public static final BuildProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Updating for BuildProvisioningState. + */ + public static final BuildProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for BuildProvisioningState. + */ + public static final BuildProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of BuildProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BuildProvisioningState() { + } + + /** + * Creates or finds a BuildProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding BuildProvisioningState. + */ + public static BuildProvisioningState fromString(String name) { + return fromString(name, BuildProvisioningState.class); + } + + /** + * Gets known BuildProvisioningState values. + * + * @return known BuildProvisioningState values. + */ + public static Collection values() { + return values(BuildProvisioningState.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildResource.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildResource.java new file mode 100644 index 0000000000000..2917c702fa3f7 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildResource.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.BuildResourceInner; + +/** + * An immutable client-side representation of BuildResource. + */ +public interface BuildResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Build provisioning state. + * + * @return the provisioningState value. + */ + BuildProvisioningState provisioningState(); + + /** + * Gets the buildStatus property: Status of the build once it has been provisioned. + * + * @return the buildStatus value. + */ + BuildStatus buildStatus(); + + /** + * Gets the destinationContainerRegistry property: Container registry that the final image will be uploaded to. + * + * @return the destinationContainerRegistry value. + */ + ContainerRegistryWithCustomImage destinationContainerRegistry(); + + /** + * Gets the configuration property: Configuration of the build. + * + * @return the configuration value. + */ + BuildConfiguration configuration(); + + /** + * Gets the uploadEndpoint property: Endpoint to which the source code should be uploaded. + * + * @return the uploadEndpoint value. + */ + String uploadEndpoint(); + + /** + * Gets the logStreamEndpoint property: Endpoint from which the build logs can be streamed. + * + * @return the logStreamEndpoint value. + */ + String logStreamEndpoint(); + + /** + * Gets the tokenEndpoint property: Endpoint to use to retrieve an authentication token for log streaming and + * uploading source code. + * + * @return the tokenEndpoint value. + */ + String tokenEndpoint(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.BuildResourceInner object. + * + * @return the inner object. + */ + BuildResourceInner innerModel(); + + /** + * The entirety of the BuildResource definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The BuildResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the BuildResource definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the BuildResource definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, builderName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @return the next definition stage. + */ + WithCreate withExistingBuilder(String resourceGroupName, String builderName); + } + + /** + * The stage of the BuildResource definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithDestinationContainerRegistry, DefinitionStages.WithConfiguration { + /** + * Executes the create request. + * + * @return the created resource. + */ + BuildResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BuildResource create(Context context); + } + + /** + * The stage of the BuildResource definition allowing to specify destinationContainerRegistry. + */ + interface WithDestinationContainerRegistry { + /** + * Specifies the destinationContainerRegistry property: Container registry that the final image will be + * uploaded to.. + * + * @param destinationContainerRegistry Container registry that the final image will be uploaded to. + * @return the next definition stage. + */ + WithCreate withDestinationContainerRegistry(ContainerRegistryWithCustomImage destinationContainerRegistry); + } + + /** + * The stage of the BuildResource definition allowing to specify configuration. + */ + interface WithConfiguration { + /** + * Specifies the configuration property: Configuration of the build.. + * + * @param configuration Configuration of the build. + * @return the next definition stage. + */ + WithCreate withConfiguration(BuildConfiguration configuration); + } + } + + /** + * Begins update for the BuildResource resource. + * + * @return the stage of resource update. + */ + BuildResource.Update update(); + + /** + * The template for BuildResource update. + */ + interface Update extends UpdateStages.WithDestinationContainerRegistry, UpdateStages.WithConfiguration { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BuildResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BuildResource apply(Context context); + } + + /** + * The BuildResource update stages. + */ + interface UpdateStages { + /** + * The stage of the BuildResource update allowing to specify destinationContainerRegistry. + */ + interface WithDestinationContainerRegistry { + /** + * Specifies the destinationContainerRegistry property: Container registry that the final image will be + * uploaded to.. + * + * @param destinationContainerRegistry Container registry that the final image will be uploaded to. + * @return the next definition stage. + */ + Update withDestinationContainerRegistry(ContainerRegistryWithCustomImage destinationContainerRegistry); + } + + /** + * The stage of the BuildResource update allowing to specify configuration. + */ + interface WithConfiguration { + /** + * Specifies the configuration property: Configuration of the build.. + * + * @param configuration Configuration of the build. + * @return the next definition stage. + */ + Update withConfiguration(BuildConfiguration configuration); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BuildResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BuildResource refresh(Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildStatus.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildStatus.java new file mode 100644 index 0000000000000..ddd4dde5e8e7e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildStatus.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status of the build once it has been provisioned. + */ +public final class BuildStatus extends ExpandableStringEnum { + /** + * Static value NotStarted for BuildStatus. + */ + public static final BuildStatus NOT_STARTED = fromString("NotStarted"); + + /** + * Static value InProgress for BuildStatus. + */ + public static final BuildStatus IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Succeeded for BuildStatus. + */ + public static final BuildStatus SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Canceled for BuildStatus. + */ + public static final BuildStatus CANCELED = fromString("Canceled"); + + /** + * Static value Failed for BuildStatus. + */ + public static final BuildStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of BuildStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BuildStatus() { + } + + /** + * Creates or finds a BuildStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding BuildStatus. + */ + public static BuildStatus fromString(String name) { + return fromString(name, BuildStatus.class); + } + + /** + * Gets known BuildStatus values. + * + * @return known BuildStatus values. + */ + public static Collection values() { + return values(BuildStatus.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildToken.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildToken.java new file mode 100644 index 0000000000000..31786178e9d9e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildToken.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.resourcemanager.appcontainers.fluent.models.BuildTokenInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of BuildToken. + */ +public interface BuildToken { + /** + * Gets the token property: Authentication token. + * + * @return the token value. + */ + String token(); + + /** + * Gets the expires property: Token expiration date. + * + * @return the expires value. + */ + OffsetDateTime expires(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.BuildTokenInner object. + * + * @return the inner object. + */ + BuildTokenInner innerModel(); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderCollection.java new file mode 100644 index 0000000000000..d48b541cf3281 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderCollection.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.fluent.models.BuilderResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a BuilderResource list operation. + */ +@Fluent +public final class BuilderCollection implements JsonSerializable { + /* + * The BuilderResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of BuilderCollection class. + */ + public BuilderCollection() { + } + + /** + * Get the value property: The BuilderResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The BuilderResource items on this page. + * + * @param value the value value to set. + * @return the BuilderCollection object itself. + */ + public BuilderCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the BuilderCollection object itself. + */ + public BuilderCollection withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model BuilderCollection")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BuilderCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BuilderCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuilderCollection if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BuilderCollection. + */ + public static BuilderCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuilderCollection deserializedBuilderCollection = new BuilderCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> BuilderResourceInner.fromJson(reader1)); + deserializedBuilderCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedBuilderCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBuilderCollection; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderProvisioningState.java new file mode 100644 index 0000000000000..7f99e5aa4f2bf --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderProvisioningState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Resource instance provisioning state. + */ +public final class BuilderProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for BuilderProvisioningState. + */ + public static final BuilderProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for BuilderProvisioningState. + */ + public static final BuilderProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for BuilderProvisioningState. + */ + public static final BuilderProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Creating for BuilderProvisioningState. + */ + public static final BuilderProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Updating for BuilderProvisioningState. + */ + public static final BuilderProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for BuilderProvisioningState. + */ + public static final BuilderProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of BuilderProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BuilderProvisioningState() { + } + + /** + * Creates or finds a BuilderProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding BuilderProvisioningState. + */ + public static BuilderProvisioningState fromString(String name) { + return fromString(name, BuilderProvisioningState.class); + } + + /** + * Gets known BuilderProvisioningState values. + * + * @return known BuilderProvisioningState values. + */ + public static Collection values() { + return values(BuilderProvisioningState.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderResource.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderResource.java new file mode 100644 index 0000000000000..1d81dcc8f511e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderResource.java @@ -0,0 +1,333 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.BuilderResourceInner; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of BuilderResource. + */ +public interface BuilderResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of a builder resource. + * + * @return the provisioningState value. + */ + BuilderProvisioningState provisioningState(); + + /** + * Gets the environmentId property: Resource ID of the container apps environment that the builder is associated + * with. + * + * @return the environmentId value. + */ + String environmentId(); + + /** + * Gets the containerRegistries property: List of mappings of container registries and the managed identity used to + * connect to it. + * + * @return the containerRegistries value. + */ + List containerRegistries(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.BuilderResourceInner object. + * + * @return the inner object. + */ + BuilderResourceInner innerModel(); + + /** + * The entirety of the BuilderResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The BuilderResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the BuilderResource definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the BuilderResource definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the BuilderResource definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the BuilderResource definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithEnvironmentId, DefinitionStages.WithContainerRegistries { + /** + * Executes the create request. + * + * @return the created resource. + */ + BuilderResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BuilderResource create(Context context); + } + + /** + * The stage of the BuilderResource definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the BuilderResource definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the BuilderResource definition allowing to specify environmentId. + */ + interface WithEnvironmentId { + /** + * Specifies the environmentId property: Resource ID of the container apps environment that the builder is + * associated with.. + * + * @param environmentId Resource ID of the container apps environment that the builder is associated with. + * @return the next definition stage. + */ + WithCreate withEnvironmentId(String environmentId); + } + + /** + * The stage of the BuilderResource definition allowing to specify containerRegistries. + */ + interface WithContainerRegistries { + /** + * Specifies the containerRegistries property: List of mappings of container registries and the managed + * identity used to connect to it.. + * + * @param containerRegistries List of mappings of container registries and the managed identity used to + * connect to it. + * @return the next definition stage. + */ + WithCreate withContainerRegistries(List containerRegistries); + } + } + + /** + * Begins update for the BuilderResource resource. + * + * @return the stage of resource update. + */ + BuilderResource.Update update(); + + /** + * The template for BuilderResource update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithEnvironmentId { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BuilderResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BuilderResource apply(Context context); + } + + /** + * The BuilderResource update stages. + */ + interface UpdateStages { + /** + * The stage of the BuilderResource update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the BuilderResource update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the BuilderResource update allowing to specify environmentId. + */ + interface WithEnvironmentId { + /** + * Specifies the environmentId property: Resource ID of the container apps environment that the builder is + * associated with.. + * + * @param environmentId Resource ID of the container apps environment that the builder is associated with. + * @return the next definition stage. + */ + Update withEnvironmentId(String environmentId); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BuilderResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BuilderResource refresh(Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderResourceUpdate.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderResourceUpdate.java new file mode 100644 index 0000000000000..90256ebdca5ea --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuilderResourceUpdate.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.fluent.models.BuilderResourceUpdateProperties; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for update operations of the BuilderResource. + */ +@Fluent +public final class BuilderResourceUpdate implements JsonSerializable { + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + + /* + * Resource tags. + */ + private Map tags; + + /* + * The updatable properties of the BuilderResource. + */ + private BuilderResourceUpdateProperties innerProperties; + + /** + * Creates an instance of BuilderResourceUpdate class. + */ + public BuilderResourceUpdate() { + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the BuilderResourceUpdate object itself. + */ + public BuilderResourceUpdate withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the BuilderResourceUpdate object itself. + */ + public BuilderResourceUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the innerProperties property: The updatable properties of the BuilderResource. + * + * @return the innerProperties value. + */ + private BuilderResourceUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the environmentId property: Resource ID of the container apps environment that the builder is associated + * with. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.innerProperties() == null ? null : this.innerProperties().environmentId(); + } + + /** + * Set the environmentId property: Resource ID of the container apps environment that the builder is associated + * with. + * + * @param environmentId the environmentId value to set. + * @return the BuilderResourceUpdate object itself. + */ + public BuilderResourceUpdate withEnvironmentId(String environmentId) { + if (this.innerProperties() == null) { + this.innerProperties = new BuilderResourceUpdateProperties(); + } + this.innerProperties().withEnvironmentId(environmentId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BuilderResourceUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuilderResourceUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the BuilderResourceUpdate. + */ + public static BuilderResourceUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuilderResourceUpdate deserializedBuilderResourceUpdate = new BuilderResourceUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedBuilderResourceUpdate.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedBuilderResourceUpdate.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedBuilderResourceUpdate.innerProperties + = BuilderResourceUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBuilderResourceUpdate; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Builders.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Builders.java new file mode 100644 index 0000000000000..d91007741556b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Builders.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Builders. + */ +public interface Builders { + /** + * List BuilderResource resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List BuilderResource resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List BuilderResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List BuilderResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuilderResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuilderResource along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String builderName, + Context context); + + /** + * Get a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuilderResource. + */ + BuilderResource getByResourceGroup(String resourceGroupName, String builderName); + + /** + * Delete a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String builderName); + + /** + * Delete a BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String builderName, Context context); + + /** + * Get a BuilderResource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuilderResource along with {@link Response}. + */ + BuilderResource getById(String id); + + /** + * Get a BuilderResource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuilderResource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a BuilderResource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a BuilderResource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new BuilderResource resource. + * + * @param name resource name. + * @return the first stage of the new BuilderResource definition. + */ + BuilderResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Builds.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Builds.java new file mode 100644 index 0000000000000..e00e51a76b575 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Builds.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Builds. + */ +public interface Builds { + /** + * Get a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuildResource along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String builderName, String buildName, + Context context); + + /** + * Get a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuildResource. + */ + BuildResource get(String resourceGroupName, String builderName, String buildName); + + /** + * Delete a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String builderName, String buildName); + + /** + * Delete a BuildResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String builderName, String buildName, Context context); + + /** + * Get a BuildResource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuildResource along with {@link Response}. + */ + BuildResource getById(String id); + + /** + * Get a BuildResource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a BuildResource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a BuildResource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a BuildResource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new BuildResource resource. + * + * @param name resource name. + * @return the first stage of the new BuildResource definition. + */ + BuildResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildsByBuilderResources.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildsByBuilderResources.java new file mode 100644 index 0000000000000..f0ff7e81d7042 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BuildsByBuilderResources.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of BuildsByBuilderResources. + */ +public interface BuildsByBuilderResources { + /** + * List BuildResource resources by BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuildResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String builderName); + + /** + * List BuildResource resources by BuilderResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param builderName The name of the builder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a BuildResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String builderName, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateKeyVaultProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateKeyVaultProperties.java new file mode 100644 index 0000000000000..2813e73fbf003 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateKeyVaultProperties.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties for a certificate stored in a Key Vault. + */ +@Fluent +public final class CertificateKeyVaultProperties implements JsonSerializable { + /* + * Resource ID of a managed identity to authenticate with Azure Key Vault, or System to use a system-assigned + * identity. + */ + private String identity; + + /* + * URL pointing to the Azure Key Vault secret that holds the certificate. + */ + private String keyVaultUrl; + + /** + * Creates an instance of CertificateKeyVaultProperties class. + */ + public CertificateKeyVaultProperties() { + } + + /** + * Get the identity property: Resource ID of a managed identity to authenticate with Azure Key Vault, or System to + * use a system-assigned identity. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: Resource ID of a managed identity to authenticate with Azure Key Vault, or System to + * use a system-assigned identity. + * + * @param identity the identity value to set. + * @return the CertificateKeyVaultProperties object itself. + */ + public CertificateKeyVaultProperties withIdentity(String identity) { + this.identity = identity; + return this; + } + + /** + * Get the keyVaultUrl property: URL pointing to the Azure Key Vault secret that holds the certificate. + * + * @return the keyVaultUrl value. + */ + public String keyVaultUrl() { + return this.keyVaultUrl; + } + + /** + * Set the keyVaultUrl property: URL pointing to the Azure Key Vault secret that holds the certificate. + * + * @param keyVaultUrl the keyVaultUrl value to set. + * @return the CertificateKeyVaultProperties object itself. + */ + public CertificateKeyVaultProperties withKeyVaultUrl(String keyVaultUrl) { + this.keyVaultUrl = keyVaultUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("identity", this.identity); + jsonWriter.writeStringField("keyVaultUrl", this.keyVaultUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CertificateKeyVaultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CertificateKeyVaultProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CertificateKeyVaultProperties. + */ + public static CertificateKeyVaultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CertificateKeyVaultProperties deserializedCertificateKeyVaultProperties + = new CertificateKeyVaultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedCertificateKeyVaultProperties.identity = reader.getString(); + } else if ("keyVaultUrl".equals(fieldName)) { + deserializedCertificateKeyVaultProperties.keyVaultUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCertificateKeyVaultProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateProperties.java index e415ebdd1be27..41c1f8b603925 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateProperties.java @@ -24,6 +24,11 @@ public final class CertificateProperties implements JsonSerializable { + /** + * Static value ServerSSLCertificate for CertificateType. + */ + public static final CertificateType SERVER_SSLCERTIFICATE = fromString("ServerSSLCertificate"); + + /** + * Static value ImagePullTrustedCA for CertificateType. + */ + public static final CertificateType IMAGE_PULL_TRUSTED_CA = fromString("ImagePullTrustedCA"); + + /** + * Creates a new instance of CertificateType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CertificateType() { + } + + /** + * Creates or finds a CertificateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CertificateType. + */ + public static CertificateType fromString(String name) { + return fromString(name, CertificateType.class); + } + + /** + * Gets known CertificateType values. + * + * @return known CertificateType values. + */ + public static Collection values() { + return values(CertificateType.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CircuitBreakerPolicy.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CircuitBreakerPolicy.java new file mode 100644 index 0000000000000..973c4c44a1bd3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CircuitBreakerPolicy.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Policy that defines circuit breaker conditions. + */ +@Fluent +public final class CircuitBreakerPolicy implements JsonSerializable { + /* + * Number of consecutive errors before the circuit breaker opens + */ + private Integer consecutiveErrors; + + /* + * The time interval, in seconds, between endpoint checks. This can result in opening the circuit breaker if the + * check fails as well as closing the circuit breaker if the check succeeds. Defaults to 10s. + */ + private Integer intervalInSeconds; + + /* + * Maximum percentage of hosts that will be ejected after failure threshold has been met + */ + private Integer maxEjectionPercent; + + /** + * Creates an instance of CircuitBreakerPolicy class. + */ + public CircuitBreakerPolicy() { + } + + /** + * Get the consecutiveErrors property: Number of consecutive errors before the circuit breaker opens. + * + * @return the consecutiveErrors value. + */ + public Integer consecutiveErrors() { + return this.consecutiveErrors; + } + + /** + * Set the consecutiveErrors property: Number of consecutive errors before the circuit breaker opens. + * + * @param consecutiveErrors the consecutiveErrors value to set. + * @return the CircuitBreakerPolicy object itself. + */ + public CircuitBreakerPolicy withConsecutiveErrors(Integer consecutiveErrors) { + this.consecutiveErrors = consecutiveErrors; + return this; + } + + /** + * Get the intervalInSeconds property: The time interval, in seconds, between endpoint checks. This can result in + * opening the circuit breaker if the check fails as well as closing the circuit breaker if the check succeeds. + * Defaults to 10s. + * + * @return the intervalInSeconds value. + */ + public Integer intervalInSeconds() { + return this.intervalInSeconds; + } + + /** + * Set the intervalInSeconds property: The time interval, in seconds, between endpoint checks. This can result in + * opening the circuit breaker if the check fails as well as closing the circuit breaker if the check succeeds. + * Defaults to 10s. + * + * @param intervalInSeconds the intervalInSeconds value to set. + * @return the CircuitBreakerPolicy object itself. + */ + public CircuitBreakerPolicy withIntervalInSeconds(Integer intervalInSeconds) { + this.intervalInSeconds = intervalInSeconds; + return this; + } + + /** + * Get the maxEjectionPercent property: Maximum percentage of hosts that will be ejected after failure threshold has + * been met. + * + * @return the maxEjectionPercent value. + */ + public Integer maxEjectionPercent() { + return this.maxEjectionPercent; + } + + /** + * Set the maxEjectionPercent property: Maximum percentage of hosts that will be ejected after failure threshold has + * been met. + * + * @param maxEjectionPercent the maxEjectionPercent value to set. + * @return the CircuitBreakerPolicy object itself. + */ + public CircuitBreakerPolicy withMaxEjectionPercent(Integer maxEjectionPercent) { + this.maxEjectionPercent = maxEjectionPercent; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("consecutiveErrors", this.consecutiveErrors); + jsonWriter.writeNumberField("intervalInSeconds", this.intervalInSeconds); + jsonWriter.writeNumberField("maxEjectionPercent", this.maxEjectionPercent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CircuitBreakerPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CircuitBreakerPolicy if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CircuitBreakerPolicy. + */ + public static CircuitBreakerPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CircuitBreakerPolicy deserializedCircuitBreakerPolicy = new CircuitBreakerPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("consecutiveErrors".equals(fieldName)) { + deserializedCircuitBreakerPolicy.consecutiveErrors = reader.getNullable(JsonReader::getInt); + } else if ("intervalInSeconds".equals(fieldName)) { + deserializedCircuitBreakerPolicy.intervalInSeconds = reader.getNullable(JsonReader::getInt); + } else if ("maxEjectionPercent".equals(fieldName)) { + deserializedCircuitBreakerPolicy.maxEjectionPercent = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedCircuitBreakerPolicy; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Configuration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Configuration.java index 68c57aaa1b70b..06b863bd1e9a3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Configuration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Configuration.java @@ -44,6 +44,11 @@ public final class Configuration implements JsonSerializable { */ private Dapr dapr; + /* + * App runtime configuration for the Container App. + */ + private Runtime runtime; + /* * Optional. Max inactive revisions a Container App can have. */ @@ -54,6 +59,12 @@ public final class Configuration implements JsonSerializable { */ private Service service; + /* + * Optional settings for Managed Identities that are assigned to the Container App. If a Managed Identity is not + * specified here, default settings will be used. + */ + private List identitySettings; + /** * Creates an instance of Configuration class. */ @@ -170,6 +181,26 @@ public Configuration withDapr(Dapr dapr) { return this; } + /** + * Get the runtime property: App runtime configuration for the Container App. + * + * @return the runtime value. + */ + public Runtime runtime() { + return this.runtime; + } + + /** + * Set the runtime property: App runtime configuration for the Container App. + * + * @param runtime the runtime value to set. + * @return the Configuration object itself. + */ + public Configuration withRuntime(Runtime runtime) { + this.runtime = runtime; + return this; + } + /** * Get the maxInactiveRevisions property: Optional. Max inactive revisions a Container App can have. * @@ -210,6 +241,28 @@ public Configuration withService(Service service) { return this; } + /** + * Get the identitySettings property: Optional settings for Managed Identities that are assigned to the Container + * App. If a Managed Identity is not specified here, default settings will be used. + * + * @return the identitySettings value. + */ + public List identitySettings() { + return this.identitySettings; + } + + /** + * Set the identitySettings property: Optional settings for Managed Identities that are assigned to the Container + * App. If a Managed Identity is not specified here, default settings will be used. + * + * @param identitySettings the identitySettings value to set. + * @return the Configuration object itself. + */ + public Configuration withIdentitySettings(List identitySettings) { + this.identitySettings = identitySettings; + return this; + } + /** * Validates the instance. * @@ -228,9 +281,15 @@ public void validate() { if (dapr() != null) { dapr().validate(); } + if (runtime() != null) { + runtime().validate(); + } if (service() != null) { service().validate(); } + if (identitySettings() != null) { + identitySettings().forEach(e -> e.validate()); + } } /** @@ -245,8 +304,11 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("ingress", this.ingress); jsonWriter.writeArrayField("registries", this.registries, (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("dapr", this.dapr); + jsonWriter.writeJsonField("runtime", this.runtime); jsonWriter.writeNumberField("maxInactiveRevisions", this.maxInactiveRevisions); jsonWriter.writeJsonField("service", this.service); + jsonWriter.writeArrayField("identitySettings", this.identitySettings, + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -278,10 +340,16 @@ public static Configuration fromJson(JsonReader jsonReader) throws IOException { deserializedConfiguration.registries = registries; } else if ("dapr".equals(fieldName)) { deserializedConfiguration.dapr = Dapr.fromJson(reader); + } else if ("runtime".equals(fieldName)) { + deserializedConfiguration.runtime = Runtime.fromJson(reader); } else if ("maxInactiveRevisions".equals(fieldName)) { deserializedConfiguration.maxInactiveRevisions = reader.getNullable(JsonReader::getInt); } else if ("service".equals(fieldName)) { deserializedConfiguration.service = Service.fromJson(reader); + } else if ("identitySettings".equals(fieldName)) { + List identitySettings + = reader.readArray(reader1 -> IdentitySettings.fromJson(reader1)); + deserializedConfiguration.identitySettings = identitySettings; } else { reader.skipChildren(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentStorageProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentStorageProperties.java index cfc287d3a816b..4ba039d9a39c7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentStorageProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentStorageProperties.java @@ -22,6 +22,11 @@ public final class ConnectedEnvironmentStorageProperties */ private AzureFileProperties azureFile; + /* + * SMB storage properties + */ + private SmbStorage smb; + /** * Creates an instance of ConnectedEnvironmentStorageProperties class. */ @@ -48,6 +53,26 @@ public ConnectedEnvironmentStorageProperties withAzureFile(AzureFileProperties a return this; } + /** + * Get the smb property: SMB storage properties. + * + * @return the smb value. + */ + public SmbStorage smb() { + return this.smb; + } + + /** + * Set the smb property: SMB storage properties. + * + * @param smb the smb value to set. + * @return the ConnectedEnvironmentStorageProperties object itself. + */ + public ConnectedEnvironmentStorageProperties withSmb(SmbStorage smb) { + this.smb = smb; + return this; + } + /** * Validates the instance. * @@ -57,6 +82,9 @@ public void validate() { if (azureFile() != null) { azureFile().validate(); } + if (smb() != null) { + smb().validate(); + } } /** @@ -66,6 +94,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("azureFile", this.azureFile); + jsonWriter.writeJsonField("smb", this.smb); return jsonWriter.writeEndObject(); } @@ -87,6 +116,8 @@ public static ConnectedEnvironmentStorageProperties fromJson(JsonReader jsonRead if ("azureFile".equals(fieldName)) { deserializedConnectedEnvironmentStorageProperties.azureFile = AzureFileProperties.fromJson(reader); + } else if ("smb".equals(fieldName)) { + deserializedConnectedEnvironmentStorageProperties.smb = SmbStorage.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Container.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Container.java index 9aa5114f3b133..dede37bf0485c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Container.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Container.java @@ -56,6 +56,15 @@ public Container withImage(String image) { return this; } + /** + * {@inheritDoc} + */ + @Override + public Container withImageType(ImageType imageType) { + super.withImageType(imageType); + return this; + } + /** * {@inheritDoc} */ @@ -117,10 +126,18 @@ public Container withVolumeMounts(List volumeMounts) { */ @Override public void validate() { - super.validate(); if (probes() != null) { probes().forEach(e -> e.validate()); } + if (env() != null) { + env().forEach(e -> e.validate()); + } + if (resources() != null) { + resources().validate(); + } + if (volumeMounts() != null) { + volumeMounts().forEach(e -> e.validate()); + } } /** @@ -130,6 +147,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("image", image()); + jsonWriter.writeStringField("imageType", imageType() == null ? null : imageType().toString()); jsonWriter.writeStringField("name", name()); jsonWriter.writeArrayField("command", command(), (writer, element) -> writer.writeString(element)); jsonWriter.writeArrayField("args", args(), (writer, element) -> writer.writeString(element)); @@ -157,6 +175,8 @@ public static Container fromJson(JsonReader jsonReader) throws IOException { if ("image".equals(fieldName)) { deserializedContainer.withImage(reader.getString()); + } else if ("imageType".equals(fieldName)) { + deserializedContainer.withImageType(ImageType.fromString(reader.getString())); } else if ("name".equals(fieldName)) { deserializedContainer.withName(reader.getString()); } else if ("command".equals(fieldName)) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerApp.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerApp.java index 45488a9f26c94..3f86e3387c148 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerApp.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerApp.java @@ -75,6 +75,15 @@ public interface ContainerApp { */ String managedBy(); + /** + * Gets the kind property: Metadata used to render different experiences for resources of the same type; e.g. + * WorkflowApp is a kind of Microsoft.App/ContainerApps type. If supported, the resource provider must validate and + * persist this value. + * + * @return the kind value. + */ + Kind kind(); + /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -89,6 +98,13 @@ public interface ContainerApp { */ ContainerAppProvisioningState provisioningState(); + /** + * Gets the deploymentErrors property: Any errors that occurred during deployment. + * + * @return the deploymentErrors value. + */ + String deploymentErrors(); + /** * Gets the managedEnvironmentId property: Deprecated. Resource ID of the Container App's environment. * @@ -110,6 +126,13 @@ public interface ContainerApp { */ String workloadProfileName(); + /** + * Gets the patchingConfiguration property: Container App auto patch configuration. + * + * @return the patchingConfiguration value. + */ + ContainerAppPropertiesPatchingConfiguration patchingConfiguration(); + /** * Gets the latestRevisionName property: Name of the latest revision of the Container App. * @@ -250,8 +273,9 @@ interface WithResourceGroup { * to be created, but also allows for any other optional properties to be specified. */ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithExtendedLocation, - DefinitionStages.WithIdentity, DefinitionStages.WithManagedBy, DefinitionStages.WithManagedEnvironmentId, - DefinitionStages.WithEnvironmentId, DefinitionStages.WithWorkloadProfileName, + DefinitionStages.WithIdentity, DefinitionStages.WithManagedBy, DefinitionStages.WithKind, + DefinitionStages.WithManagedEnvironmentId, DefinitionStages.WithEnvironmentId, + DefinitionStages.WithWorkloadProfileName, DefinitionStages.WithPatchingConfiguration, DefinitionStages.WithConfiguration, DefinitionStages.WithTemplate { /** * Executes the create request. @@ -328,6 +352,23 @@ interface WithManagedBy { WithCreate withManagedBy(String managedBy); } + /** + * The stage of the ContainerApp definition allowing to specify kind. + */ + interface WithKind { + /** + * Specifies the kind property: Metadata used to render different experiences for resources of the same + * type; e.g. WorkflowApp is a kind of Microsoft.App/ContainerApps type. If supported, the resource provider + * must validate and persist this value.. + * + * @param kind Metadata used to render different experiences for resources of the same type; e.g. + * WorkflowApp is a kind of Microsoft.App/ContainerApps type. If supported, the resource provider must + * validate and persist this value. + * @return the next definition stage. + */ + WithCreate withKind(Kind kind); + } + /** * The stage of the ContainerApp definition allowing to specify managedEnvironmentId. */ @@ -367,6 +408,19 @@ interface WithWorkloadProfileName { WithCreate withWorkloadProfileName(String workloadProfileName); } + /** + * The stage of the ContainerApp definition allowing to specify patchingConfiguration. + */ + interface WithPatchingConfiguration { + /** + * Specifies the patchingConfiguration property: Container App auto patch configuration.. + * + * @param patchingConfiguration Container App auto patch configuration. + * @return the next definition stage. + */ + WithCreate withPatchingConfiguration(ContainerAppPropertiesPatchingConfiguration patchingConfiguration); + } + /** * The stage of the ContainerApp definition allowing to specify configuration. */ @@ -405,8 +459,8 @@ interface WithTemplate { * The template for ContainerApp update. */ interface Update extends UpdateStages.WithTags, UpdateStages.WithExtendedLocation, UpdateStages.WithIdentity, - UpdateStages.WithManagedBy, UpdateStages.WithWorkloadProfileName, UpdateStages.WithConfiguration, - UpdateStages.WithTemplate { + UpdateStages.WithManagedBy, UpdateStages.WithWorkloadProfileName, UpdateStages.WithPatchingConfiguration, + UpdateStages.WithConfiguration, UpdateStages.WithTemplate { /** * Executes the update request. * @@ -499,6 +553,19 @@ interface WithWorkloadProfileName { Update withWorkloadProfileName(String workloadProfileName); } + /** + * The stage of the ContainerApp update allowing to specify patchingConfiguration. + */ + interface WithPatchingConfiguration { + /** + * Specifies the patchingConfiguration property: Container App auto patch configuration.. + * + * @param patchingConfiguration Container App auto patch configuration. + * @return the next definition stage. + */ + Update withPatchingConfiguration(ContainerAppPropertiesPatchingConfiguration patchingConfiguration); + } + /** * The stage of the ContainerApp update allowing to specify configuration. */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppPropertiesPatchingConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppPropertiesPatchingConfiguration.java new file mode 100644 index 0000000000000..538fd7361ad83 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppPropertiesPatchingConfiguration.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Container App auto patch configuration. + */ +@Fluent +public final class ContainerAppPropertiesPatchingConfiguration + implements JsonSerializable { + /* + * Patching mode for the container app. Null or default in this field will be interpreted as Automatic by RP. + * Automatic mode will automatically apply available patches. Manual mode will require the user to manually apply + * patches. Disabled mode will stop patch detection and auto patching. + */ + private PatchingMode patchingMode; + + /** + * Creates an instance of ContainerAppPropertiesPatchingConfiguration class. + */ + public ContainerAppPropertiesPatchingConfiguration() { + } + + /** + * Get the patchingMode property: Patching mode for the container app. Null or default in this field will be + * interpreted as Automatic by RP. Automatic mode will automatically apply available patches. Manual mode will + * require the user to manually apply patches. Disabled mode will stop patch detection and auto patching. + * + * @return the patchingMode value. + */ + public PatchingMode patchingMode() { + return this.patchingMode; + } + + /** + * Set the patchingMode property: Patching mode for the container app. Null or default in this field will be + * interpreted as Automatic by RP. Automatic mode will automatically apply available patches. Manual mode will + * require the user to manually apply patches. Disabled mode will stop patch detection and auto patching. + * + * @param patchingMode the patchingMode value to set. + * @return the ContainerAppPropertiesPatchingConfiguration object itself. + */ + public ContainerAppPropertiesPatchingConfiguration withPatchingMode(PatchingMode patchingMode) { + this.patchingMode = patchingMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("patchingMode", this.patchingMode == null ? null : this.patchingMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppPropertiesPatchingConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppPropertiesPatchingConfiguration if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerAppPropertiesPatchingConfiguration. + */ + public static ContainerAppPropertiesPatchingConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppPropertiesPatchingConfiguration deserializedContainerAppPropertiesPatchingConfiguration + = new ContainerAppPropertiesPatchingConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("patchingMode".equals(fieldName)) { + deserializedContainerAppPropertiesPatchingConfiguration.patchingMode + = PatchingMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppPropertiesPatchingConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildCollection.java new file mode 100644 index 0000000000000..d0764cdbf52fd --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildCollection.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsBuildResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Container Apps Build Resource list operation. + */ +@Fluent +public final class ContainerAppsBuildCollection implements JsonSerializable { + /* + * The Container Apps Build Resource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ContainerAppsBuildCollection class. + */ + public ContainerAppsBuildCollection() { + } + + /** + * Get the value property: The Container Apps Build Resource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Container Apps Build Resource items on this page. + * + * @param value the value value to set. + * @return the ContainerAppsBuildCollection object itself. + */ + public ContainerAppsBuildCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ContainerAppsBuildCollection object itself. + */ + public ContainerAppsBuildCollection withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ContainerAppsBuildCollection")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerAppsBuildCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppsBuildCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppsBuildCollection if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContainerAppsBuildCollection. + */ + public static ContainerAppsBuildCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppsBuildCollection deserializedContainerAppsBuildCollection = new ContainerAppsBuildCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ContainerAppsBuildResourceInner.fromJson(reader1)); + deserializedContainerAppsBuildCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedContainerAppsBuildCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppsBuildCollection; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildConfiguration.java new file mode 100644 index 0000000000000..1404749df225e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildConfiguration.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Configuration of the build. + */ +@Immutable +public final class ContainerAppsBuildConfiguration implements JsonSerializable { + /* + * Base OS used to build and run the app. + */ + private String baseOs; + + /* + * Platform to be used to build and run the app. + */ + private String platform; + + /* + * Platform version to be used to build and run the app. + */ + private String platformVersion; + + /* + * List of environment variables to be passed to the build, secrets should not be used in environment variable. + */ + private List environmentVariables; + + /* + * List of steps to perform before the build. + */ + private List preBuildSteps; + + /** + * Creates an instance of ContainerAppsBuildConfiguration class. + */ + public ContainerAppsBuildConfiguration() { + } + + /** + * Get the baseOs property: Base OS used to build and run the app. + * + * @return the baseOs value. + */ + public String baseOs() { + return this.baseOs; + } + + /** + * Get the platform property: Platform to be used to build and run the app. + * + * @return the platform value. + */ + public String platform() { + return this.platform; + } + + /** + * Get the platformVersion property: Platform version to be used to build and run the app. + * + * @return the platformVersion value. + */ + public String platformVersion() { + return this.platformVersion; + } + + /** + * Get the environmentVariables property: List of environment variables to be passed to the build, secrets should + * not be used in environment variable. + * + * @return the environmentVariables value. + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Get the preBuildSteps property: List of steps to perform before the build. + * + * @return the preBuildSteps value. + */ + public List preBuildSteps() { + return this.preBuildSteps; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (environmentVariables() != null) { + environmentVariables().forEach(e -> e.validate()); + } + if (preBuildSteps() != null) { + preBuildSteps().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppsBuildConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppsBuildConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerAppsBuildConfiguration. + */ + public static ContainerAppsBuildConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppsBuildConfiguration deserializedContainerAppsBuildConfiguration + = new ContainerAppsBuildConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("baseOs".equals(fieldName)) { + deserializedContainerAppsBuildConfiguration.baseOs = reader.getString(); + } else if ("platform".equals(fieldName)) { + deserializedContainerAppsBuildConfiguration.platform = reader.getString(); + } else if ("platformVersion".equals(fieldName)) { + deserializedContainerAppsBuildConfiguration.platformVersion = reader.getString(); + } else if ("environmentVariables".equals(fieldName)) { + List environmentVariables + = reader.readArray(reader1 -> EnvironmentVariable.fromJson(reader1)); + deserializedContainerAppsBuildConfiguration.environmentVariables = environmentVariables; + } else if ("preBuildSteps".equals(fieldName)) { + List preBuildSteps = reader.readArray(reader1 -> PreBuildStep.fromJson(reader1)); + deserializedContainerAppsBuildConfiguration.preBuildSteps = preBuildSteps; + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppsBuildConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildResource.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildResource.java new file mode 100644 index 0000000000000..e0a93c5e48959 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildResource.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsBuildResourceInner; + +/** + * An immutable client-side representation of ContainerAppsBuildResource. + */ +public interface ContainerAppsBuildResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Build provisioning state. + * + * @return the provisioningState value. + */ + BuildProvisioningState provisioningState(); + + /** + * Gets the buildStatus property: Status of the build once it has been provisioned. + * + * @return the buildStatus value. + */ + BuildStatus buildStatus(); + + /** + * Gets the destinationContainerRegistry property: Container registry that the final image will be uploaded to. + * + * @return the destinationContainerRegistry value. + */ + ContainerRegistryWithCustomImage destinationContainerRegistry(); + + /** + * Gets the configuration property: Configuration of the build. + * + * @return the configuration value. + */ + ContainerAppsBuildConfiguration configuration(); + + /** + * Gets the logStreamEndpoint property: Endpoint from which the build logs can be streamed. + * + * @return the logStreamEndpoint value. + */ + String logStreamEndpoint(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsBuildResourceInner object. + * + * @return the inner object. + */ + ContainerAppsBuildResourceInner innerModel(); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuilds.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuilds.java new file mode 100644 index 0000000000000..293579325fa19 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuilds.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ContainerAppsBuilds. + */ +public interface ContainerAppsBuilds { + /** + * Get a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Build resource along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String containerAppName, + String buildName, Context context); + + /** + * Get a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Build resource. + */ + ContainerAppsBuildResource get(String resourceGroupName, String containerAppName, String buildName); + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String containerAppName, String buildName); + + /** + * Delete a Container Apps Build resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param buildName The name of a build. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String containerAppName, String buildName, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildsByContainerApps.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildsByContainerApps.java new file mode 100644 index 0000000000000..bb61f0cf90135 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsBuildsByContainerApps.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of ContainerAppsBuildsByContainerApps. + */ +public interface ContainerAppsBuildsByContainerApps { + /** + * List Container Apps Build resources by Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String containerAppName); + + /** + * List Container Apps Build resources by Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Build is associated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Container Apps Build Resource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String containerAppName, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsPatchResource.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsPatchResource.java new file mode 100644 index 0000000000000..0a032a7e86e30 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsPatchResource.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsPatchResourceInner; + +/** + * An immutable client-side representation of ContainerAppsPatchResource. + */ +public interface ContainerAppsPatchResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Properties that describes current states of the patch resource. + * + * @return the properties value. + */ + PatchProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsPatchResourceInner object. + * + * @return the inner object. + */ + ContainerAppsPatchResourceInner innerModel(); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsPatches.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsPatches.java new file mode 100644 index 0000000000000..04509a19a50ee --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsPatches.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ContainerAppsPatches. + */ +public interface ContainerAppsPatches { + /** + * List Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection as paginated response with {@link PagedIterable}. + */ + PagedIterable listByContainerApp(String resourceGroupName, String containerAppName); + + /** + * List Container Apps Patch resources by ContainerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param filter The filter to apply on the operation. For example, $filter=properties/patchApplyStatus eq + * 'Succeeded'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App patch collection as paginated response with {@link PagedIterable}. + */ + PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, + String filter, Context context); + + /** + * Get details for specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details for specific Container Apps Patch by patch name along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String containerAppName, + String patchName, Context context); + + /** + * Get details for specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details for specific Container Apps Patch by patch name. + */ + ContainerAppsPatchResource get(String resourceGroupName, String containerAppName, String patchName); + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String containerAppName, String patchName); + + /** + * Delete specific Container Apps Patch by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String containerAppName, String patchName, Context context); + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void skipConfigure(String resourceGroupName, String containerAppName, String patchName, + PatchSkipConfig patchSkipConfig); + + /** + * Configure the Container Apps Patch skip option by patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param patchSkipConfig Configure patcher to skip a patch or not. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void skipConfigure(String resourceGroupName, String containerAppName, String patchName, + PatchSkipConfig patchSkipConfig, Context context); + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Patch. + */ + ContainerAppsPatchResource apply(String resourceGroupName, String containerAppName, String patchName); + + /** + * Apply a Container Apps Patch resource with patch name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App the Patch is associated. + * @param patchName The name of the patch. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Patch. + */ + ContainerAppsPatchResource apply(String resourceGroupName, String containerAppName, String patchName, + Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsSessionPools.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsSessionPools.java new file mode 100644 index 0000000000000..7e2d6e365e21e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsSessionPools.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ContainerAppsSessionPools. + */ +public interface ContainerAppsSessionPools { + /** + * Get the session pools in a given subscription. + * + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Get the session pools in a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Get the session pools in a given resource group of a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given resource group of a subscription as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get the session pools in a given resource group of a subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the session pools in a given resource group of a subscription as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get the properties of a session pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String sessionPoolName, + Context context); + + /** + * Get the properties of a session pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool. + */ + SessionPool getByResourceGroup(String resourceGroupName, String sessionPoolName); + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String sessionPoolName); + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sessionPoolName Name of the session pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String sessionPoolName, Context context); + + /** + * Get the properties of a session pool. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool along with {@link Response}. + */ + SessionPool getById(String id); + + /** + * Get the properties of a session pool. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a session pool along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a session pool. + * + * Delete the session pool with the given name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SessionPool resource. + * + * @param name resource name. + * @return the first stage of the new SessionPool definition. + */ + SessionPool.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsSourceControls.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsSourceControls.java index 41cc21d952a22..da694047a71d3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsSourceControls.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsSourceControls.java @@ -90,13 +90,17 @@ Response getWithResponse(String resourceGroupName, String contain * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @param sourceControlName Name of the Container App SourceControl. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. + * @param ignoreWorkflowDeletionFailure Ignore Workflow Deletion Failure. + * @param deleteWorkflow Delete workflow. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void delete(String resourceGroupName, String containerAppName, String sourceControlName, Context context); + void delete(String resourceGroupName, String containerAppName, String sourceControlName, String xMsGithubAuxiliary, + Boolean ignoreWorkflowDeletionFailure, Boolean deleteWorkflow, Context context); /** * Get a SourceControl of a Container App. @@ -138,13 +142,17 @@ Response getWithResponse(String resourceGroupName, String contain * Delete a Container App SourceControl. * * @param id the resource ID. + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. + * @param ignoreWorkflowDeletionFailure Ignore Workflow Deletion Failure. + * @param deleteWorkflow Delete workflow. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void deleteByIdWithResponse(String id, Context context); + void deleteByIdWithResponse(String id, String xMsGithubAuxiliary, Boolean ignoreWorkflowDeletionFailure, + Boolean deleteWorkflow, Context context); /** * Begins definition for a new SourceControl resource. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerExecutionStatus.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerExecutionStatus.java new file mode 100644 index 0000000000000..0ca01e367769e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerExecutionStatus.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Container Apps Job execution container status. Contains status code and reason. + */ +@Fluent +public final class ContainerExecutionStatus implements JsonSerializable { + /* + * Container Name. + */ + private String name; + + /* + * Exit code + */ + private Integer code; + + /* + * Additional information for the container status + */ + private String additionalInformation; + + /* + * Status of the container + */ + private String status; + + /** + * Creates an instance of ContainerExecutionStatus class. + */ + public ContainerExecutionStatus() { + } + + /** + * Get the name property: Container Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Container Name. + * + * @param name the name value to set. + * @return the ContainerExecutionStatus object itself. + */ + public ContainerExecutionStatus withName(String name) { + this.name = name; + return this; + } + + /** + * Get the code property: Exit code. + * + * @return the code value. + */ + public Integer code() { + return this.code; + } + + /** + * Set the code property: Exit code. + * + * @param code the code value to set. + * @return the ContainerExecutionStatus object itself. + */ + public ContainerExecutionStatus withCode(Integer code) { + this.code = code; + return this; + } + + /** + * Get the additionalInformation property: Additional information for the container status. + * + * @return the additionalInformation value. + */ + public String additionalInformation() { + return this.additionalInformation; + } + + /** + * Set the additionalInformation property: Additional information for the container status. + * + * @param additionalInformation the additionalInformation value to set. + * @return the ContainerExecutionStatus object itself. + */ + public ContainerExecutionStatus withAdditionalInformation(String additionalInformation) { + this.additionalInformation = additionalInformation; + return this; + } + + /** + * Get the status property: Status of the container. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Status of the container. + * + * @param status the status value to set. + * @return the ContainerExecutionStatus object itself. + */ + public ContainerExecutionStatus withStatus(String status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("code", this.code); + jsonWriter.writeStringField("additionalInformation", this.additionalInformation); + jsonWriter.writeStringField("status", this.status); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerExecutionStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerExecutionStatus if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerExecutionStatus. + */ + public static ContainerExecutionStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerExecutionStatus deserializedContainerExecutionStatus = new ContainerExecutionStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedContainerExecutionStatus.name = reader.getString(); + } else if ("code".equals(fieldName)) { + deserializedContainerExecutionStatus.code = reader.getNullable(JsonReader::getInt); + } else if ("additionalInformation".equals(fieldName)) { + deserializedContainerExecutionStatus.additionalInformation = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedContainerExecutionStatus.status = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerExecutionStatus; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerRegistry.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerRegistry.java new file mode 100644 index 0000000000000..a20c60c562547 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerRegistry.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Model representing a mapping from a container registry to the identity used to connect to it. + */ +@Fluent +public final class ContainerRegistry implements JsonSerializable { + /* + * Login server of the container registry. + */ + private String containerRegistryServer; + + /* + * Resource ID of the managed identity. + */ + private String identityResourceId; + + /** + * Creates an instance of ContainerRegistry class. + */ + public ContainerRegistry() { + } + + /** + * Get the containerRegistryServer property: Login server of the container registry. + * + * @return the containerRegistryServer value. + */ + public String containerRegistryServer() { + return this.containerRegistryServer; + } + + /** + * Set the containerRegistryServer property: Login server of the container registry. + * + * @param containerRegistryServer the containerRegistryServer value to set. + * @return the ContainerRegistry object itself. + */ + public ContainerRegistry withContainerRegistryServer(String containerRegistryServer) { + this.containerRegistryServer = containerRegistryServer; + return this; + } + + /** + * Get the identityResourceId property: Resource ID of the managed identity. + * + * @return the identityResourceId value. + */ + public String identityResourceId() { + return this.identityResourceId; + } + + /** + * Set the identityResourceId property: Resource ID of the managed identity. + * + * @param identityResourceId the identityResourceId value to set. + * @return the ContainerRegistry object itself. + */ + public ContainerRegistry withIdentityResourceId(String identityResourceId) { + this.identityResourceId = identityResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (containerRegistryServer() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property containerRegistryServer in model ContainerRegistry")); + } + if (identityResourceId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property identityResourceId in model ContainerRegistry")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerRegistry.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("containerRegistryServer", this.containerRegistryServer); + jsonWriter.writeStringField("identityResourceId", this.identityResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerRegistry from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerRegistry if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContainerRegistry. + */ + public static ContainerRegistry fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerRegistry deserializedContainerRegistry = new ContainerRegistry(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerRegistryServer".equals(fieldName)) { + deserializedContainerRegistry.containerRegistryServer = reader.getString(); + } else if ("identityResourceId".equals(fieldName)) { + deserializedContainerRegistry.identityResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerRegistry; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerRegistryWithCustomImage.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerRegistryWithCustomImage.java new file mode 100644 index 0000000000000..aefd2633fb20f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerRegistryWithCustomImage.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Container registry that the final image will be uploaded to. + */ +@Fluent +public final class ContainerRegistryWithCustomImage implements JsonSerializable { + /* + * Login server of the container registry that the final image should be uploaded to. Builder resource needs to have + * this container registry defined along with an identity to use to access it. + */ + private String server; + + /* + * Full name that the final image should be uploaded as, including both image name and tag. + */ + private String image; + + /** + * Creates an instance of ContainerRegistryWithCustomImage class. + */ + public ContainerRegistryWithCustomImage() { + } + + /** + * Get the server property: Login server of the container registry that the final image should be uploaded to. + * Builder resource needs to have this container registry defined along with an identity to use to access it. + * + * @return the server value. + */ + public String server() { + return this.server; + } + + /** + * Set the server property: Login server of the container registry that the final image should be uploaded to. + * Builder resource needs to have this container registry defined along with an identity to use to access it. + * + * @param server the server value to set. + * @return the ContainerRegistryWithCustomImage object itself. + */ + public ContainerRegistryWithCustomImage withServer(String server) { + this.server = server; + return this; + } + + /** + * Get the image property: Full name that the final image should be uploaded as, including both image name and tag. + * + * @return the image value. + */ + public String image() { + return this.image; + } + + /** + * Set the image property: Full name that the final image should be uploaded as, including both image name and tag. + * + * @param image the image value to set. + * @return the ContainerRegistryWithCustomImage object itself. + */ + public ContainerRegistryWithCustomImage withImage(String image) { + this.image = image; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (server() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property server in model ContainerRegistryWithCustomImage")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerRegistryWithCustomImage.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("server", this.server); + jsonWriter.writeStringField("image", this.image); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerRegistryWithCustomImage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerRegistryWithCustomImage if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContainerRegistryWithCustomImage. + */ + public static ContainerRegistryWithCustomImage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerRegistryWithCustomImage deserializedContainerRegistryWithCustomImage + = new ContainerRegistryWithCustomImage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("server".equals(fieldName)) { + deserializedContainerRegistryWithCustomImage.server = reader.getString(); + } else if ("image".equals(fieldName)) { + deserializedContainerRegistryWithCustomImage.image = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerRegistryWithCustomImage; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerType.java new file mode 100644 index 0000000000000..e8b2e7cc4a582 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The container type of the sessions. + */ +public final class ContainerType extends ExpandableStringEnum { + /** + * Static value CustomContainer for ContainerType. + */ + public static final ContainerType CUSTOM_CONTAINER = fromString("CustomContainer"); + + /** + * Static value PythonLTS for ContainerType. + */ + public static final ContainerType PYTHON_LTS = fromString("PythonLTS"); + + /** + * Creates a new instance of ContainerType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContainerType() { + } + + /** + * Creates or finds a ContainerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerType. + */ + public static ContainerType fromString(String name) { + return fromString(name, ContainerType.class); + } + + /** + * Gets known ContainerType values. + * + * @return known ContainerType values. + */ + public static Collection values() { + return values(ContainerType.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomContainerTemplate.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomContainerTemplate.java new file mode 100644 index 0000000000000..63725b65db729 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomContainerTemplate.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Custom container configuration. + */ +@Fluent +public final class CustomContainerTemplate implements JsonSerializable { + /* + * Private container registry credentials for containers used by the sessions of the session pool. + */ + private SessionRegistryCredentials registryCredentials; + + /* + * List of container definitions for the sessions of the session pool. + */ + private List containers; + + /* + * Session pool ingress configuration. + */ + private SessionIngress ingress; + + /** + * Creates an instance of CustomContainerTemplate class. + */ + public CustomContainerTemplate() { + } + + /** + * Get the registryCredentials property: Private container registry credentials for containers used by the sessions + * of the session pool. + * + * @return the registryCredentials value. + */ + public SessionRegistryCredentials registryCredentials() { + return this.registryCredentials; + } + + /** + * Set the registryCredentials property: Private container registry credentials for containers used by the sessions + * of the session pool. + * + * @param registryCredentials the registryCredentials value to set. + * @return the CustomContainerTemplate object itself. + */ + public CustomContainerTemplate withRegistryCredentials(SessionRegistryCredentials registryCredentials) { + this.registryCredentials = registryCredentials; + return this; + } + + /** + * Get the containers property: List of container definitions for the sessions of the session pool. + * + * @return the containers value. + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers property: List of container definitions for the sessions of the session pool. + * + * @param containers the containers value to set. + * @return the CustomContainerTemplate object itself. + */ + public CustomContainerTemplate withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the ingress property: Session pool ingress configuration. + * + * @return the ingress value. + */ + public SessionIngress ingress() { + return this.ingress; + } + + /** + * Set the ingress property: Session pool ingress configuration. + * + * @param ingress the ingress value to set. + * @return the CustomContainerTemplate object itself. + */ + public CustomContainerTemplate withIngress(SessionIngress ingress) { + this.ingress = ingress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (registryCredentials() != null) { + registryCredentials().validate(); + } + if (containers() != null) { + containers().forEach(e -> e.validate()); + } + if (ingress() != null) { + ingress().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("registryCredentials", this.registryCredentials); + jsonWriter.writeArrayField("containers", this.containers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("ingress", this.ingress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomContainerTemplate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomContainerTemplate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomContainerTemplate. + */ + public static CustomContainerTemplate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomContainerTemplate deserializedCustomContainerTemplate = new CustomContainerTemplate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("registryCredentials".equals(fieldName)) { + deserializedCustomContainerTemplate.registryCredentials + = SessionRegistryCredentials.fromJson(reader); + } else if ("containers".equals(fieldName)) { + List containers = reader.readArray(reader1 -> SessionContainer.fromJson(reader1)); + deserializedCustomContainerTemplate.containers = containers; + } else if ("ingress".equals(fieldName)) { + deserializedCustomContainerTemplate.ingress = SessionIngress.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomContainerTemplate; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomainConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomainConfiguration.java index 29855b1bbca42..543efc3f3adf5 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomainConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomainConfiguration.java @@ -28,6 +28,11 @@ public final class CustomDomainConfiguration implements JsonSerializable */ private List auth; + /* + * The resource ID of a user-assigned managed identity that is assigned to the Container App, or 'system' for + * system-assigned identity. + */ + private String identity; + /** * Creates an instance of CustomScaleRule class. */ @@ -102,6 +108,28 @@ public CustomScaleRule withAuth(List auth) { return this; } + /** + * Get the identity property: The resource ID of a user-assigned managed identity that is assigned to the Container + * App, or 'system' for system-assigned identity. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: The resource ID of a user-assigned managed identity that is assigned to the Container + * App, or 'system' for system-assigned identity. + * + * @param identity the identity value to set. + * @return the CustomScaleRule object itself. + */ + public CustomScaleRule withIdentity(String identity) { + this.identity = identity; + return this; + } + /** * Validates the instance. * @@ -122,6 +150,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("type", this.type); jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); jsonWriter.writeArrayField("auth", this.auth, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -148,6 +177,8 @@ public static CustomScaleRule fromJson(JsonReader jsonReader) throws IOException } else if ("auth".equals(fieldName)) { List auth = reader.readArray(reader1 -> ScaleRuleAuth.fromJson(reader1)); deserializedCustomScaleRule.auth = auth; + } else if ("identity".equals(fieldName)) { + deserializedCustomScaleRule.identity = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponent.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponent.java index 11986b1d22c94..dc79196c99796 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponent.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponent.java @@ -98,6 +98,13 @@ public interface DaprComponent { */ List scopes(); + /** + * Gets the serviceComponentBind property: List of container app services that are bound to the Dapr component. + * + * @return the serviceComponentBind value. + */ + List serviceComponentBind(); + /** * Gets the name of the resource group. * @@ -147,9 +154,10 @@ interface WithParentResource { * The stage of the DaprComponent definition which contains all the minimum required properties for the resource * to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithComponentType, DefinitionStages.WithVersion, - DefinitionStages.WithIgnoreErrors, DefinitionStages.WithInitTimeout, DefinitionStages.WithSecrets, - DefinitionStages.WithSecretStoreComponent, DefinitionStages.WithMetadata, DefinitionStages.WithScopes { + interface WithCreate + extends DefinitionStages.WithComponentType, DefinitionStages.WithVersion, DefinitionStages.WithIgnoreErrors, + DefinitionStages.WithInitTimeout, DefinitionStages.WithSecrets, DefinitionStages.WithSecretStoreComponent, + DefinitionStages.WithMetadata, DefinitionStages.WithScopes, DefinitionStages.WithServiceComponentBind { /** * Executes the create request. * @@ -269,6 +277,20 @@ interface WithScopes { */ WithCreate withScopes(List scopes); } + + /** + * The stage of the DaprComponent definition allowing to specify serviceComponentBind. + */ + interface WithServiceComponentBind { + /** + * Specifies the serviceComponentBind property: List of container app services that are bound to the Dapr + * component. + * + * @param serviceComponentBind List of container app services that are bound to the Dapr component. + * @return the next definition stage. + */ + WithCreate withServiceComponentBind(List serviceComponentBind); + } } /** @@ -283,7 +305,7 @@ interface WithScopes { */ interface Update extends UpdateStages.WithComponentType, UpdateStages.WithVersion, UpdateStages.WithIgnoreErrors, UpdateStages.WithInitTimeout, UpdateStages.WithSecrets, UpdateStages.WithSecretStoreComponent, - UpdateStages.WithMetadata, UpdateStages.WithScopes { + UpdateStages.WithMetadata, UpdateStages.WithScopes, UpdateStages.WithServiceComponentBind { /** * Executes the update request. * @@ -407,6 +429,20 @@ interface WithScopes { */ Update withScopes(List scopes); } + + /** + * The stage of the DaprComponent update allowing to specify serviceComponentBind. + */ + interface WithServiceComponentBind { + /** + * Specifies the serviceComponentBind property: List of container app services that are bound to the Dapr + * component. + * + * @param serviceComponentBind List of container app services that are bound to the Dapr component. + * @return the next definition stage. + */ + Update withServiceComponentBind(List serviceComponentBind); + } } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicies.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicies.java new file mode 100644 index 0000000000000..5658db8005ade --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicies.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of DaprComponentResiliencyPolicies. + */ +public interface DaprComponentResiliencyPolicies { + /** + * Get the resiliency policies for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resiliency policies for a Dapr component as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName, + String componentName); + + /** + * Get the resiliency policies for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the resiliency policies for a Dapr component as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName, + String componentName, Context context); + + /** + * Get a Dapr component resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Dapr component resiliency policy along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String environmentName, + String componentName, String name, Context context); + + /** + * Get a Dapr component resiliency policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Dapr component resiliency policy. + */ + DaprComponentResiliencyPolicy get(String resourceGroupName, String environmentName, String componentName, + String name); + + /** + * Delete a Dapr component resiliency policy. + * + * Delete a resiliency policy for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String environmentName, String componentName, + String name, Context context); + + /** + * Delete a Dapr component resiliency policy. + * + * Delete a resiliency policy for a Dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @param name Name of the Dapr Component Resiliency Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String environmentName, String componentName, String name); + + /** + * Get a Dapr component resiliency policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Dapr component resiliency policy along with {@link Response}. + */ + DaprComponentResiliencyPolicy getById(String id); + + /** + * Get a Dapr component resiliency policy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Dapr component resiliency policy along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Dapr component resiliency policy. + * + * Delete a resiliency policy for a Dapr component. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Dapr component resiliency policy. + * + * Delete a resiliency policy for a Dapr component. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DaprComponentResiliencyPolicy resource. + * + * @param name resource name. + * @return the first stage of the new DaprComponentResiliencyPolicy definition. + */ + DaprComponentResiliencyPolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPoliciesCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPoliciesCollection.java new file mode 100644 index 0000000000000..cc87807184db9 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPoliciesCollection.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentResiliencyPolicyInner; +import java.io.IOException; +import java.util.List; + +/** + * Dapr Component Resiliency Policies ARM resource. + */ +@Fluent +public final class DaprComponentResiliencyPoliciesCollection + implements JsonSerializable { + /* + * Collection of resources. + */ + private List value; + + /* + * Link to next page of resources. + */ + private String nextLink; + + /** + * Creates an instance of DaprComponentResiliencyPoliciesCollection class. + */ + public DaprComponentResiliencyPoliciesCollection() { + } + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the DaprComponentResiliencyPoliciesCollection object itself. + */ + public DaprComponentResiliencyPoliciesCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model DaprComponentResiliencyPoliciesCollection")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DaprComponentResiliencyPoliciesCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprComponentResiliencyPoliciesCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprComponentResiliencyPoliciesCollection if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DaprComponentResiliencyPoliciesCollection. + */ + public static DaprComponentResiliencyPoliciesCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprComponentResiliencyPoliciesCollection deserializedDaprComponentResiliencyPoliciesCollection + = new DaprComponentResiliencyPoliciesCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DaprComponentResiliencyPolicyInner.fromJson(reader1)); + deserializedDaprComponentResiliencyPoliciesCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDaprComponentResiliencyPoliciesCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprComponentResiliencyPoliciesCollection; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicy.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicy.java new file mode 100644 index 0000000000000..a8322cfe73ff2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicy.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentResiliencyPolicyInner; + +/** + * An immutable client-side representation of DaprComponentResiliencyPolicy. + */ +public interface DaprComponentResiliencyPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inboundPolicy property: The optional inbound component resiliency policy configuration. + * + * @return the inboundPolicy value. + */ + DaprComponentResiliencyPolicyConfiguration inboundPolicy(); + + /** + * Gets the outboundPolicy property: The optional outbound component resiliency policy configuration. + * + * @return the outboundPolicy value. + */ + DaprComponentResiliencyPolicyConfiguration outboundPolicy(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentResiliencyPolicyInner object. + * + * @return the inner object. + */ + DaprComponentResiliencyPolicyInner innerModel(); + + /** + * The entirety of the DaprComponentResiliencyPolicy definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The DaprComponentResiliencyPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the DaprComponentResiliencyPolicy definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the DaprComponentResiliencyPolicy definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, environmentName, componentName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. + * @return the next definition stage. + */ + WithCreate withExistingDaprComponent(String resourceGroupName, String environmentName, + String componentName); + } + + /** + * The stage of the DaprComponentResiliencyPolicy definition which contains all the minimum required properties + * for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithInboundPolicy, DefinitionStages.WithOutboundPolicy { + /** + * Executes the create request. + * + * @return the created resource. + */ + DaprComponentResiliencyPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DaprComponentResiliencyPolicy create(Context context); + } + + /** + * The stage of the DaprComponentResiliencyPolicy definition allowing to specify inboundPolicy. + */ + interface WithInboundPolicy { + /** + * Specifies the inboundPolicy property: The optional inbound component resiliency policy configuration. + * + * @param inboundPolicy The optional inbound component resiliency policy configuration. + * @return the next definition stage. + */ + WithCreate withInboundPolicy(DaprComponentResiliencyPolicyConfiguration inboundPolicy); + } + + /** + * The stage of the DaprComponentResiliencyPolicy definition allowing to specify outboundPolicy. + */ + interface WithOutboundPolicy { + /** + * Specifies the outboundPolicy property: The optional outbound component resiliency policy configuration. + * + * @param outboundPolicy The optional outbound component resiliency policy configuration. + * @return the next definition stage. + */ + WithCreate withOutboundPolicy(DaprComponentResiliencyPolicyConfiguration outboundPolicy); + } + } + + /** + * Begins update for the DaprComponentResiliencyPolicy resource. + * + * @return the stage of resource update. + */ + DaprComponentResiliencyPolicy.Update update(); + + /** + * The template for DaprComponentResiliencyPolicy update. + */ + interface Update extends UpdateStages.WithInboundPolicy, UpdateStages.WithOutboundPolicy { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DaprComponentResiliencyPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DaprComponentResiliencyPolicy apply(Context context); + } + + /** + * The DaprComponentResiliencyPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the DaprComponentResiliencyPolicy update allowing to specify inboundPolicy. + */ + interface WithInboundPolicy { + /** + * Specifies the inboundPolicy property: The optional inbound component resiliency policy configuration. + * + * @param inboundPolicy The optional inbound component resiliency policy configuration. + * @return the next definition stage. + */ + Update withInboundPolicy(DaprComponentResiliencyPolicyConfiguration inboundPolicy); + } + + /** + * The stage of the DaprComponentResiliencyPolicy update allowing to specify outboundPolicy. + */ + interface WithOutboundPolicy { + /** + * Specifies the outboundPolicy property: The optional outbound component resiliency policy configuration. + * + * @param outboundPolicy The optional outbound component resiliency policy configuration. + * @return the next definition stage. + */ + Update withOutboundPolicy(DaprComponentResiliencyPolicyConfiguration outboundPolicy); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DaprComponentResiliencyPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DaprComponentResiliencyPolicy refresh(Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.java new file mode 100644 index 0000000000000..d1e30673c5595 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Dapr Component Resiliency Policy Circuit Breaker Policy Configuration. + */ +@Fluent +public final class DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration + implements JsonSerializable { + /* + * The number of consecutive errors before the circuit is opened. + */ + private Integer consecutiveErrors; + + /* + * The interval in seconds until a retry attempt is made after the circuit is opened. + */ + private Integer timeoutInSeconds; + + /* + * The optional interval in seconds after which the error count resets to 0. An interval of 0 will never reset. If + * not specified, the timeoutInSeconds value will be used. + */ + private Integer intervalInSeconds; + + /** + * Creates an instance of DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration class. + */ + public DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration() { + } + + /** + * Get the consecutiveErrors property: The number of consecutive errors before the circuit is opened. + * + * @return the consecutiveErrors value. + */ + public Integer consecutiveErrors() { + return this.consecutiveErrors; + } + + /** + * Set the consecutiveErrors property: The number of consecutive errors before the circuit is opened. + * + * @param consecutiveErrors the consecutiveErrors value to set. + * @return the DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration object itself. + */ + public DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration + withConsecutiveErrors(Integer consecutiveErrors) { + this.consecutiveErrors = consecutiveErrors; + return this; + } + + /** + * Get the timeoutInSeconds property: The interval in seconds until a retry attempt is made after the circuit is + * opened. + * + * @return the timeoutInSeconds value. + */ + public Integer timeoutInSeconds() { + return this.timeoutInSeconds; + } + + /** + * Set the timeoutInSeconds property: The interval in seconds until a retry attempt is made after the circuit is + * opened. + * + * @param timeoutInSeconds the timeoutInSeconds value to set. + * @return the DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration object itself. + */ + public DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration + withTimeoutInSeconds(Integer timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get the intervalInSeconds property: The optional interval in seconds after which the error count resets to 0. An + * interval of 0 will never reset. If not specified, the timeoutInSeconds value will be used. + * + * @return the intervalInSeconds value. + */ + public Integer intervalInSeconds() { + return this.intervalInSeconds; + } + + /** + * Set the intervalInSeconds property: The optional interval in seconds after which the error count resets to 0. An + * interval of 0 will never reset. If not specified, the timeoutInSeconds value will be used. + * + * @param intervalInSeconds the intervalInSeconds value to set. + * @return the DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration object itself. + */ + public DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration + withIntervalInSeconds(Integer intervalInSeconds) { + this.intervalInSeconds = intervalInSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("consecutiveErrors", this.consecutiveErrors); + jsonWriter.writeNumberField("timeoutInSeconds", this.timeoutInSeconds); + jsonWriter.writeNumberField("intervalInSeconds", this.intervalInSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration. + */ + public static DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration deserializedDaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration + = new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("consecutiveErrors".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.consecutiveErrors + = reader.getNullable(JsonReader::getInt); + } else if ("timeoutInSeconds".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.timeoutInSeconds + = reader.getNullable(JsonReader::getInt); + } else if ("intervalInSeconds".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.intervalInSeconds + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyConfiguration.java new file mode 100644 index 0000000000000..3e83447dbee9a --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyConfiguration.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Dapr Component Resiliency Policy Configuration. + */ +@Fluent +public final class DaprComponentResiliencyPolicyConfiguration + implements JsonSerializable { + /* + * The optional HTTP retry policy configuration + */ + private DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration httpRetryPolicy; + + /* + * The optional timeout policy configuration + */ + private DaprComponentResiliencyPolicyTimeoutPolicyConfiguration timeoutPolicy; + + /* + * The optional circuit breaker policy configuration + */ + private DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration circuitBreakerPolicy; + + /** + * Creates an instance of DaprComponentResiliencyPolicyConfiguration class. + */ + public DaprComponentResiliencyPolicyConfiguration() { + } + + /** + * Get the httpRetryPolicy property: The optional HTTP retry policy configuration. + * + * @return the httpRetryPolicy value. + */ + public DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration httpRetryPolicy() { + return this.httpRetryPolicy; + } + + /** + * Set the httpRetryPolicy property: The optional HTTP retry policy configuration. + * + * @param httpRetryPolicy the httpRetryPolicy value to set. + * @return the DaprComponentResiliencyPolicyConfiguration object itself. + */ + public DaprComponentResiliencyPolicyConfiguration + withHttpRetryPolicy(DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration httpRetryPolicy) { + this.httpRetryPolicy = httpRetryPolicy; + return this; + } + + /** + * Get the timeoutPolicy property: The optional timeout policy configuration. + * + * @return the timeoutPolicy value. + */ + public DaprComponentResiliencyPolicyTimeoutPolicyConfiguration timeoutPolicy() { + return this.timeoutPolicy; + } + + /** + * Set the timeoutPolicy property: The optional timeout policy configuration. + * + * @param timeoutPolicy the timeoutPolicy value to set. + * @return the DaprComponentResiliencyPolicyConfiguration object itself. + */ + public DaprComponentResiliencyPolicyConfiguration + withTimeoutPolicy(DaprComponentResiliencyPolicyTimeoutPolicyConfiguration timeoutPolicy) { + this.timeoutPolicy = timeoutPolicy; + return this; + } + + /** + * Get the circuitBreakerPolicy property: The optional circuit breaker policy configuration. + * + * @return the circuitBreakerPolicy value. + */ + public DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration circuitBreakerPolicy() { + return this.circuitBreakerPolicy; + } + + /** + * Set the circuitBreakerPolicy property: The optional circuit breaker policy configuration. + * + * @param circuitBreakerPolicy the circuitBreakerPolicy value to set. + * @return the DaprComponentResiliencyPolicyConfiguration object itself. + */ + public DaprComponentResiliencyPolicyConfiguration + withCircuitBreakerPolicy(DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration circuitBreakerPolicy) { + this.circuitBreakerPolicy = circuitBreakerPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (httpRetryPolicy() != null) { + httpRetryPolicy().validate(); + } + if (timeoutPolicy() != null) { + timeoutPolicy().validate(); + } + if (circuitBreakerPolicy() != null) { + circuitBreakerPolicy().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("httpRetryPolicy", this.httpRetryPolicy); + jsonWriter.writeJsonField("timeoutPolicy", this.timeoutPolicy); + jsonWriter.writeJsonField("circuitBreakerPolicy", this.circuitBreakerPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprComponentResiliencyPolicyConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprComponentResiliencyPolicyConfiguration if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprComponentResiliencyPolicyConfiguration. + */ + public static DaprComponentResiliencyPolicyConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprComponentResiliencyPolicyConfiguration deserializedDaprComponentResiliencyPolicyConfiguration + = new DaprComponentResiliencyPolicyConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("httpRetryPolicy".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyConfiguration.httpRetryPolicy + = DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.fromJson(reader); + } else if ("timeoutPolicy".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyConfiguration.timeoutPolicy + = DaprComponentResiliencyPolicyTimeoutPolicyConfiguration.fromJson(reader); + } else if ("circuitBreakerPolicy".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyConfiguration.circuitBreakerPolicy + = DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprComponentResiliencyPolicyConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.java new file mode 100644 index 0000000000000..5a8a3dfdbaf19 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Dapr Component Resiliency Policy HTTP Retry Backoff Configuration. + */ +@Fluent +public final class DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration + implements JsonSerializable { + /* + * The optional initial delay in milliseconds before an operation is retried + */ + private Integer initialDelayInMilliseconds; + + /* + * The optional maximum time interval in milliseconds between retry attempts + */ + private Integer maxIntervalInMilliseconds; + + /** + * Creates an instance of DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration class. + */ + public DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() { + } + + /** + * Get the initialDelayInMilliseconds property: The optional initial delay in milliseconds before an operation is + * retried. + * + * @return the initialDelayInMilliseconds value. + */ + public Integer initialDelayInMilliseconds() { + return this.initialDelayInMilliseconds; + } + + /** + * Set the initialDelayInMilliseconds property: The optional initial delay in milliseconds before an operation is + * retried. + * + * @param initialDelayInMilliseconds the initialDelayInMilliseconds value to set. + * @return the DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration object itself. + */ + public DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration + withInitialDelayInMilliseconds(Integer initialDelayInMilliseconds) { + this.initialDelayInMilliseconds = initialDelayInMilliseconds; + return this; + } + + /** + * Get the maxIntervalInMilliseconds property: The optional maximum time interval in milliseconds between retry + * attempts. + * + * @return the maxIntervalInMilliseconds value. + */ + public Integer maxIntervalInMilliseconds() { + return this.maxIntervalInMilliseconds; + } + + /** + * Set the maxIntervalInMilliseconds property: The optional maximum time interval in milliseconds between retry + * attempts. + * + * @param maxIntervalInMilliseconds the maxIntervalInMilliseconds value to set. + * @return the DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration object itself. + */ + public DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration + withMaxIntervalInMilliseconds(Integer maxIntervalInMilliseconds) { + this.maxIntervalInMilliseconds = maxIntervalInMilliseconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("initialDelayInMilliseconds", this.initialDelayInMilliseconds); + jsonWriter.writeNumberField("maxIntervalInMilliseconds", this.maxIntervalInMilliseconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration. + */ + public static DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration deserializedDaprComponentResiliencyPolicyHttpRetryBackOffConfiguration + = new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("initialDelayInMilliseconds".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.initialDelayInMilliseconds + = reader.getNullable(JsonReader::getInt); + } else if ("maxIntervalInMilliseconds".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.maxIntervalInMilliseconds + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprComponentResiliencyPolicyHttpRetryBackOffConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.java new file mode 100644 index 0000000000000..f88a92cdb6748 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Dapr Component Resiliency Policy HTTP Retry Policy Configuration. + */ +@Fluent +public final class DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration + implements JsonSerializable { + /* + * The optional maximum number of retries + */ + private Integer maxRetries; + + /* + * The optional retry backoff configuration + */ + private DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration retryBackOff; + + /** + * Creates an instance of DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration class. + */ + public DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration() { + } + + /** + * Get the maxRetries property: The optional maximum number of retries. + * + * @return the maxRetries value. + */ + public Integer maxRetries() { + return this.maxRetries; + } + + /** + * Set the maxRetries property: The optional maximum number of retries. + * + * @param maxRetries the maxRetries value to set. + * @return the DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration object itself. + */ + public DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration withMaxRetries(Integer maxRetries) { + this.maxRetries = maxRetries; + return this; + } + + /** + * Get the retryBackOff property: The optional retry backoff configuration. + * + * @return the retryBackOff value. + */ + public DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration retryBackOff() { + return this.retryBackOff; + } + + /** + * Set the retryBackOff property: The optional retry backoff configuration. + * + * @param retryBackOff the retryBackOff value to set. + * @return the DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration object itself. + */ + public DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration + withRetryBackOff(DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration retryBackOff) { + this.retryBackOff = retryBackOff; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (retryBackOff() != null) { + retryBackOff().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maxRetries", this.maxRetries); + jsonWriter.writeJsonField("retryBackOff", this.retryBackOff); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration. + */ + public static DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration deserializedDaprComponentResiliencyPolicyHttpRetryPolicyConfiguration + = new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxRetries".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.maxRetries + = reader.getNullable(JsonReader::getInt); + } else if ("retryBackOff".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.retryBackOff + = DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprComponentResiliencyPolicyHttpRetryPolicyConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyTimeoutPolicyConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyTimeoutPolicyConfiguration.java new file mode 100644 index 0000000000000..c90caf2f86bb1 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyTimeoutPolicyConfiguration.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Dapr Component Resiliency Policy Timeout Policy Configuration. + */ +@Fluent +public final class DaprComponentResiliencyPolicyTimeoutPolicyConfiguration + implements JsonSerializable { + /* + * The optional response timeout in seconds + */ + private Integer responseTimeoutInSeconds; + + /** + * Creates an instance of DaprComponentResiliencyPolicyTimeoutPolicyConfiguration class. + */ + public DaprComponentResiliencyPolicyTimeoutPolicyConfiguration() { + } + + /** + * Get the responseTimeoutInSeconds property: The optional response timeout in seconds. + * + * @return the responseTimeoutInSeconds value. + */ + public Integer responseTimeoutInSeconds() { + return this.responseTimeoutInSeconds; + } + + /** + * Set the responseTimeoutInSeconds property: The optional response timeout in seconds. + * + * @param responseTimeoutInSeconds the responseTimeoutInSeconds value to set. + * @return the DaprComponentResiliencyPolicyTimeoutPolicyConfiguration object itself. + */ + public DaprComponentResiliencyPolicyTimeoutPolicyConfiguration + withResponseTimeoutInSeconds(Integer responseTimeoutInSeconds) { + this.responseTimeoutInSeconds = responseTimeoutInSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("responseTimeoutInSeconds", this.responseTimeoutInSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprComponentResiliencyPolicyTimeoutPolicyConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprComponentResiliencyPolicyTimeoutPolicyConfiguration if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprComponentResiliencyPolicyTimeoutPolicyConfiguration. + */ + public static DaprComponentResiliencyPolicyTimeoutPolicyConfiguration fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + DaprComponentResiliencyPolicyTimeoutPolicyConfiguration deserializedDaprComponentResiliencyPolicyTimeoutPolicyConfiguration + = new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("responseTimeoutInSeconds".equals(fieldName)) { + deserializedDaprComponentResiliencyPolicyTimeoutPolicyConfiguration.responseTimeoutInSeconds + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprComponentResiliencyPolicyTimeoutPolicyConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentServiceBinding.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentServiceBinding.java new file mode 100644 index 0000000000000..0d4739a9d4f63 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentServiceBinding.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration to bind a Dapr Component to a dev ContainerApp Service. + */ +@Fluent +public final class DaprComponentServiceBinding implements JsonSerializable { + /* + * Name of the service bind + */ + private String name; + + /* + * Resource id of the target service + */ + private String serviceId; + + /* + * Service bind metadata + */ + private DaprServiceBindMetadata metadata; + + /** + * Creates an instance of DaprComponentServiceBinding class. + */ + public DaprComponentServiceBinding() { + } + + /** + * Get the name property: Name of the service bind. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the service bind. + * + * @param name the name value to set. + * @return the DaprComponentServiceBinding object itself. + */ + public DaprComponentServiceBinding withName(String name) { + this.name = name; + return this; + } + + /** + * Get the serviceId property: Resource id of the target service. + * + * @return the serviceId value. + */ + public String serviceId() { + return this.serviceId; + } + + /** + * Set the serviceId property: Resource id of the target service. + * + * @param serviceId the serviceId value to set. + * @return the DaprComponentServiceBinding object itself. + */ + public DaprComponentServiceBinding withServiceId(String serviceId) { + this.serviceId = serviceId; + return this; + } + + /** + * Get the metadata property: Service bind metadata. + * + * @return the metadata value. + */ + public DaprServiceBindMetadata metadata() { + return this.metadata; + } + + /** + * Set the metadata property: Service bind metadata. + * + * @param metadata the metadata value to set. + * @return the DaprComponentServiceBinding object itself. + */ + public DaprComponentServiceBinding withMetadata(DaprServiceBindMetadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metadata() != null) { + metadata().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("serviceId", this.serviceId); + jsonWriter.writeJsonField("metadata", this.metadata); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprComponentServiceBinding from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprComponentServiceBinding if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprComponentServiceBinding. + */ + public static DaprComponentServiceBinding fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprComponentServiceBinding deserializedDaprComponentServiceBinding = new DaprComponentServiceBinding(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDaprComponentServiceBinding.name = reader.getString(); + } else if ("serviceId".equals(fieldName)) { + deserializedDaprComponentServiceBinding.serviceId = reader.getString(); + } else if ("metadata".equals(fieldName)) { + deserializedDaprComponentServiceBinding.metadata = DaprServiceBindMetadata.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprComponentServiceBinding; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprServiceBindMetadata.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprServiceBindMetadata.java new file mode 100644 index 0000000000000..d273181362de8 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprServiceBindMetadata.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Dapr component metadata. + */ +@Fluent +public final class DaprServiceBindMetadata implements JsonSerializable { + /* + * Service bind metadata property name. + */ + private String name; + + /* + * Service bind metadata property value. + */ + private String value; + + /** + * Creates an instance of DaprServiceBindMetadata class. + */ + public DaprServiceBindMetadata() { + } + + /** + * Get the name property: Service bind metadata property name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Service bind metadata property name. + * + * @param name the name value to set. + * @return the DaprServiceBindMetadata object itself. + */ + public DaprServiceBindMetadata withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: Service bind metadata property value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Service bind metadata property value. + * + * @param value the value value to set. + * @return the DaprServiceBindMetadata object itself. + */ + public DaprServiceBindMetadata withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprServiceBindMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprServiceBindMetadata if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprServiceBindMetadata. + */ + public static DaprServiceBindMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprServiceBindMetadata deserializedDaprServiceBindMetadata = new DaprServiceBindMetadata(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDaprServiceBindMetadata.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedDaprServiceBindMetadata.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprServiceBindMetadata; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscription.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscription.java new file mode 100644 index 0000000000000..f5283e5b9ec8f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscription.java @@ -0,0 +1,392 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.DaprSubscriptionInner; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of DaprSubscription. + */ +public interface DaprSubscription { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the pubsubName property: Dapr PubSub component name. + * + * @return the pubsubName value. + */ + String pubsubName(); + + /** + * Gets the topic property: Topic name. + * + * @return the topic value. + */ + String topic(); + + /** + * Gets the deadLetterTopic property: Deadletter topic name. + * + * @return the deadLetterTopic value. + */ + String deadLetterTopic(); + + /** + * Gets the routes property: Subscription routes. + * + * @return the routes value. + */ + DaprSubscriptionRoutes routes(); + + /** + * Gets the scopes property: Application scopes to restrict the subscription to specific apps. + * + * @return the scopes value. + */ + List scopes(); + + /** + * Gets the metadata property: Subscription metadata. + * + * @return the metadata value. + */ + Map metadata(); + + /** + * Gets the bulkSubscribe property: Bulk subscription options. + * + * @return the bulkSubscribe value. + */ + DaprSubscriptionBulkSubscribeOptions bulkSubscribe(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.DaprSubscriptionInner object. + * + * @return the inner object. + */ + DaprSubscriptionInner innerModel(); + + /** + * The entirety of the DaprSubscription definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The DaprSubscription definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the DaprSubscription definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the DaprSubscription definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, environmentName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @return the next definition stage. + */ + WithCreate withExistingManagedEnvironment(String resourceGroupName, String environmentName); + } + + /** + * The stage of the DaprSubscription definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithPubsubName, DefinitionStages.WithTopic, + DefinitionStages.WithDeadLetterTopic, DefinitionStages.WithRoutes, DefinitionStages.WithScopes, + DefinitionStages.WithMetadata, DefinitionStages.WithBulkSubscribe { + /** + * Executes the create request. + * + * @return the created resource. + */ + DaprSubscription create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DaprSubscription create(Context context); + } + + /** + * The stage of the DaprSubscription definition allowing to specify pubsubName. + */ + interface WithPubsubName { + /** + * Specifies the pubsubName property: Dapr PubSub component name. + * + * @param pubsubName Dapr PubSub component name. + * @return the next definition stage. + */ + WithCreate withPubsubName(String pubsubName); + } + + /** + * The stage of the DaprSubscription definition allowing to specify topic. + */ + interface WithTopic { + /** + * Specifies the topic property: Topic name. + * + * @param topic Topic name. + * @return the next definition stage. + */ + WithCreate withTopic(String topic); + } + + /** + * The stage of the DaprSubscription definition allowing to specify deadLetterTopic. + */ + interface WithDeadLetterTopic { + /** + * Specifies the deadLetterTopic property: Deadletter topic name. + * + * @param deadLetterTopic Deadletter topic name. + * @return the next definition stage. + */ + WithCreate withDeadLetterTopic(String deadLetterTopic); + } + + /** + * The stage of the DaprSubscription definition allowing to specify routes. + */ + interface WithRoutes { + /** + * Specifies the routes property: Subscription routes. + * + * @param routes Subscription routes. + * @return the next definition stage. + */ + WithCreate withRoutes(DaprSubscriptionRoutes routes); + } + + /** + * The stage of the DaprSubscription definition allowing to specify scopes. + */ + interface WithScopes { + /** + * Specifies the scopes property: Application scopes to restrict the subscription to specific apps.. + * + * @param scopes Application scopes to restrict the subscription to specific apps. + * @return the next definition stage. + */ + WithCreate withScopes(List scopes); + } + + /** + * The stage of the DaprSubscription definition allowing to specify metadata. + */ + interface WithMetadata { + /** + * Specifies the metadata property: Subscription metadata. + * + * @param metadata Subscription metadata. + * @return the next definition stage. + */ + WithCreate withMetadata(Map metadata); + } + + /** + * The stage of the DaprSubscription definition allowing to specify bulkSubscribe. + */ + interface WithBulkSubscribe { + /** + * Specifies the bulkSubscribe property: Bulk subscription options. + * + * @param bulkSubscribe Bulk subscription options. + * @return the next definition stage. + */ + WithCreate withBulkSubscribe(DaprSubscriptionBulkSubscribeOptions bulkSubscribe); + } + } + + /** + * Begins update for the DaprSubscription resource. + * + * @return the stage of resource update. + */ + DaprSubscription.Update update(); + + /** + * The template for DaprSubscription update. + */ + interface Update extends UpdateStages.WithPubsubName, UpdateStages.WithTopic, UpdateStages.WithDeadLetterTopic, + UpdateStages.WithRoutes, UpdateStages.WithScopes, UpdateStages.WithMetadata, UpdateStages.WithBulkSubscribe { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DaprSubscription apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DaprSubscription apply(Context context); + } + + /** + * The DaprSubscription update stages. + */ + interface UpdateStages { + /** + * The stage of the DaprSubscription update allowing to specify pubsubName. + */ + interface WithPubsubName { + /** + * Specifies the pubsubName property: Dapr PubSub component name. + * + * @param pubsubName Dapr PubSub component name. + * @return the next definition stage. + */ + Update withPubsubName(String pubsubName); + } + + /** + * The stage of the DaprSubscription update allowing to specify topic. + */ + interface WithTopic { + /** + * Specifies the topic property: Topic name. + * + * @param topic Topic name. + * @return the next definition stage. + */ + Update withTopic(String topic); + } + + /** + * The stage of the DaprSubscription update allowing to specify deadLetterTopic. + */ + interface WithDeadLetterTopic { + /** + * Specifies the deadLetterTopic property: Deadletter topic name. + * + * @param deadLetterTopic Deadletter topic name. + * @return the next definition stage. + */ + Update withDeadLetterTopic(String deadLetterTopic); + } + + /** + * The stage of the DaprSubscription update allowing to specify routes. + */ + interface WithRoutes { + /** + * Specifies the routes property: Subscription routes. + * + * @param routes Subscription routes. + * @return the next definition stage. + */ + Update withRoutes(DaprSubscriptionRoutes routes); + } + + /** + * The stage of the DaprSubscription update allowing to specify scopes. + */ + interface WithScopes { + /** + * Specifies the scopes property: Application scopes to restrict the subscription to specific apps.. + * + * @param scopes Application scopes to restrict the subscription to specific apps. + * @return the next definition stage. + */ + Update withScopes(List scopes); + } + + /** + * The stage of the DaprSubscription update allowing to specify metadata. + */ + interface WithMetadata { + /** + * Specifies the metadata property: Subscription metadata. + * + * @param metadata Subscription metadata. + * @return the next definition stage. + */ + Update withMetadata(Map metadata); + } + + /** + * The stage of the DaprSubscription update allowing to specify bulkSubscribe. + */ + interface WithBulkSubscribe { + /** + * Specifies the bulkSubscribe property: Bulk subscription options. + * + * @param bulkSubscribe Bulk subscription options. + * @return the next definition stage. + */ + Update withBulkSubscribe(DaprSubscriptionBulkSubscribeOptions bulkSubscribe); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DaprSubscription refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DaprSubscription refresh(Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionBulkSubscribeOptions.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionBulkSubscribeOptions.java new file mode 100644 index 0000000000000..2359c554ab54c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionBulkSubscribeOptions.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Dapr PubSub Bulk Subscription Options. + */ +@Fluent +public final class DaprSubscriptionBulkSubscribeOptions + implements JsonSerializable { + /* + * Enable bulk subscription + */ + private Boolean enabled; + + /* + * Maximum number of messages to deliver in a bulk message. + */ + private Integer maxMessagesCount; + + /* + * Maximum duration in milliseconds to wait before a bulk message is sent to the app. + */ + private Integer maxAwaitDurationMs; + + /** + * Creates an instance of DaprSubscriptionBulkSubscribeOptions class. + */ + public DaprSubscriptionBulkSubscribeOptions() { + } + + /** + * Get the enabled property: Enable bulk subscription. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Enable bulk subscription. + * + * @param enabled the enabled value to set. + * @return the DaprSubscriptionBulkSubscribeOptions object itself. + */ + public DaprSubscriptionBulkSubscribeOptions withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the maxMessagesCount property: Maximum number of messages to deliver in a bulk message. + * + * @return the maxMessagesCount value. + */ + public Integer maxMessagesCount() { + return this.maxMessagesCount; + } + + /** + * Set the maxMessagesCount property: Maximum number of messages to deliver in a bulk message. + * + * @param maxMessagesCount the maxMessagesCount value to set. + * @return the DaprSubscriptionBulkSubscribeOptions object itself. + */ + public DaprSubscriptionBulkSubscribeOptions withMaxMessagesCount(Integer maxMessagesCount) { + this.maxMessagesCount = maxMessagesCount; + return this; + } + + /** + * Get the maxAwaitDurationMs property: Maximum duration in milliseconds to wait before a bulk message is sent to + * the app. + * + * @return the maxAwaitDurationMs value. + */ + public Integer maxAwaitDurationMs() { + return this.maxAwaitDurationMs; + } + + /** + * Set the maxAwaitDurationMs property: Maximum duration in milliseconds to wait before a bulk message is sent to + * the app. + * + * @param maxAwaitDurationMs the maxAwaitDurationMs value to set. + * @return the DaprSubscriptionBulkSubscribeOptions object itself. + */ + public DaprSubscriptionBulkSubscribeOptions withMaxAwaitDurationMs(Integer maxAwaitDurationMs) { + this.maxAwaitDurationMs = maxAwaitDurationMs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeNumberField("maxMessagesCount", this.maxMessagesCount); + jsonWriter.writeNumberField("maxAwaitDurationMs", this.maxAwaitDurationMs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprSubscriptionBulkSubscribeOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprSubscriptionBulkSubscribeOptions if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprSubscriptionBulkSubscribeOptions. + */ + public static DaprSubscriptionBulkSubscribeOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprSubscriptionBulkSubscribeOptions deserializedDaprSubscriptionBulkSubscribeOptions + = new DaprSubscriptionBulkSubscribeOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedDaprSubscriptionBulkSubscribeOptions.enabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("maxMessagesCount".equals(fieldName)) { + deserializedDaprSubscriptionBulkSubscribeOptions.maxMessagesCount + = reader.getNullable(JsonReader::getInt); + } else if ("maxAwaitDurationMs".equals(fieldName)) { + deserializedDaprSubscriptionBulkSubscribeOptions.maxAwaitDurationMs + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprSubscriptionBulkSubscribeOptions; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionRouteRule.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionRouteRule.java new file mode 100644 index 0000000000000..6b18d09b436fe --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionRouteRule.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Dapr Pubsub Event Subscription Route Rule is used to specify the condition for sending a message to a specific path. + */ +@Fluent +public final class DaprSubscriptionRouteRule implements JsonSerializable { + /* + * The optional CEL expression used to match the event. If the match is not specified, then the route is considered + * the default. The rules are tested in the order specified, so they should be define from most-to-least specific. + * The default route should appear last in the list. + */ + private String match; + + /* + * The path for events that match this rule + */ + private String path; + + /** + * Creates an instance of DaprSubscriptionRouteRule class. + */ + public DaprSubscriptionRouteRule() { + } + + /** + * Get the match property: The optional CEL expression used to match the event. If the match is not specified, then + * the route is considered the default. The rules are tested in the order specified, so they should be define from + * most-to-least specific. The default route should appear last in the list. + * + * @return the match value. + */ + public String match() { + return this.match; + } + + /** + * Set the match property: The optional CEL expression used to match the event. If the match is not specified, then + * the route is considered the default. The rules are tested in the order specified, so they should be define from + * most-to-least specific. The default route should appear last in the list. + * + * @param match the match value to set. + * @return the DaprSubscriptionRouteRule object itself. + */ + public DaprSubscriptionRouteRule withMatch(String match) { + this.match = match; + return this; + } + + /** + * Get the path property: The path for events that match this rule. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The path for events that match this rule. + * + * @param path the path value to set. + * @return the DaprSubscriptionRouteRule object itself. + */ + public DaprSubscriptionRouteRule withPath(String path) { + this.path = path; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("match", this.match); + jsonWriter.writeStringField("path", this.path); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprSubscriptionRouteRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprSubscriptionRouteRule if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprSubscriptionRouteRule. + */ + public static DaprSubscriptionRouteRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprSubscriptionRouteRule deserializedDaprSubscriptionRouteRule = new DaprSubscriptionRouteRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("match".equals(fieldName)) { + deserializedDaprSubscriptionRouteRule.match = reader.getString(); + } else if ("path".equals(fieldName)) { + deserializedDaprSubscriptionRouteRule.path = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprSubscriptionRouteRule; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionRoutes.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionRoutes.java new file mode 100644 index 0000000000000..8e8e43b7e9f86 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionRoutes.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Dapr PubSub Event Subscription Routes configuration. + */ +@Fluent +public final class DaprSubscriptionRoutes implements JsonSerializable { + /* + * The list of Dapr PubSub Event Subscription Route Rules. + */ + private List rules; + + /* + * The default path to deliver events that do not match any of the rules. + */ + private String defaultProperty; + + /** + * Creates an instance of DaprSubscriptionRoutes class. + */ + public DaprSubscriptionRoutes() { + } + + /** + * Get the rules property: The list of Dapr PubSub Event Subscription Route Rules. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: The list of Dapr PubSub Event Subscription Route Rules. + * + * @param rules the rules value to set. + * @return the DaprSubscriptionRoutes object itself. + */ + public DaprSubscriptionRoutes withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get the defaultProperty property: The default path to deliver events that do not match any of the rules. + * + * @return the defaultProperty value. + */ + public String defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the defaultProperty property: The default path to deliver events that do not match any of the rules. + * + * @param defaultProperty the defaultProperty value to set. + * @return the DaprSubscriptionRoutes object itself. + */ + public DaprSubscriptionRoutes withDefaultProperty(String defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("default", this.defaultProperty); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprSubscriptionRoutes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprSubscriptionRoutes if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaprSubscriptionRoutes. + */ + public static DaprSubscriptionRoutes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprSubscriptionRoutes deserializedDaprSubscriptionRoutes = new DaprSubscriptionRoutes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rules".equals(fieldName)) { + List rules + = reader.readArray(reader1 -> DaprSubscriptionRouteRule.fromJson(reader1)); + deserializedDaprSubscriptionRoutes.rules = rules; + } else if ("default".equals(fieldName)) { + deserializedDaprSubscriptionRoutes.defaultProperty = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprSubscriptionRoutes; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptions.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptions.java new file mode 100644 index 0000000000000..a7cc8cc87f40c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptions.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of DaprSubscriptions. + */ +public interface DaprSubscriptions { + /** + * Get the Dapr subscriptions for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Dapr subscriptions for a managed environment as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName); + + /** + * Get the Dapr subscriptions for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Dapr subscriptions for a managed environment as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName, Context context); + + /** + * Get a dapr subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a dapr subscription along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String environmentName, String name, + Context context); + + /** + * Get a dapr subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a dapr subscription. + */ + DaprSubscription get(String resourceGroupName, String environmentName, String name); + + /** + * Delete a Dapr subscription. + * + * Delete a Dapr subscription from a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String environmentName, String name, Context context); + + /** + * Delete a Dapr subscription. + * + * Delete a Dapr subscription from a Managed Environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String environmentName, String name); + + /** + * Get a dapr subscription. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a dapr subscription along with {@link Response}. + */ + DaprSubscription getById(String id); + + /** + * Get a dapr subscription. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a dapr subscription along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Dapr subscription. + * + * Delete a Dapr subscription from a Managed Environment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Dapr subscription. + * + * Delete a Dapr subscription from a Managed Environment. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DaprSubscription resource. + * + * @param name resource name. + * @return the first stage of the new DaprSubscription definition. + */ + DaprSubscription.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionsCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionsCollection.java new file mode 100644 index 0000000000000..5149087ecbb8c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSubscriptionsCollection.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.fluent.models.DaprSubscriptionInner; +import java.io.IOException; +import java.util.List; + +/** + * Dapr Subscriptions ARM resource. + */ +@Fluent +public final class DaprSubscriptionsCollection implements JsonSerializable { + /* + * Collection of resources. + */ + private List value; + + /* + * Link to next page of resources. + */ + private String nextLink; + + /** + * Creates an instance of DaprSubscriptionsCollection class. + */ + public DaprSubscriptionsCollection() { + } + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the DaprSubscriptionsCollection object itself. + */ + public DaprSubscriptionsCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model DaprSubscriptionsCollection")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DaprSubscriptionsCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaprSubscriptionsCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaprSubscriptionsCollection if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DaprSubscriptionsCollection. + */ + public static DaprSubscriptionsCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaprSubscriptionsCollection deserializedDaprSubscriptionsCollection = new DaprSubscriptionsCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DaprSubscriptionInner.fromJson(reader1)); + deserializedDaprSubscriptionsCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDaprSubscriptionsCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDaprSubscriptionsCollection; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DataDogConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DataDogConfiguration.java new file mode 100644 index 0000000000000..169088edbdcd4 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DataDogConfiguration.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration of datadog. + */ +@Fluent +public final class DataDogConfiguration implements JsonSerializable { + /* + * The data dog site + */ + private String site; + + /* + * The data dog api key + */ + private String key; + + /** + * Creates an instance of DataDogConfiguration class. + */ + public DataDogConfiguration() { + } + + /** + * Get the site property: The data dog site. + * + * @return the site value. + */ + public String site() { + return this.site; + } + + /** + * Set the site property: The data dog site. + * + * @param site the site value to set. + * @return the DataDogConfiguration object itself. + */ + public DataDogConfiguration withSite(String site) { + this.site = site; + return this; + } + + /** + * Get the key property: The data dog api key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The data dog api key. + * + * @param key the key value to set. + * @return the DataDogConfiguration object itself. + */ + public DataDogConfiguration withKey(String key) { + this.key = key; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("site", this.site); + jsonWriter.writeStringField("key", this.key); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataDogConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataDogConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataDogConfiguration. + */ + public static DataDogConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataDogConfiguration deserializedDataDogConfiguration = new DataDogConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("site".equals(fieldName)) { + deserializedDataDogConfiguration.site = reader.getString(); + } else if ("key".equals(fieldName)) { + deserializedDataDogConfiguration.key = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataDogConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DefaultErrorResponseError.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DefaultErrorResponseError.java index c8a8e0a1b1121..303949482e6be 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DefaultErrorResponseError.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DefaultErrorResponseError.java @@ -24,14 +24,14 @@ public final class DefaultErrorResponseError extends ManagementError { private String innererror; /* - * The error code parsed from the body of the http error response. + * Additional info for the error. */ - private String code; + private List additionalInfo; /* - * The error message parsed from the body of the http error response. + * Details for the error. */ - private String message; + private List details; /* * The target of the error. @@ -39,14 +39,14 @@ public final class DefaultErrorResponseError extends ManagementError { private String target; /* - * Details for the error. + * The error message parsed from the body of the http error response. */ - private List details; + private String message; /* - * Additional info for the error. + * The error code parsed from the body of the http error response. */ - private List additionalInfo; + private String code; /** * Creates an instance of DefaultErrorResponseError class. @@ -64,23 +64,23 @@ public String getInnererror() { } /** - * Get the code property: The error code parsed from the body of the http error response. + * Get the additionalInfo property: Additional info for the error. * - * @return the code value. + * @return the additionalInfo value. */ @Override - public String getCode() { - return this.code; + public List getAdditionalInfo() { + return this.additionalInfo; } /** - * Get the message property: The error message parsed from the body of the http error response. + * Get the details property: Details for the error. * - * @return the message value. + * @return the details value. */ @Override - public String getMessage() { - return this.message; + public List getDetails() { + return this.details; } /** @@ -94,23 +94,23 @@ public String getTarget() { } /** - * Get the details property: Details for the error. + * Get the message property: The error message parsed from the body of the http error response. * - * @return the details value. + * @return the message value. */ @Override - public List getDetails() { - return this.details; + public String getMessage() { + return this.message; } /** - * Get the additionalInfo property: Additional info for the error. + * Get the code property: The error code parsed from the body of the http error response. * - * @return the additionalInfo value. + * @return the code value. */ @Override - public List getAdditionalInfo() { - return this.additionalInfo; + public String getCode() { + return this.code; } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DestinationsConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DestinationsConfiguration.java new file mode 100644 index 0000000000000..d79de70647caf --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DestinationsConfiguration.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Configuration of Open Telemetry destinations. + */ +@Fluent +public final class DestinationsConfiguration implements JsonSerializable { + /* + * Open telemetry datadog destination configuration + */ + private DataDogConfiguration dataDogConfiguration; + + /* + * Open telemetry otlp configurations + */ + private List otlpConfigurations; + + /** + * Creates an instance of DestinationsConfiguration class. + */ + public DestinationsConfiguration() { + } + + /** + * Get the dataDogConfiguration property: Open telemetry datadog destination configuration. + * + * @return the dataDogConfiguration value. + */ + public DataDogConfiguration dataDogConfiguration() { + return this.dataDogConfiguration; + } + + /** + * Set the dataDogConfiguration property: Open telemetry datadog destination configuration. + * + * @param dataDogConfiguration the dataDogConfiguration value to set. + * @return the DestinationsConfiguration object itself. + */ + public DestinationsConfiguration withDataDogConfiguration(DataDogConfiguration dataDogConfiguration) { + this.dataDogConfiguration = dataDogConfiguration; + return this; + } + + /** + * Get the otlpConfigurations property: Open telemetry otlp configurations. + * + * @return the otlpConfigurations value. + */ + public List otlpConfigurations() { + return this.otlpConfigurations; + } + + /** + * Set the otlpConfigurations property: Open telemetry otlp configurations. + * + * @param otlpConfigurations the otlpConfigurations value to set. + * @return the DestinationsConfiguration object itself. + */ + public DestinationsConfiguration withOtlpConfigurations(List otlpConfigurations) { + this.otlpConfigurations = otlpConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataDogConfiguration() != null) { + dataDogConfiguration().validate(); + } + if (otlpConfigurations() != null) { + otlpConfigurations().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("dataDogConfiguration", this.dataDogConfiguration); + jsonWriter.writeArrayField("otlpConfigurations", this.otlpConfigurations, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DestinationsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DestinationsConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DestinationsConfiguration. + */ + public static DestinationsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DestinationsConfiguration deserializedDestinationsConfiguration = new DestinationsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataDogConfiguration".equals(fieldName)) { + deserializedDestinationsConfiguration.dataDogConfiguration = DataDogConfiguration.fromJson(reader); + } else if ("otlpConfigurations".equals(fieldName)) { + List otlpConfigurations + = reader.readArray(reader1 -> OtlpConfiguration.fromJson(reader1)); + deserializedDestinationsConfiguration.otlpConfigurations = otlpConfigurations; + } else { + reader.skipChildren(); + } + } + + return deserializedDestinationsConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DetectionStatus.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DetectionStatus.java new file mode 100644 index 0000000000000..8b203aaede5d3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DetectionStatus.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of the patch detection. + */ +public final class DetectionStatus extends ExpandableStringEnum { + /** + * Static value Succeeded for DetectionStatus. + */ + public static final DetectionStatus SUCCEEDED = fromString("Succeeded"); + + /** + * Static value RegistryLoginFailed for DetectionStatus. + */ + public static final DetectionStatus REGISTRY_LOGIN_FAILED = fromString("RegistryLoginFailed"); + + /** + * Static value Failed for DetectionStatus. + */ + public static final DetectionStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of DetectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DetectionStatus() { + } + + /** + * Creates or finds a DetectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding DetectionStatus. + */ + public static DetectionStatus fromString(String name) { + return fromString(name, DetectionStatus.class); + } + + /** + * Gets known DetectionStatus values. + * + * @return known DetectionStatus values. + */ + public static Collection values() { + return values(DetectionStatus.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponent.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponent.java new file mode 100644 index 0000000000000..6b1f7daa57720 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponent.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.DotNetComponentInner; +import java.util.List; + +/** + * An immutable client-side representation of DotNetComponent. + */ +public interface DotNetComponent { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the componentType property: Type of the .NET Component. + * + * @return the componentType value. + */ + DotNetComponentType componentType(); + + /** + * Gets the provisioningState property: Provisioning state of the .NET Component. + * + * @return the provisioningState value. + */ + DotNetComponentProvisioningState provisioningState(); + + /** + * Gets the configurations property: List of .NET Components configuration properties. + * + * @return the configurations value. + */ + List configurations(); + + /** + * Gets the serviceBinds property: List of .NET Components that are bound to the .NET component. + * + * @return the serviceBinds value. + */ + List serviceBinds(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.DotNetComponentInner object. + * + * @return the inner object. + */ + DotNetComponentInner innerModel(); + + /** + * The entirety of the DotNetComponent definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The DotNetComponent definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the DotNetComponent definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the DotNetComponent definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, environmentName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @return the next definition stage. + */ + WithCreate withExistingManagedEnvironment(String resourceGroupName, String environmentName); + } + + /** + * The stage of the DotNetComponent definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithComponentType, DefinitionStages.WithConfigurations, + DefinitionStages.WithServiceBinds { + /** + * Executes the create request. + * + * @return the created resource. + */ + DotNetComponent create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DotNetComponent create(Context context); + } + + /** + * The stage of the DotNetComponent definition allowing to specify componentType. + */ + interface WithComponentType { + /** + * Specifies the componentType property: Type of the .NET Component.. + * + * @param componentType Type of the .NET Component. + * @return the next definition stage. + */ + WithCreate withComponentType(DotNetComponentType componentType); + } + + /** + * The stage of the DotNetComponent definition allowing to specify configurations. + */ + interface WithConfigurations { + /** + * Specifies the configurations property: List of .NET Components configuration properties. + * + * @param configurations List of .NET Components configuration properties. + * @return the next definition stage. + */ + WithCreate withConfigurations(List configurations); + } + + /** + * The stage of the DotNetComponent definition allowing to specify serviceBinds. + */ + interface WithServiceBinds { + /** + * Specifies the serviceBinds property: List of .NET Components that are bound to the .NET component. + * + * @param serviceBinds List of .NET Components that are bound to the .NET component. + * @return the next definition stage. + */ + WithCreate withServiceBinds(List serviceBinds); + } + } + + /** + * Begins update for the DotNetComponent resource. + * + * @return the stage of resource update. + */ + DotNetComponent.Update update(); + + /** + * The template for DotNetComponent update. + */ + interface Update + extends UpdateStages.WithComponentType, UpdateStages.WithConfigurations, UpdateStages.WithServiceBinds { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DotNetComponent apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DotNetComponent apply(Context context); + } + + /** + * The DotNetComponent update stages. + */ + interface UpdateStages { + /** + * The stage of the DotNetComponent update allowing to specify componentType. + */ + interface WithComponentType { + /** + * Specifies the componentType property: Type of the .NET Component.. + * + * @param componentType Type of the .NET Component. + * @return the next definition stage. + */ + Update withComponentType(DotNetComponentType componentType); + } + + /** + * The stage of the DotNetComponent update allowing to specify configurations. + */ + interface WithConfigurations { + /** + * Specifies the configurations property: List of .NET Components configuration properties. + * + * @param configurations List of .NET Components configuration properties. + * @return the next definition stage. + */ + Update withConfigurations(List configurations); + } + + /** + * The stage of the DotNetComponent update allowing to specify serviceBinds. + */ + interface WithServiceBinds { + /** + * Specifies the serviceBinds property: List of .NET Components that are bound to the .NET component. + * + * @param serviceBinds List of .NET Components that are bound to the .NET component. + * @return the next definition stage. + */ + Update withServiceBinds(List serviceBinds); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DotNetComponent refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DotNetComponent refresh(Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentConfigurationProperty.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentConfigurationProperty.java new file mode 100644 index 0000000000000..467ae1e04d6ac --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentConfigurationProperty.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration properties for a .NET Component. + */ +@Fluent +public final class DotNetComponentConfigurationProperty + implements JsonSerializable { + /* + * The name of the property + */ + private String propertyName; + + /* + * The value of the property + */ + private String value; + + /** + * Creates an instance of DotNetComponentConfigurationProperty class. + */ + public DotNetComponentConfigurationProperty() { + } + + /** + * Get the propertyName property: The name of the property. + * + * @return the propertyName value. + */ + public String propertyName() { + return this.propertyName; + } + + /** + * Set the propertyName property: The name of the property. + * + * @param propertyName the propertyName value to set. + * @return the DotNetComponentConfigurationProperty object itself. + */ + public DotNetComponentConfigurationProperty withPropertyName(String propertyName) { + this.propertyName = propertyName; + return this; + } + + /** + * Get the value property: The value of the property. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the property. + * + * @param value the value value to set. + * @return the DotNetComponentConfigurationProperty object itself. + */ + public DotNetComponentConfigurationProperty withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("propertyName", this.propertyName); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DotNetComponentConfigurationProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DotNetComponentConfigurationProperty if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DotNetComponentConfigurationProperty. + */ + public static DotNetComponentConfigurationProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DotNetComponentConfigurationProperty deserializedDotNetComponentConfigurationProperty + = new DotNetComponentConfigurationProperty(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("propertyName".equals(fieldName)) { + deserializedDotNetComponentConfigurationProperty.propertyName = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedDotNetComponentConfigurationProperty.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDotNetComponentConfigurationProperty; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentProvisioningState.java new file mode 100644 index 0000000000000..e192894c00c1a --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentProvisioningState.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of the .NET Component. + */ +public final class DotNetComponentProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for DotNetComponentProvisioningState. + */ + public static final DotNetComponentProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for DotNetComponentProvisioningState. + */ + public static final DotNetComponentProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for DotNetComponentProvisioningState. + */ + public static final DotNetComponentProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Deleting for DotNetComponentProvisioningState. + */ + public static final DotNetComponentProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value InProgress for DotNetComponentProvisioningState. + */ + public static final DotNetComponentProvisioningState IN_PROGRESS = fromString("InProgress"); + + /** + * Creates a new instance of DotNetComponentProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DotNetComponentProvisioningState() { + } + + /** + * Creates or finds a DotNetComponentProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DotNetComponentProvisioningState. + */ + public static DotNetComponentProvisioningState fromString(String name) { + return fromString(name, DotNetComponentProvisioningState.class); + } + + /** + * Gets known DotNetComponentProvisioningState values. + * + * @return known DotNetComponentProvisioningState values. + */ + public static Collection values() { + return values(DotNetComponentProvisioningState.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentServiceBind.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentServiceBind.java new file mode 100644 index 0000000000000..0f9a7ff68effb --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentServiceBind.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration to bind a .NET Component to another .NET Component. + */ +@Fluent +public final class DotNetComponentServiceBind implements JsonSerializable { + /* + * Name of the service bind + */ + private String name; + + /* + * Resource id of the target service + */ + private String serviceId; + + /** + * Creates an instance of DotNetComponentServiceBind class. + */ + public DotNetComponentServiceBind() { + } + + /** + * Get the name property: Name of the service bind. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the service bind. + * + * @param name the name value to set. + * @return the DotNetComponentServiceBind object itself. + */ + public DotNetComponentServiceBind withName(String name) { + this.name = name; + return this; + } + + /** + * Get the serviceId property: Resource id of the target service. + * + * @return the serviceId value. + */ + public String serviceId() { + return this.serviceId; + } + + /** + * Set the serviceId property: Resource id of the target service. + * + * @param serviceId the serviceId value to set. + * @return the DotNetComponentServiceBind object itself. + */ + public DotNetComponentServiceBind withServiceId(String serviceId) { + this.serviceId = serviceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("serviceId", this.serviceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DotNetComponentServiceBind from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DotNetComponentServiceBind if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DotNetComponentServiceBind. + */ + public static DotNetComponentServiceBind fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DotNetComponentServiceBind deserializedDotNetComponentServiceBind = new DotNetComponentServiceBind(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDotNetComponentServiceBind.name = reader.getString(); + } else if ("serviceId".equals(fieldName)) { + deserializedDotNetComponentServiceBind.serviceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDotNetComponentServiceBind; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentType.java new file mode 100644 index 0000000000000..2a317ac4d3c33 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of the .NET Component. + */ +public final class DotNetComponentType extends ExpandableStringEnum { + /** + * Static value AspireDashboard for DotNetComponentType. + */ + public static final DotNetComponentType ASPIRE_DASHBOARD = fromString("AspireDashboard"); + + /** + * Creates a new instance of DotNetComponentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DotNetComponentType() { + } + + /** + * Creates or finds a DotNetComponentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DotNetComponentType. + */ + public static DotNetComponentType fromString(String name) { + return fromString(name, DotNetComponentType.class); + } + + /** + * Gets known DotNetComponentType values. + * + * @return known DotNetComponentType values. + */ + public static Collection values() { + return values(DotNetComponentType.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponents.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponents.java new file mode 100644 index 0000000000000..18177c70e5865 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponents.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of DotNetComponents. + */ +public interface DotNetComponents { + /** + * Get the .NET Components for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the .NET Components for a managed environment as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName); + + /** + * Get the .NET Components for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the .NET Components for a managed environment as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName, Context context); + + /** + * Get a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a .NET Component along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String environmentName, String name, + Context context); + + /** + * Get a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a .NET Component. + */ + DotNetComponent get(String resourceGroupName, String environmentName, String name); + + /** + * Delete a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String environmentName, String name); + + /** + * Delete a .NET Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the .NET Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String environmentName, String name, Context context); + + /** + * Get a .NET Component. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a .NET Component along with {@link Response}. + */ + DotNetComponent getById(String id); + + /** + * Get a .NET Component. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a .NET Component along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a .NET Component. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a .NET Component. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DotNetComponent resource. + * + * @param name resource name. + * @return the first stage of the new DotNetComponent definition. + */ + DotNetComponent.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentsCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentsCollection.java new file mode 100644 index 0000000000000..15ad8913eeff4 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentsCollection.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.fluent.models.DotNetComponentInner; +import java.io.IOException; +import java.util.List; + +/** + * .NET Components ARM resource. + */ +@Fluent +public final class DotNetComponentsCollection implements JsonSerializable { + /* + * Collection of resources. + */ + private List value; + + /* + * Link to next page of resources. + */ + private String nextLink; + + /** + * Creates an instance of DotNetComponentsCollection class. + */ + public DotNetComponentsCollection() { + } + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the DotNetComponentsCollection object itself. + */ + public DotNetComponentsCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model DotNetComponentsCollection")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DotNetComponentsCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DotNetComponentsCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DotNetComponentsCollection if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DotNetComponentsCollection. + */ + public static DotNetComponentsCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DotNetComponentsCollection deserializedDotNetComponentsCollection = new DotNetComponentsCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DotNetComponentInner.fromJson(reader1)); + deserializedDotNetComponentsCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDotNetComponentsCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDotNetComponentsCollection; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DynamicPoolConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DynamicPoolConfiguration.java new file mode 100644 index 0000000000000..2aa2b808a7764 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DynamicPoolConfiguration.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Dynamic pool configuration. + */ +@Fluent +public final class DynamicPoolConfiguration implements JsonSerializable { + /* + * The execution type of the session pool. + */ + private ExecutionType executionType; + + /* + * The cooldown period of a session in seconds. + */ + private Integer cooldownPeriodInSeconds; + + /** + * Creates an instance of DynamicPoolConfiguration class. + */ + public DynamicPoolConfiguration() { + } + + /** + * Get the executionType property: The execution type of the session pool. + * + * @return the executionType value. + */ + public ExecutionType executionType() { + return this.executionType; + } + + /** + * Set the executionType property: The execution type of the session pool. + * + * @param executionType the executionType value to set. + * @return the DynamicPoolConfiguration object itself. + */ + public DynamicPoolConfiguration withExecutionType(ExecutionType executionType) { + this.executionType = executionType; + return this; + } + + /** + * Get the cooldownPeriodInSeconds property: The cooldown period of a session in seconds. + * + * @return the cooldownPeriodInSeconds value. + */ + public Integer cooldownPeriodInSeconds() { + return this.cooldownPeriodInSeconds; + } + + /** + * Set the cooldownPeriodInSeconds property: The cooldown period of a session in seconds. + * + * @param cooldownPeriodInSeconds the cooldownPeriodInSeconds value to set. + * @return the DynamicPoolConfiguration object itself. + */ + public DynamicPoolConfiguration withCooldownPeriodInSeconds(Integer cooldownPeriodInSeconds) { + this.cooldownPeriodInSeconds = cooldownPeriodInSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("executionType", this.executionType == null ? null : this.executionType.toString()); + jsonWriter.writeNumberField("cooldownPeriodInSeconds", this.cooldownPeriodInSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DynamicPoolConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DynamicPoolConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DynamicPoolConfiguration. + */ + public static DynamicPoolConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DynamicPoolConfiguration deserializedDynamicPoolConfiguration = new DynamicPoolConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("executionType".equals(fieldName)) { + deserializedDynamicPoolConfiguration.executionType = ExecutionType.fromString(reader.getString()); + } else if ("cooldownPeriodInSeconds".equals(fieldName)) { + deserializedDynamicPoolConfiguration.cooldownPeriodInSeconds + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedDynamicPoolConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentVariable.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentVariable.java new file mode 100644 index 0000000000000..c4701b917d054 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentVariable.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Model representing an environment variable. + */ +@Fluent +public final class EnvironmentVariable implements JsonSerializable { + /* + * Environment variable name. + */ + private String name; + + /* + * Environment variable value. + */ + private String value; + + /** + * Creates an instance of EnvironmentVariable class. + */ + public EnvironmentVariable() { + } + + /** + * Get the name property: Environment variable name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Environment variable name. + * + * @param name the name value to set. + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: Environment variable value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Environment variable value. + * + * @param value the value value to set. + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model EnvironmentVariable")); + } + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model EnvironmentVariable")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EnvironmentVariable.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnvironmentVariable from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnvironmentVariable if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EnvironmentVariable. + */ + public static EnvironmentVariable fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnvironmentVariable deserializedEnvironmentVariable = new EnvironmentVariable(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedEnvironmentVariable.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedEnvironmentVariable.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEnvironmentVariable; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ErrorEntity.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ErrorEntity.java new file mode 100644 index 0000000000000..cae94ab237ff8 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ErrorEntity.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Body of the error response returned from the API. + */ +@Fluent +public final class ErrorEntity implements JsonSerializable { + /* + * Type of error. + */ + private String extendedCode; + + /* + * Message template. + */ + private String messageTemplate; + + /* + * Parameters for the template. + */ + private List parameters; + + /* + * Inner errors. + */ + private List innerErrors; + + /* + * Error Details. + */ + private List details; + + /* + * The error target. + */ + private String target; + + /* + * Basic error code. + */ + private String code; + + /* + * Any details of the error. + */ + private String message; + + /** + * Creates an instance of ErrorEntity class. + */ + public ErrorEntity() { + } + + /** + * Get the extendedCode property: Type of error. + * + * @return the extendedCode value. + */ + public String extendedCode() { + return this.extendedCode; + } + + /** + * Set the extendedCode property: Type of error. + * + * @param extendedCode the extendedCode value to set. + * @return the ErrorEntity object itself. + */ + public ErrorEntity withExtendedCode(String extendedCode) { + this.extendedCode = extendedCode; + return this; + } + + /** + * Get the messageTemplate property: Message template. + * + * @return the messageTemplate value. + */ + public String messageTemplate() { + return this.messageTemplate; + } + + /** + * Set the messageTemplate property: Message template. + * + * @param messageTemplate the messageTemplate value to set. + * @return the ErrorEntity object itself. + */ + public ErrorEntity withMessageTemplate(String messageTemplate) { + this.messageTemplate = messageTemplate; + return this; + } + + /** + * Get the parameters property: Parameters for the template. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Parameters for the template. + * + * @param parameters the parameters value to set. + * @return the ErrorEntity object itself. + */ + public ErrorEntity withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the innerErrors property: Inner errors. + * + * @return the innerErrors value. + */ + public List innerErrors() { + return this.innerErrors; + } + + /** + * Set the innerErrors property: Inner errors. + * + * @param innerErrors the innerErrors value to set. + * @return the ErrorEntity object itself. + */ + public ErrorEntity withInnerErrors(List innerErrors) { + this.innerErrors = innerErrors; + return this; + } + + /** + * Get the details property: Error Details. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * Set the details property: Error Details. + * + * @param details the details value to set. + * @return the ErrorEntity object itself. + */ + public ErrorEntity withDetails(List details) { + this.details = details; + return this; + } + + /** + * Get the target property: The error target. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: The error target. + * + * @param target the target value to set. + * @return the ErrorEntity object itself. + */ + public ErrorEntity withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the code property: Basic error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: Basic error code. + * + * @param code the code value to set. + * @return the ErrorEntity object itself. + */ + public ErrorEntity withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: Any details of the error. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Any details of the error. + * + * @param message the message value to set. + * @return the ErrorEntity object itself. + */ + public ErrorEntity withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerErrors() != null) { + innerErrors().forEach(e -> e.validate()); + } + if (details() != null) { + details().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("extendedCode", this.extendedCode); + jsonWriter.writeStringField("messageTemplate", this.messageTemplate); + jsonWriter.writeArrayField("parameters", this.parameters, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("innerErrors", this.innerErrors, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("details", this.details, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("target", this.target); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ErrorEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ErrorEntity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ErrorEntity. + */ + public static ErrorEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ErrorEntity deserializedErrorEntity = new ErrorEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("extendedCode".equals(fieldName)) { + deserializedErrorEntity.extendedCode = reader.getString(); + } else if ("messageTemplate".equals(fieldName)) { + deserializedErrorEntity.messageTemplate = reader.getString(); + } else if ("parameters".equals(fieldName)) { + List parameters = reader.readArray(reader1 -> reader1.getString()); + deserializedErrorEntity.parameters = parameters; + } else if ("innerErrors".equals(fieldName)) { + List innerErrors = reader.readArray(reader1 -> ErrorEntity.fromJson(reader1)); + deserializedErrorEntity.innerErrors = innerErrors; + } else if ("details".equals(fieldName)) { + List details = reader.readArray(reader1 -> ErrorEntity.fromJson(reader1)); + deserializedErrorEntity.details = details; + } else if ("target".equals(fieldName)) { + deserializedErrorEntity.target = reader.getString(); + } else if ("code".equals(fieldName)) { + deserializedErrorEntity.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedErrorEntity.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedErrorEntity; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExecutionStatus.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExecutionStatus.java new file mode 100644 index 0000000000000..35e1d2d7c6397 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExecutionStatus.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Container Apps Job execution status. + */ +@Fluent +public final class ExecutionStatus implements JsonSerializable { + /* + * Replicas in the execution. + */ + private List replicas; + + /** + * Creates an instance of ExecutionStatus class. + */ + public ExecutionStatus() { + } + + /** + * Get the replicas property: Replicas in the execution. + * + * @return the replicas value. + */ + public List replicas() { + return this.replicas; + } + + /** + * Set the replicas property: Replicas in the execution. + * + * @param replicas the replicas value to set. + * @return the ExecutionStatus object itself. + */ + public ExecutionStatus withReplicas(List replicas) { + this.replicas = replicas; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (replicas() != null) { + replicas().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("replicas", this.replicas, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecutionStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecutionStatus if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ExecutionStatus. + */ + public static ExecutionStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecutionStatus deserializedExecutionStatus = new ExecutionStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("replicas".equals(fieldName)) { + List replicas + = reader.readArray(reader1 -> ReplicaExecutionStatus.fromJson(reader1)); + deserializedExecutionStatus.replicas = replicas; + } else { + reader.skipChildren(); + } + } + + return deserializedExecutionStatus; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExecutionType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExecutionType.java new file mode 100644 index 0000000000000..bfa282dff6a44 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExecutionType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The execution type of the session pool. + */ +public final class ExecutionType extends ExpandableStringEnum { + /** + * Static value Timed for ExecutionType. + */ + public static final ExecutionType TIMED = fromString("Timed"); + + /** + * Creates a new instance of ExecutionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExecutionType() { + } + + /** + * Creates or finds a ExecutionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExecutionType. + */ + public static ExecutionType fromString(String name) { + return fromString(name, ExecutionType.class); + } + + /** + * Gets known ExecutionType values. + * + * @return known ExecutionType values. + */ + public static Collection values() { + return values(ExecutionType.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/FunctionsExtensions.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/FunctionsExtensions.java new file mode 100644 index 0000000000000..3a5584b9d59a6 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/FunctionsExtensions.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of FunctionsExtensions. + */ +public interface FunctionsExtensions { + /** + * Proxies a Functions host call to the function app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision, the parent resource. + * @param functionAppName Name of the Function App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response invokeFunctionsHostWithResponse(String resourceGroupName, String containerAppName, + String revisionName, String functionAppName, Context context); + + /** + * Proxies a Functions host call to the function app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision, the parent resource. + * @param functionAppName Name of the Function App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + String invokeFunctionsHost(String resourceGroupName, String containerAppName, String revisionName, + String functionAppName); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GithubActionConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GithubActionConfiguration.java index 4d06f4ad64f2a..dc17112b6d6df 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GithubActionConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GithubActionConfiguration.java @@ -10,6 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.List; /** * Configuration properties that define the mutable settings of a Container App SourceControl. @@ -31,6 +32,11 @@ public final class GithubActionConfiguration implements JsonSerializable buildEnvironmentVariables; + /** * Creates an instance of GithubActionConfiguration class. */ @@ -127,6 +138,26 @@ public GithubActionConfiguration withContextPath(String contextPath) { return this; } + /** + * Get the dockerfilePath property: Dockerfile path. + * + * @return the dockerfilePath value. + */ + public String dockerfilePath() { + return this.dockerfilePath; + } + + /** + * Set the dockerfilePath property: Dockerfile path. + * + * @param dockerfilePath the dockerfilePath value to set. + * @return the GithubActionConfiguration object itself. + */ + public GithubActionConfiguration withDockerfilePath(String dockerfilePath) { + this.dockerfilePath = dockerfilePath; + return this; + } + /** * Get the githubPersonalAccessToken property: One time Github PAT to configure github environment. * @@ -247,6 +278,27 @@ public GithubActionConfiguration withRuntimeVersion(String runtimeVersion) { return this; } + /** + * Get the buildEnvironmentVariables property: List of environment variables to be passed to the build. + * + * @return the buildEnvironmentVariables value. + */ + public List buildEnvironmentVariables() { + return this.buildEnvironmentVariables; + } + + /** + * Set the buildEnvironmentVariables property: List of environment variables to be passed to the build. + * + * @param buildEnvironmentVariables the buildEnvironmentVariables value to set. + * @return the GithubActionConfiguration object itself. + */ + public GithubActionConfiguration + withBuildEnvironmentVariables(List buildEnvironmentVariables) { + this.buildEnvironmentVariables = buildEnvironmentVariables; + return this; + } + /** * Validates the instance. * @@ -259,6 +311,9 @@ public void validate() { if (azureCredentials() != null) { azureCredentials().validate(); } + if (buildEnvironmentVariables() != null) { + buildEnvironmentVariables().forEach(e -> e.validate()); + } } /** @@ -270,12 +325,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("registryInfo", this.registryInfo); jsonWriter.writeJsonField("azureCredentials", this.azureCredentials); jsonWriter.writeStringField("contextPath", this.contextPath); + jsonWriter.writeStringField("dockerfilePath", this.dockerfilePath); jsonWriter.writeStringField("githubPersonalAccessToken", this.githubPersonalAccessToken); jsonWriter.writeStringField("image", this.image); jsonWriter.writeStringField("publishType", this.publishType); jsonWriter.writeStringField("os", this.os); jsonWriter.writeStringField("runtimeStack", this.runtimeStack); jsonWriter.writeStringField("runtimeVersion", this.runtimeVersion); + jsonWriter.writeArrayField("buildEnvironmentVariables", this.buildEnvironmentVariables, + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -300,6 +358,8 @@ public static GithubActionConfiguration fromJson(JsonReader jsonReader) throws I deserializedGithubActionConfiguration.azureCredentials = AzureCredentials.fromJson(reader); } else if ("contextPath".equals(fieldName)) { deserializedGithubActionConfiguration.contextPath = reader.getString(); + } else if ("dockerfilePath".equals(fieldName)) { + deserializedGithubActionConfiguration.dockerfilePath = reader.getString(); } else if ("githubPersonalAccessToken".equals(fieldName)) { deserializedGithubActionConfiguration.githubPersonalAccessToken = reader.getString(); } else if ("image".equals(fieldName)) { @@ -312,6 +372,10 @@ public static GithubActionConfiguration fromJson(JsonReader jsonReader) throws I deserializedGithubActionConfiguration.runtimeStack = reader.getString(); } else if ("runtimeVersion".equals(fieldName)) { deserializedGithubActionConfiguration.runtimeVersion = reader.getString(); + } else if ("buildEnvironmentVariables".equals(fieldName)) { + List buildEnvironmentVariables + = reader.readArray(reader1 -> EnvironmentVariable.fromJson(reader1)); + deserializedGithubActionConfiguration.buildEnvironmentVariables = buildEnvironmentVariables; } else { reader.skipChildren(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Header.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Header.java new file mode 100644 index 0000000000000..daa4078204fdb --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Header.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Header of otlp configuration. + */ +@Fluent +public final class Header implements JsonSerializable
{ + /* + * The key of otlp configuration header + */ + private String key; + + /* + * The value of otlp configuration header + */ + private String value; + + /** + * Creates an instance of Header class. + */ + public Header() { + } + + /** + * Get the key property: The key of otlp configuration header. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key of otlp configuration header. + * + * @param key the key value to set. + * @return the Header object itself. + */ + public Header withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value of otlp configuration header. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of otlp configuration header. + * + * @param value the value value to set. + * @return the Header object itself. + */ + public Header withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Header from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Header if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Header. + */ + public static Header fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Header deserializedHeader = new Header(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedHeader.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedHeader.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHeader; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HeaderMatch.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HeaderMatch.java new file mode 100644 index 0000000000000..91f50b3a4234f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HeaderMatch.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.fluent.models.HeaderMatchMatch; +import java.io.IOException; + +/** + * Conditions required to match a header. + */ +@Fluent +public final class HeaderMatch implements JsonSerializable { + /* + * Name of the header + */ + private String headerProperty; + + /* + * Type of match to perform + */ + private HeaderMatchMatch innerMatch; + + /** + * Creates an instance of HeaderMatch class. + */ + public HeaderMatch() { + } + + /** + * Get the headerProperty property: Name of the header. + * + * @return the headerProperty value. + */ + public String headerProperty() { + return this.headerProperty; + } + + /** + * Set the headerProperty property: Name of the header. + * + * @param headerProperty the headerProperty value to set. + * @return the HeaderMatch object itself. + */ + public HeaderMatch withHeaderProperty(String headerProperty) { + this.headerProperty = headerProperty; + return this; + } + + /** + * Get the innerMatch property: Type of match to perform. + * + * @return the innerMatch value. + */ + private HeaderMatchMatch innerMatch() { + return this.innerMatch; + } + + /** + * Get the exactMatch property: Exact value of the header. + * + * @return the exactMatch value. + */ + public String exactMatch() { + return this.innerMatch() == null ? null : this.innerMatch().exactMatch(); + } + + /** + * Set the exactMatch property: Exact value of the header. + * + * @param exactMatch the exactMatch value to set. + * @return the HeaderMatch object itself. + */ + public HeaderMatch withExactMatch(String exactMatch) { + if (this.innerMatch() == null) { + this.innerMatch = new HeaderMatchMatch(); + } + this.innerMatch().withExactMatch(exactMatch); + return this; + } + + /** + * Get the prefixMatch property: Prefix value of the header. + * + * @return the prefixMatch value. + */ + public String prefixMatch() { + return this.innerMatch() == null ? null : this.innerMatch().prefixMatch(); + } + + /** + * Set the prefixMatch property: Prefix value of the header. + * + * @param prefixMatch the prefixMatch value to set. + * @return the HeaderMatch object itself. + */ + public HeaderMatch withPrefixMatch(String prefixMatch) { + if (this.innerMatch() == null) { + this.innerMatch = new HeaderMatchMatch(); + } + this.innerMatch().withPrefixMatch(prefixMatch); + return this; + } + + /** + * Get the suffixMatch property: Suffix value of the header. + * + * @return the suffixMatch value. + */ + public String suffixMatch() { + return this.innerMatch() == null ? null : this.innerMatch().suffixMatch(); + } + + /** + * Set the suffixMatch property: Suffix value of the header. + * + * @param suffixMatch the suffixMatch value to set. + * @return the HeaderMatch object itself. + */ + public HeaderMatch withSuffixMatch(String suffixMatch) { + if (this.innerMatch() == null) { + this.innerMatch = new HeaderMatchMatch(); + } + this.innerMatch().withSuffixMatch(suffixMatch); + return this; + } + + /** + * Get the regexMatch property: Regex value of the header. + * + * @return the regexMatch value. + */ + public String regexMatch() { + return this.innerMatch() == null ? null : this.innerMatch().regexMatch(); + } + + /** + * Set the regexMatch property: Regex value of the header. + * + * @param regexMatch the regexMatch value to set. + * @return the HeaderMatch object itself. + */ + public HeaderMatch withRegexMatch(String regexMatch) { + if (this.innerMatch() == null) { + this.innerMatch = new HeaderMatchMatch(); + } + this.innerMatch().withRegexMatch(regexMatch); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerMatch() != null) { + innerMatch().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("header", this.headerProperty); + jsonWriter.writeJsonField("match", this.innerMatch); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HeaderMatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HeaderMatch if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HeaderMatch. + */ + public static HeaderMatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HeaderMatch deserializedHeaderMatch = new HeaderMatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("header".equals(fieldName)) { + deserializedHeaderMatch.headerProperty = reader.getString(); + } else if ("match".equals(fieldName)) { + deserializedHeaderMatch.innerMatch = HeaderMatchMatch.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHeaderMatch; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpConnectionPool.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpConnectionPool.java new file mode 100644 index 0000000000000..1bab688679cb7 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpConnectionPool.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines parameters for http connection pooling. + */ +@Fluent +public final class HttpConnectionPool implements JsonSerializable { + /* + * Maximum number of pending http1 requests allowed + */ + private Integer http1MaxPendingRequests; + + /* + * Maximum number of http2 requests allowed + */ + private Integer http2MaxRequests; + + /** + * Creates an instance of HttpConnectionPool class. + */ + public HttpConnectionPool() { + } + + /** + * Get the http1MaxPendingRequests property: Maximum number of pending http1 requests allowed. + * + * @return the http1MaxPendingRequests value. + */ + public Integer http1MaxPendingRequests() { + return this.http1MaxPendingRequests; + } + + /** + * Set the http1MaxPendingRequests property: Maximum number of pending http1 requests allowed. + * + * @param http1MaxPendingRequests the http1MaxPendingRequests value to set. + * @return the HttpConnectionPool object itself. + */ + public HttpConnectionPool withHttp1MaxPendingRequests(Integer http1MaxPendingRequests) { + this.http1MaxPendingRequests = http1MaxPendingRequests; + return this; + } + + /** + * Get the http2MaxRequests property: Maximum number of http2 requests allowed. + * + * @return the http2MaxRequests value. + */ + public Integer http2MaxRequests() { + return this.http2MaxRequests; + } + + /** + * Set the http2MaxRequests property: Maximum number of http2 requests allowed. + * + * @param http2MaxRequests the http2MaxRequests value to set. + * @return the HttpConnectionPool object itself. + */ + public HttpConnectionPool withHttp2MaxRequests(Integer http2MaxRequests) { + this.http2MaxRequests = http2MaxRequests; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("http1MaxPendingRequests", this.http1MaxPendingRequests); + jsonWriter.writeNumberField("http2MaxRequests", this.http2MaxRequests); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HttpConnectionPool from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HttpConnectionPool if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HttpConnectionPool. + */ + public static HttpConnectionPool fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HttpConnectionPool deserializedHttpConnectionPool = new HttpConnectionPool(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("http1MaxPendingRequests".equals(fieldName)) { + deserializedHttpConnectionPool.http1MaxPendingRequests = reader.getNullable(JsonReader::getInt); + } else if ("http2MaxRequests".equals(fieldName)) { + deserializedHttpConnectionPool.http2MaxRequests = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedHttpConnectionPool; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpGet.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpGet.java new file mode 100644 index 0000000000000..5579b4b5dfbbf --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpGet.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Model representing a http get request. + */ +@Fluent +public final class HttpGet implements JsonSerializable { + /* + * URL to make HTTP GET request against. + */ + private String url; + + /* + * Name of the file that the request should be saved to. + */ + private String fileName; + + /* + * List of headers to send with the request. + */ + private List headers; + + /** + * Creates an instance of HttpGet class. + */ + public HttpGet() { + } + + /** + * Get the url property: URL to make HTTP GET request against. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: URL to make HTTP GET request against. + * + * @param url the url value to set. + * @return the HttpGet object itself. + */ + public HttpGet withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the fileName property: Name of the file that the request should be saved to. + * + * @return the fileName value. + */ + public String fileName() { + return this.fileName; + } + + /** + * Set the fileName property: Name of the file that the request should be saved to. + * + * @param fileName the fileName value to set. + * @return the HttpGet object itself. + */ + public HttpGet withFileName(String fileName) { + this.fileName = fileName; + return this; + } + + /** + * Get the headers property: List of headers to send with the request. + * + * @return the headers value. + */ + public List headers() { + return this.headers; + } + + /** + * Set the headers property: List of headers to send with the request. + * + * @param headers the headers value to set. + * @return the HttpGet object itself. + */ + public HttpGet withHeaders(List headers) { + this.headers = headers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (url() == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property url in model HttpGet")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HttpGet.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeStringField("fileName", this.fileName); + jsonWriter.writeArrayField("headers", this.headers, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HttpGet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HttpGet if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HttpGet. + */ + public static HttpGet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HttpGet deserializedHttpGet = new HttpGet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("url".equals(fieldName)) { + deserializedHttpGet.url = reader.getString(); + } else if ("fileName".equals(fieldName)) { + deserializedHttpGet.fileName = reader.getString(); + } else if ("headers".equals(fieldName)) { + List headers = reader.readArray(reader1 -> reader1.getString()); + deserializedHttpGet.headers = headers; + } else { + reader.skipChildren(); + } + } + + return deserializedHttpGet; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRetryPolicy.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRetryPolicy.java new file mode 100644 index 0000000000000..2c4c1eee0e960 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRetryPolicy.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.fluent.models.HttpRetryPolicyMatches; +import com.azure.resourcemanager.appcontainers.fluent.models.HttpRetryPolicyRetryBackOff; +import java.io.IOException; +import java.util.List; + +/** + * Policy that defines http request retry conditions. + */ +@Fluent +public final class HttpRetryPolicy implements JsonSerializable { + /* + * Maximum number of times a request will retry + */ + private Integer maxRetries; + + /* + * Settings for retry backoff characteristics + */ + private HttpRetryPolicyRetryBackOff innerRetryBackOff; + + /* + * Conditions that must be met for a request to be retried + */ + private HttpRetryPolicyMatches innerMatches; + + /** + * Creates an instance of HttpRetryPolicy class. + */ + public HttpRetryPolicy() { + } + + /** + * Get the maxRetries property: Maximum number of times a request will retry. + * + * @return the maxRetries value. + */ + public Integer maxRetries() { + return this.maxRetries; + } + + /** + * Set the maxRetries property: Maximum number of times a request will retry. + * + * @param maxRetries the maxRetries value to set. + * @return the HttpRetryPolicy object itself. + */ + public HttpRetryPolicy withMaxRetries(Integer maxRetries) { + this.maxRetries = maxRetries; + return this; + } + + /** + * Get the innerRetryBackOff property: Settings for retry backoff characteristics. + * + * @return the innerRetryBackOff value. + */ + private HttpRetryPolicyRetryBackOff innerRetryBackOff() { + return this.innerRetryBackOff; + } + + /** + * Get the innerMatches property: Conditions that must be met for a request to be retried. + * + * @return the innerMatches value. + */ + private HttpRetryPolicyMatches innerMatches() { + return this.innerMatches; + } + + /** + * Get the initialDelayInMilliseconds property: Initial delay, in milliseconds, before retrying a request. + * + * @return the initialDelayInMilliseconds value. + */ + public Long initialDelayInMilliseconds() { + return this.innerRetryBackOff() == null ? null : this.innerRetryBackOff().initialDelayInMilliseconds(); + } + + /** + * Set the initialDelayInMilliseconds property: Initial delay, in milliseconds, before retrying a request. + * + * @param initialDelayInMilliseconds the initialDelayInMilliseconds value to set. + * @return the HttpRetryPolicy object itself. + */ + public HttpRetryPolicy withInitialDelayInMilliseconds(Long initialDelayInMilliseconds) { + if (this.innerRetryBackOff() == null) { + this.innerRetryBackOff = new HttpRetryPolicyRetryBackOff(); + } + this.innerRetryBackOff().withInitialDelayInMilliseconds(initialDelayInMilliseconds); + return this; + } + + /** + * Get the maxIntervalInMilliseconds property: Maximum interval, in milliseconds, between retries. + * + * @return the maxIntervalInMilliseconds value. + */ + public Long maxIntervalInMilliseconds() { + return this.innerRetryBackOff() == null ? null : this.innerRetryBackOff().maxIntervalInMilliseconds(); + } + + /** + * Set the maxIntervalInMilliseconds property: Maximum interval, in milliseconds, between retries. + * + * @param maxIntervalInMilliseconds the maxIntervalInMilliseconds value to set. + * @return the HttpRetryPolicy object itself. + */ + public HttpRetryPolicy withMaxIntervalInMilliseconds(Long maxIntervalInMilliseconds) { + if (this.innerRetryBackOff() == null) { + this.innerRetryBackOff = new HttpRetryPolicyRetryBackOff(); + } + this.innerRetryBackOff().withMaxIntervalInMilliseconds(maxIntervalInMilliseconds); + return this; + } + + /** + * Get the headers property: Headers that must be present for a request to be retried. + * + * @return the headers value. + */ + public List headers() { + return this.innerMatches() == null ? null : this.innerMatches().headers(); + } + + /** + * Set the headers property: Headers that must be present for a request to be retried. + * + * @param headers the headers value to set. + * @return the HttpRetryPolicy object itself. + */ + public HttpRetryPolicy withHeaders(List headers) { + if (this.innerMatches() == null) { + this.innerMatches = new HttpRetryPolicyMatches(); + } + this.innerMatches().withHeaders(headers); + return this; + } + + /** + * Get the httpStatusCodes property: Additional http status codes that can trigger a retry. + * + * @return the httpStatusCodes value. + */ + public List httpStatusCodes() { + return this.innerMatches() == null ? null : this.innerMatches().httpStatusCodes(); + } + + /** + * Set the httpStatusCodes property: Additional http status codes that can trigger a retry. + * + * @param httpStatusCodes the httpStatusCodes value to set. + * @return the HttpRetryPolicy object itself. + */ + public HttpRetryPolicy withHttpStatusCodes(List httpStatusCodes) { + if (this.innerMatches() == null) { + this.innerMatches = new HttpRetryPolicyMatches(); + } + this.innerMatches().withHttpStatusCodes(httpStatusCodes); + return this; + } + + /** + * Get the errors property: Errors that can trigger a retry. + * + * @return the errors value. + */ + public List errors() { + return this.innerMatches() == null ? null : this.innerMatches().errors(); + } + + /** + * Set the errors property: Errors that can trigger a retry. + * + * @param errors the errors value to set. + * @return the HttpRetryPolicy object itself. + */ + public HttpRetryPolicy withErrors(List errors) { + if (this.innerMatches() == null) { + this.innerMatches = new HttpRetryPolicyMatches(); + } + this.innerMatches().withErrors(errors); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerRetryBackOff() != null) { + innerRetryBackOff().validate(); + } + if (innerMatches() != null) { + innerMatches().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maxRetries", this.maxRetries); + jsonWriter.writeJsonField("retryBackOff", this.innerRetryBackOff); + jsonWriter.writeJsonField("matches", this.innerMatches); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HttpRetryPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HttpRetryPolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HttpRetryPolicy. + */ + public static HttpRetryPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HttpRetryPolicy deserializedHttpRetryPolicy = new HttpRetryPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxRetries".equals(fieldName)) { + deserializedHttpRetryPolicy.maxRetries = reader.getNullable(JsonReader::getInt); + } else if ("retryBackOff".equals(fieldName)) { + deserializedHttpRetryPolicy.innerRetryBackOff = HttpRetryPolicyRetryBackOff.fromJson(reader); + } else if ("matches".equals(fieldName)) { + deserializedHttpRetryPolicy.innerMatches = HttpRetryPolicyMatches.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHttpRetryPolicy; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpScaleRule.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpScaleRule.java index e6455db23a933..9624ae09d213b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpScaleRule.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpScaleRule.java @@ -28,6 +28,12 @@ public final class HttpScaleRule implements JsonSerializable { */ private List auth; + /* + * The resource ID of a user-assigned managed identity that is assigned to the Container App, or 'system' for + * system-assigned identity. + */ + private String identity; + /** * Creates an instance of HttpScaleRule class. */ @@ -74,6 +80,28 @@ public HttpScaleRule withAuth(List auth) { return this; } + /** + * Get the identity property: The resource ID of a user-assigned managed identity that is assigned to the Container + * App, or 'system' for system-assigned identity. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: The resource ID of a user-assigned managed identity that is assigned to the Container + * App, or 'system' for system-assigned identity. + * + * @param identity the identity value to set. + * @return the HttpScaleRule object itself. + */ + public HttpScaleRule withIdentity(String identity) { + this.identity = identity; + return this; + } + /** * Validates the instance. * @@ -93,6 +121,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); jsonWriter.writeArrayField("auth", this.auth, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -117,6 +146,8 @@ public static HttpScaleRule fromJson(JsonReader jsonReader) throws IOException { } else if ("auth".equals(fieldName)) { List auth = reader.readArray(reader1 -> ScaleRuleAuth.fromJson(reader1)); deserializedHttpScaleRule.auth = auth; + } else if ("identity".equals(fieldName)) { + deserializedHttpScaleRule.identity = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IdentitySettings.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IdentitySettings.java new file mode 100644 index 0000000000000..700777e850381 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IdentitySettings.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Optional settings for a Managed Identity that is assigned to the Container App. + */ +@Fluent +public final class IdentitySettings implements JsonSerializable { + /* + * The resource ID of a user-assigned managed identity that is assigned to the Container App, or 'system' for + * system-assigned identity. + */ + private String identity; + + /* + * Use to select the lifecycle stages of a Container App during which the Managed Identity should be available. + */ + private IdentitySettingsLifeCycle lifecycle; + + /** + * Creates an instance of IdentitySettings class. + */ + public IdentitySettings() { + } + + /** + * Get the identity property: The resource ID of a user-assigned managed identity that is assigned to the Container + * App, or 'system' for system-assigned identity. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: The resource ID of a user-assigned managed identity that is assigned to the Container + * App, or 'system' for system-assigned identity. + * + * @param identity the identity value to set. + * @return the IdentitySettings object itself. + */ + public IdentitySettings withIdentity(String identity) { + this.identity = identity; + return this; + } + + /** + * Get the lifecycle property: Use to select the lifecycle stages of a Container App during which the Managed + * Identity should be available. + * + * @return the lifecycle value. + */ + public IdentitySettingsLifeCycle lifecycle() { + return this.lifecycle; + } + + /** + * Set the lifecycle property: Use to select the lifecycle stages of a Container App during which the Managed + * Identity should be available. + * + * @param lifecycle the lifecycle value to set. + * @return the IdentitySettings object itself. + */ + public IdentitySettings withLifecycle(IdentitySettingsLifeCycle lifecycle) { + this.lifecycle = lifecycle; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property identity in model IdentitySettings")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IdentitySettings.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("identity", this.identity); + jsonWriter.writeStringField("lifecycle", this.lifecycle == null ? null : this.lifecycle.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IdentitySettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IdentitySettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IdentitySettings. + */ + public static IdentitySettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IdentitySettings deserializedIdentitySettings = new IdentitySettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedIdentitySettings.identity = reader.getString(); + } else if ("lifecycle".equals(fieldName)) { + deserializedIdentitySettings.lifecycle = IdentitySettingsLifeCycle.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIdentitySettings; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IdentitySettingsLifeCycle.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IdentitySettingsLifeCycle.java new file mode 100644 index 0000000000000..3df9c4c122458 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IdentitySettingsLifeCycle.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Use to select the lifecycle stages of a Container App during which the Managed Identity should be available. + */ +public final class IdentitySettingsLifeCycle extends ExpandableStringEnum { + /** + * Static value Init for IdentitySettingsLifeCycle. + */ + public static final IdentitySettingsLifeCycle INIT = fromString("Init"); + + /** + * Static value Main for IdentitySettingsLifeCycle. + */ + public static final IdentitySettingsLifeCycle MAIN = fromString("Main"); + + /** + * Static value None for IdentitySettingsLifeCycle. + */ + public static final IdentitySettingsLifeCycle NONE = fromString("None"); + + /** + * Static value All for IdentitySettingsLifeCycle. + */ + public static final IdentitySettingsLifeCycle ALL = fromString("All"); + + /** + * Creates a new instance of IdentitySettingsLifeCycle value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IdentitySettingsLifeCycle() { + } + + /** + * Creates or finds a IdentitySettingsLifeCycle from its string representation. + * + * @param name a name to look for. + * @return the corresponding IdentitySettingsLifeCycle. + */ + public static IdentitySettingsLifeCycle fromString(String name) { + return fromString(name, IdentitySettingsLifeCycle.class); + } + + /** + * Gets known IdentitySettingsLifeCycle values. + * + * @return known IdentitySettingsLifeCycle values. + */ + public static Collection values() { + return values(IdentitySettingsLifeCycle.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ImageType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ImageType.java new file mode 100644 index 0000000000000..968fafc226f67 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ImageType.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of the image. Set to CloudBuild to let the system manages the image, where user will not be able to update + * image through image field. Set to ContainerImage for user provided image. + */ +public final class ImageType extends ExpandableStringEnum { + /** + * Static value CloudBuild for ImageType. + */ + public static final ImageType CLOUD_BUILD = fromString("CloudBuild"); + + /** + * Static value ContainerImage for ImageType. + */ + public static final ImageType CONTAINER_IMAGE = fromString("ContainerImage"); + + /** + * Creates a new instance of ImageType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ImageType() { + } + + /** + * Creates or finds a ImageType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImageType. + */ + public static ImageType fromString(String name) { + return fromString(name, ImageType.class); + } + + /** + * Gets known ImageType values. + * + * @return known ImageType values. + */ + public static Collection values() { + return values(ImageType.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Ingress.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Ingress.java index f06b3c3f2df74..bcfe8ad33e0c9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Ingress.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Ingress.java @@ -85,6 +85,11 @@ public final class Ingress implements JsonSerializable { */ private List additionalPortMappings; + /* + * Whether an http app listens on http or https + */ + private IngressTargetPortHttpScheme targetPortHttpScheme; + /** * Creates an instance of Ingress class. */ @@ -346,6 +351,26 @@ public Ingress withAdditionalPortMappings(List additionalPor return this; } + /** + * Get the targetPortHttpScheme property: Whether an http app listens on http or https. + * + * @return the targetPortHttpScheme value. + */ + public IngressTargetPortHttpScheme targetPortHttpScheme() { + return this.targetPortHttpScheme; + } + + /** + * Set the targetPortHttpScheme property: Whether an http app listens on http or https. + * + * @param targetPortHttpScheme the targetPortHttpScheme value to set. + * @return the Ingress object itself. + */ + public Ingress withTargetPortHttpScheme(IngressTargetPortHttpScheme targetPortHttpScheme) { + this.targetPortHttpScheme = targetPortHttpScheme; + return this; + } + /** * Validates the instance. * @@ -393,6 +418,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("corsPolicy", this.corsPolicy); jsonWriter.writeArrayField("additionalPortMappings", this.additionalPortMappings, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("targetPortHttpScheme", + this.targetPortHttpScheme == null ? null : this.targetPortHttpScheme.toString()); return jsonWriter.writeEndObject(); } @@ -444,6 +471,9 @@ public static Ingress fromJson(JsonReader jsonReader) throws IOException { List additionalPortMappings = reader.readArray(reader1 -> IngressPortMapping.fromJson(reader1)); deserializedIngress.additionalPortMappings = additionalPortMappings; + } else if ("targetPortHttpScheme".equals(fieldName)) { + deserializedIngress.targetPortHttpScheme + = IngressTargetPortHttpScheme.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressTargetPortHttpScheme.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressTargetPortHttpScheme.java new file mode 100644 index 0000000000000..2a165d3bcd0b0 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressTargetPortHttpScheme.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Whether an http app listens on http or https. + */ +public final class IngressTargetPortHttpScheme extends ExpandableStringEnum { + /** + * Static value http for IngressTargetPortHttpScheme. + */ + public static final IngressTargetPortHttpScheme HTTP = fromString("http"); + + /** + * Static value https for IngressTargetPortHttpScheme. + */ + public static final IngressTargetPortHttpScheme HTTPS = fromString("https"); + + /** + * Creates a new instance of IngressTargetPortHttpScheme value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IngressTargetPortHttpScheme() { + } + + /** + * Creates or finds a IngressTargetPortHttpScheme from its string representation. + * + * @param name a name to look for. + * @return the corresponding IngressTargetPortHttpScheme. + */ + public static IngressTargetPortHttpScheme fromString(String name) { + return fromString(name, IngressTargetPortHttpScheme.class); + } + + /** + * Gets known IngressTargetPortHttpScheme values. + * + * @return known IngressTargetPortHttpScheme values. + */ + public static Collection values() { + return values(IngressTargetPortHttpScheme.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/InitContainer.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/InitContainer.java index 93fe5df1908af..83304b0ad6a8d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/InitContainer.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/InitContainer.java @@ -31,6 +31,15 @@ public InitContainer withImage(String image) { return this; } + /** + * {@inheritDoc} + */ + @Override + public InitContainer withImageType(ImageType imageType) { + super.withImageType(imageType); + return this; + } + /** * {@inheritDoc} */ @@ -92,7 +101,15 @@ public InitContainer withVolumeMounts(List volumeMounts) { */ @Override public void validate() { - super.validate(); + if (env() != null) { + env().forEach(e -> e.validate()); + } + if (resources() != null) { + resources().validate(); + } + if (volumeMounts() != null) { + volumeMounts().forEach(e -> e.validate()); + } } /** @@ -102,6 +119,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("image", image()); + jsonWriter.writeStringField("imageType", imageType() == null ? null : imageType().toString()); jsonWriter.writeStringField("name", name()); jsonWriter.writeArrayField("command", command(), (writer, element) -> writer.writeString(element)); jsonWriter.writeArrayField("args", args(), (writer, element) -> writer.writeString(element)); @@ -128,6 +146,8 @@ public static InitContainer fromJson(JsonReader jsonReader) throws IOException { if ("image".equals(fieldName)) { deserializedInitContainer.withImage(reader.getString()); + } else if ("imageType".equals(fieldName)) { + deserializedInitContainer.withImageType(ImageType.fromString(reader.getString())); } else if ("name".equals(fieldName)) { deserializedInitContainer.withName(reader.getString()); } else if ("command".equals(fieldName)) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponent.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponent.java new file mode 100644 index 0000000000000..0faa35c4e557d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponent.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.JavaComponentInner; + +/** + * An immutable client-side representation of JavaComponent. + */ +public interface JavaComponent { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Java Component resource specific properties. + * + * @return the properties value. + */ + JavaComponentProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.JavaComponentInner object. + * + * @return the inner object. + */ + JavaComponentInner innerModel(); + + /** + * The entirety of the JavaComponent definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The JavaComponent definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the JavaComponent definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the JavaComponent definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, environmentName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @return the next definition stage. + */ + WithCreate withExistingManagedEnvironment(String resourceGroupName, String environmentName); + } + + /** + * The stage of the JavaComponent definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + JavaComponent create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + JavaComponent create(Context context); + } + + /** + * The stage of the JavaComponent definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Java Component resource specific properties. + * + * @param properties Java Component resource specific properties. + * @return the next definition stage. + */ + WithCreate withProperties(JavaComponentProperties properties); + } + } + + /** + * Begins update for the JavaComponent resource. + * + * @return the stage of resource update. + */ + JavaComponent.Update update(); + + /** + * The template for JavaComponent update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + JavaComponent apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + JavaComponent apply(Context context); + } + + /** + * The JavaComponent update stages. + */ + interface UpdateStages { + /** + * The stage of the JavaComponent update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Java Component resource specific properties. + * + * @param properties Java Component resource specific properties. + * @return the next definition stage. + */ + Update withProperties(JavaComponentProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + JavaComponent refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + JavaComponent refresh(Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentConfigurationProperty.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentConfigurationProperty.java new file mode 100644 index 0000000000000..923aae7475363 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentConfigurationProperty.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration properties for a Java Component. + */ +@Fluent +public final class JavaComponentConfigurationProperty implements JsonSerializable { + /* + * The name of the property + */ + private String propertyName; + + /* + * The value of the property + */ + private String value; + + /** + * Creates an instance of JavaComponentConfigurationProperty class. + */ + public JavaComponentConfigurationProperty() { + } + + /** + * Get the propertyName property: The name of the property. + * + * @return the propertyName value. + */ + public String propertyName() { + return this.propertyName; + } + + /** + * Set the propertyName property: The name of the property. + * + * @param propertyName the propertyName value to set. + * @return the JavaComponentConfigurationProperty object itself. + */ + public JavaComponentConfigurationProperty withPropertyName(String propertyName) { + this.propertyName = propertyName; + return this; + } + + /** + * Get the value property: The value of the property. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the property. + * + * @param value the value value to set. + * @return the JavaComponentConfigurationProperty object itself. + */ + public JavaComponentConfigurationProperty withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("propertyName", this.propertyName); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JavaComponentConfigurationProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JavaComponentConfigurationProperty if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the JavaComponentConfigurationProperty. + */ + public static JavaComponentConfigurationProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JavaComponentConfigurationProperty deserializedJavaComponentConfigurationProperty + = new JavaComponentConfigurationProperty(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("propertyName".equals(fieldName)) { + deserializedJavaComponentConfigurationProperty.propertyName = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedJavaComponentConfigurationProperty.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJavaComponentConfigurationProperty; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentIngress.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentIngress.java new file mode 100644 index 0000000000000..bf0d5ec6b7259 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentIngress.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Container App Ingress configuration. + */ +@Immutable +public final class JavaComponentIngress implements JsonSerializable { + /* + * Hostname of the Java Component endpoint + */ + private String fqdn; + + /** + * Creates an instance of JavaComponentIngress class. + */ + public JavaComponentIngress() { + } + + /** + * Get the fqdn property: Hostname of the Java Component endpoint. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JavaComponentIngress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JavaComponentIngress if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the JavaComponentIngress. + */ + public static JavaComponentIngress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JavaComponentIngress deserializedJavaComponentIngress = new JavaComponentIngress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fqdn".equals(fieldName)) { + deserializedJavaComponentIngress.fqdn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJavaComponentIngress; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentProperties.java new file mode 100644 index 0000000000000..6de48a551d17d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentProperties.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Java Component common properties. + */ +@Fluent +public class JavaComponentProperties implements JsonSerializable { + /* + * Type of the Java Component. + */ + private JavaComponentType componentType = JavaComponentType.fromString("JavaComponentProperties"); + + /* + * Provisioning state of the Java Component. + */ + private JavaComponentProvisioningState provisioningState; + + /* + * List of Java Components configuration properties + */ + private List configurations; + + /* + * Java component scaling configurations + */ + private JavaComponentPropertiesScale scale; + + /* + * List of Java Components that are bound to the Java component + */ + private List serviceBinds; + + /** + * Creates an instance of JavaComponentProperties class. + */ + public JavaComponentProperties() { + } + + /** + * Get the componentType property: Type of the Java Component. + * + * @return the componentType value. + */ + public JavaComponentType componentType() { + return this.componentType; + } + + /** + * Get the provisioningState property: Provisioning state of the Java Component. + * + * @return the provisioningState value. + */ + public JavaComponentProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Provisioning state of the Java Component. + * + * @param provisioningState the provisioningState value to set. + * @return the JavaComponentProperties object itself. + */ + JavaComponentProperties withProvisioningState(JavaComponentProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the configurations property: List of Java Components configuration properties. + * + * @return the configurations value. + */ + public List configurations() { + return this.configurations; + } + + /** + * Set the configurations property: List of Java Components configuration properties. + * + * @param configurations the configurations value to set. + * @return the JavaComponentProperties object itself. + */ + public JavaComponentProperties withConfigurations(List configurations) { + this.configurations = configurations; + return this; + } + + /** + * Get the scale property: Java component scaling configurations. + * + * @return the scale value. + */ + public JavaComponentPropertiesScale scale() { + return this.scale; + } + + /** + * Set the scale property: Java component scaling configurations. + * + * @param scale the scale value to set. + * @return the JavaComponentProperties object itself. + */ + public JavaComponentProperties withScale(JavaComponentPropertiesScale scale) { + this.scale = scale; + return this; + } + + /** + * Get the serviceBinds property: List of Java Components that are bound to the Java component. + * + * @return the serviceBinds value. + */ + public List serviceBinds() { + return this.serviceBinds; + } + + /** + * Set the serviceBinds property: List of Java Components that are bound to the Java component. + * + * @param serviceBinds the serviceBinds value to set. + * @return the JavaComponentProperties object itself. + */ + public JavaComponentProperties withServiceBinds(List serviceBinds) { + this.serviceBinds = serviceBinds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (configurations() != null) { + configurations().forEach(e -> e.validate()); + } + if (scale() != null) { + scale().validate(); + } + if (serviceBinds() != null) { + serviceBinds().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("componentType", this.componentType == null ? null : this.componentType.toString()); + jsonWriter.writeArrayField("configurations", this.configurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("scale", this.scale); + jsonWriter.writeArrayField("serviceBinds", this.serviceBinds, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JavaComponentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JavaComponentProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the JavaComponentProperties. + */ + public static JavaComponentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("componentType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("SpringCloudGateway".equals(discriminatorValue)) { + return SpringCloudGatewayComponent.fromJson(readerToUse.reset()); + } else if ("SpringBootAdmin".equals(discriminatorValue)) { + return SpringBootAdminComponent.fromJson(readerToUse.reset()); + } else if ("Nacos".equals(discriminatorValue)) { + return NacosComponent.fromJson(readerToUse.reset()); + } else if ("SpringCloudEureka".equals(discriminatorValue)) { + return SpringCloudEurekaComponent.fromJson(readerToUse.reset()); + } else if ("SpringCloudConfig".equals(discriminatorValue)) { + return SpringCloudConfigComponent.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static JavaComponentProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JavaComponentProperties deserializedJavaComponentProperties = new JavaComponentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("componentType".equals(fieldName)) { + deserializedJavaComponentProperties.componentType + = JavaComponentType.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedJavaComponentProperties.provisioningState + = JavaComponentProvisioningState.fromString(reader.getString()); + } else if ("configurations".equals(fieldName)) { + List configurations + = reader.readArray(reader1 -> JavaComponentConfigurationProperty.fromJson(reader1)); + deserializedJavaComponentProperties.configurations = configurations; + } else if ("scale".equals(fieldName)) { + deserializedJavaComponentProperties.scale = JavaComponentPropertiesScale.fromJson(reader); + } else if ("serviceBinds".equals(fieldName)) { + List serviceBinds + = reader.readArray(reader1 -> JavaComponentServiceBind.fromJson(reader1)); + deserializedJavaComponentProperties.serviceBinds = serviceBinds; + } else { + reader.skipChildren(); + } + } + + return deserializedJavaComponentProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentPropertiesScale.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentPropertiesScale.java new file mode 100644 index 0000000000000..52f374b5767e9 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentPropertiesScale.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Java component scaling configurations. + */ +@Fluent +public final class JavaComponentPropertiesScale implements JsonSerializable { + /* + * Optional. Minimum number of Java component replicas. Defaults to 1 if not set + */ + private Integer minReplicas; + + /* + * Optional. Maximum number of Java component replicas + */ + private Integer maxReplicas; + + /** + * Creates an instance of JavaComponentPropertiesScale class. + */ + public JavaComponentPropertiesScale() { + } + + /** + * Get the minReplicas property: Optional. Minimum number of Java component replicas. Defaults to 1 if not set. + * + * @return the minReplicas value. + */ + public Integer minReplicas() { + return this.minReplicas; + } + + /** + * Set the minReplicas property: Optional. Minimum number of Java component replicas. Defaults to 1 if not set. + * + * @param minReplicas the minReplicas value to set. + * @return the JavaComponentPropertiesScale object itself. + */ + public JavaComponentPropertiesScale withMinReplicas(Integer minReplicas) { + this.minReplicas = minReplicas; + return this; + } + + /** + * Get the maxReplicas property: Optional. Maximum number of Java component replicas. + * + * @return the maxReplicas value. + */ + public Integer maxReplicas() { + return this.maxReplicas; + } + + /** + * Set the maxReplicas property: Optional. Maximum number of Java component replicas. + * + * @param maxReplicas the maxReplicas value to set. + * @return the JavaComponentPropertiesScale object itself. + */ + public JavaComponentPropertiesScale withMaxReplicas(Integer maxReplicas) { + this.maxReplicas = maxReplicas; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("minReplicas", this.minReplicas); + jsonWriter.writeNumberField("maxReplicas", this.maxReplicas); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JavaComponentPropertiesScale from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JavaComponentPropertiesScale if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the JavaComponentPropertiesScale. + */ + public static JavaComponentPropertiesScale fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JavaComponentPropertiesScale deserializedJavaComponentPropertiesScale = new JavaComponentPropertiesScale(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("minReplicas".equals(fieldName)) { + deserializedJavaComponentPropertiesScale.minReplicas = reader.getNullable(JsonReader::getInt); + } else if ("maxReplicas".equals(fieldName)) { + deserializedJavaComponentPropertiesScale.maxReplicas = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedJavaComponentPropertiesScale; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentProvisioningState.java new file mode 100644 index 0000000000000..74f85932f5fa8 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentProvisioningState.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of the Java Component. + */ +public final class JavaComponentProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for JavaComponentProvisioningState. + */ + public static final JavaComponentProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for JavaComponentProvisioningState. + */ + public static final JavaComponentProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for JavaComponentProvisioningState. + */ + public static final JavaComponentProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Deleting for JavaComponentProvisioningState. + */ + public static final JavaComponentProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value InProgress for JavaComponentProvisioningState. + */ + public static final JavaComponentProvisioningState IN_PROGRESS = fromString("InProgress"); + + /** + * Creates a new instance of JavaComponentProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JavaComponentProvisioningState() { + } + + /** + * Creates or finds a JavaComponentProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding JavaComponentProvisioningState. + */ + public static JavaComponentProvisioningState fromString(String name) { + return fromString(name, JavaComponentProvisioningState.class); + } + + /** + * Gets known JavaComponentProvisioningState values. + * + * @return known JavaComponentProvisioningState values. + */ + public static Collection values() { + return values(JavaComponentProvisioningState.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentServiceBind.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentServiceBind.java new file mode 100644 index 0000000000000..d09561fc2907a --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentServiceBind.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration to bind a Java Component to another Java Component. + */ +@Fluent +public final class JavaComponentServiceBind implements JsonSerializable { + /* + * Name of the service bind + */ + private String name; + + /* + * Resource id of the target service + */ + private String serviceId; + + /** + * Creates an instance of JavaComponentServiceBind class. + */ + public JavaComponentServiceBind() { + } + + /** + * Get the name property: Name of the service bind. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the service bind. + * + * @param name the name value to set. + * @return the JavaComponentServiceBind object itself. + */ + public JavaComponentServiceBind withName(String name) { + this.name = name; + return this; + } + + /** + * Get the serviceId property: Resource id of the target service. + * + * @return the serviceId value. + */ + public String serviceId() { + return this.serviceId; + } + + /** + * Set the serviceId property: Resource id of the target service. + * + * @param serviceId the serviceId value to set. + * @return the JavaComponentServiceBind object itself. + */ + public JavaComponentServiceBind withServiceId(String serviceId) { + this.serviceId = serviceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("serviceId", this.serviceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JavaComponentServiceBind from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JavaComponentServiceBind if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the JavaComponentServiceBind. + */ + public static JavaComponentServiceBind fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JavaComponentServiceBind deserializedJavaComponentServiceBind = new JavaComponentServiceBind(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedJavaComponentServiceBind.name = reader.getString(); + } else if ("serviceId".equals(fieldName)) { + deserializedJavaComponentServiceBind.serviceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJavaComponentServiceBind; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentType.java new file mode 100644 index 0000000000000..d53349332fe66 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentType.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of the Java Component. + */ +public final class JavaComponentType extends ExpandableStringEnum { + /** + * Static value SpringBootAdmin for JavaComponentType. + */ + public static final JavaComponentType SPRING_BOOT_ADMIN = fromString("SpringBootAdmin"); + + /** + * Static value SpringCloudEureka for JavaComponentType. + */ + public static final JavaComponentType SPRING_CLOUD_EUREKA = fromString("SpringCloudEureka"); + + /** + * Static value SpringCloudConfig for JavaComponentType. + */ + public static final JavaComponentType SPRING_CLOUD_CONFIG = fromString("SpringCloudConfig"); + + /** + * Static value SpringCloudGateway for JavaComponentType. + */ + public static final JavaComponentType SPRING_CLOUD_GATEWAY = fromString("SpringCloudGateway"); + + /** + * Static value Nacos for JavaComponentType. + */ + public static final JavaComponentType NACOS = fromString("Nacos"); + + /** + * Creates a new instance of JavaComponentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JavaComponentType() { + } + + /** + * Creates or finds a JavaComponentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding JavaComponentType. + */ + public static JavaComponentType fromString(String name) { + return fromString(name, JavaComponentType.class); + } + + /** + * Gets known JavaComponentType values. + * + * @return known JavaComponentType values. + */ + public static Collection values() { + return values(JavaComponentType.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponents.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponents.java new file mode 100644 index 0000000000000..3f27736d5a732 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponents.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of JavaComponents. + */ +public interface JavaComponents { + /** + * Get the Java Components for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Java Components for a managed environment as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName); + + /** + * Get the Java Components for a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Java Components for a managed environment as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName, Context context); + + /** + * Get a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Java Component along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String environmentName, String name, + Context context); + + /** + * Get a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Java Component. + */ + JavaComponent get(String resourceGroupName, String environmentName, String name); + + /** + * Delete a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String environmentName, String name); + + /** + * Delete a Java Component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Java Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String environmentName, String name, Context context); + + /** + * Get a Java Component. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Java Component along with {@link Response}. + */ + JavaComponent getById(String id); + + /** + * Get a Java Component. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Java Component along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Java Component. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Java Component. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new JavaComponent resource. + * + * @param name resource name. + * @return the first stage of the new JavaComponent definition. + */ + JavaComponent.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentsCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentsCollection.java new file mode 100644 index 0000000000000..78466a48e7e6b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentsCollection.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.fluent.models.JavaComponentInner; +import java.io.IOException; +import java.util.List; + +/** + * Java Components ARM resource. + */ +@Fluent +public final class JavaComponentsCollection implements JsonSerializable { + /* + * Collection of resources. + */ + private List value; + + /* + * Link to next page of resources. + */ + private String nextLink; + + /** + * Creates an instance of JavaComponentsCollection class. + */ + public JavaComponentsCollection() { + } + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the JavaComponentsCollection object itself. + */ + public JavaComponentsCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model JavaComponentsCollection")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(JavaComponentsCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JavaComponentsCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JavaComponentsCollection if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the JavaComponentsCollection. + */ + public static JavaComponentsCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JavaComponentsCollection deserializedJavaComponentsCollection = new JavaComponentsCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> JavaComponentInner.fromJson(reader1)); + deserializedJavaComponentsCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedJavaComponentsCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJavaComponentsCollection; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Job.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Job.java index 705ec61cb7aba..3c867ad96ea82 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Job.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Job.java @@ -51,6 +51,13 @@ public interface Job { */ Map tags(); + /** + * Gets the extendedLocation property: The complex type of the extended location. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + /** * Gets the identity property: Managed identities needed by a container app job to interact with other Azure * services to not maintain any secrets or credentials in code. @@ -73,6 +80,13 @@ public interface Job { */ JobProvisioningState provisioningState(); + /** + * Gets the runningState property: Current running state of the job. + * + * @return the runningState value. + */ + JobRunningState runningState(); + /** * Gets the environmentId property: Resource ID of environment. * @@ -198,8 +212,8 @@ interface WithResourceGroup { * The stage of the Job definition which contains all the minimum required properties for the resource to be * created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, - DefinitionStages.WithEnvironmentId, DefinitionStages.WithWorkloadProfileName, + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithExtendedLocation, + DefinitionStages.WithIdentity, DefinitionStages.WithEnvironmentId, DefinitionStages.WithWorkloadProfileName, DefinitionStages.WithConfiguration, DefinitionStages.WithTemplate { /** * Executes the create request. @@ -230,6 +244,19 @@ interface WithTags { WithCreate withTags(Map tags); } + /** + * The stage of the Job definition allowing to specify extendedLocation. + */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The complex type of the extended location.. + * + * @param extendedLocation The complex type of the extended location. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** * The stage of the Job definition allowing to specify identity. */ @@ -309,7 +336,8 @@ interface WithTemplate { /** * The template for Job update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithProperties { + interface Update extends UpdateStages.WithTags, UpdateStages.WithExtendedLocation, UpdateStages.WithIdentity, + UpdateStages.WithProperties { /** * Executes the update request. * @@ -343,6 +371,19 @@ interface WithTags { Update withTags(Map tags); } + /** + * The stage of the Job update allowing to specify extendedLocation. + */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The complex type of the extended location.. + * + * @param extendedLocation The complex type of the extended location. + * @return the next definition stage. + */ + Update withExtendedLocation(ExtendedLocation extendedLocation); + } + /** * The stage of the Job update allowing to specify identity. */ @@ -453,4 +494,44 @@ interface WithProperties { * @return container Apps Job Secrets Collection ARM resource. */ JobSecretsCollection listSecrets(); + + /** + * Resumes a suspended job. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + Job resume(); + + /** + * Resumes a suspended job. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + Job resume(Context context); + + /** + * Suspends a job. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + Job suspend(); + + /** + * Suspends a job. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + Job suspend(Context context); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfiguration.java index f1faf8af59b4a..5f8e8c2f509a8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfiguration.java @@ -60,6 +60,12 @@ public final class JobConfiguration implements JsonSerializable registries; + /* + * Optional settings for Managed Identities that are assigned to the Container App Job. If a Managed Identity is not + * specified here, default settings will be used. + */ + private List identitySettings; + /** * Creates an instance of JobConfiguration class. */ @@ -230,6 +236,28 @@ public JobConfiguration withRegistries(List registries) { return this; } + /** + * Get the identitySettings property: Optional settings for Managed Identities that are assigned to the Container + * App Job. If a Managed Identity is not specified here, default settings will be used. + * + * @return the identitySettings value. + */ + public List identitySettings() { + return this.identitySettings; + } + + /** + * Set the identitySettings property: Optional settings for Managed Identities that are assigned to the Container + * App Job. If a Managed Identity is not specified here, default settings will be used. + * + * @param identitySettings the identitySettings value to set. + * @return the JobConfiguration object itself. + */ + public JobConfiguration withIdentitySettings(List identitySettings) { + this.identitySettings = identitySettings; + return this; + } + /** * Validates the instance. * @@ -255,6 +283,9 @@ public void validate() { if (registries() != null) { registries().forEach(e -> e.validate()); } + if (identitySettings() != null) { + identitySettings().forEach(e -> e.validate()); + } } private static final ClientLogger LOGGER = new ClientLogger(JobConfiguration.class); @@ -273,6 +304,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("scheduleTriggerConfig", this.scheduleTriggerConfig); jsonWriter.writeJsonField("eventTriggerConfig", this.eventTriggerConfig); jsonWriter.writeArrayField("registries", this.registries, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("identitySettings", this.identitySettings, + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -314,6 +347,10 @@ public static JobConfiguration fromJson(JsonReader jsonReader) throws IOExceptio List registries = reader.readArray(reader1 -> RegistryCredentials.fromJson(reader1)); deserializedJobConfiguration.registries = registries; + } else if ("identitySettings".equals(fieldName)) { + List identitySettings + = reader.readArray(reader1 -> IdentitySettings.fromJson(reader1)); + deserializedJobConfiguration.identitySettings = identitySettings; } else { reader.skipChildren(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecution.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecution.java index cf83584a43866..86f5654629d53 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecution.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecution.java @@ -60,6 +60,13 @@ public interface JobExecution { */ JobExecutionTemplate template(); + /** + * Gets the detailedStatus property: Detailed status of the job execution. + * + * @return the detailedStatus value. + */ + ExecutionStatus detailedStatus(); + /** * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionInner object. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchProperties.java index 32de8d05cc338..5ee1158155f06 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchProperties.java @@ -17,6 +17,11 @@ */ @Fluent public final class JobPatchProperties implements JsonSerializable { + /* + * The complex type of the extended location. + */ + private ExtendedLocation extendedLocation; + /* * Managed identities needed by a container app job to interact with other Azure services to not maintain any * secrets or credentials in code. @@ -39,6 +44,26 @@ public final class JobPatchProperties implements JsonSerializable writer.writeString(element)); jsonWriter.writeJsonField("properties", this.properties); @@ -142,7 +171,9 @@ public static JobPatchProperties fromJson(JsonReader jsonReader) throws IOExcept String fieldName = reader.getFieldName(); reader.nextToken(); - if ("identity".equals(fieldName)) { + if ("extendedLocation".equals(fieldName)) { + deserializedJobPatchProperties.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("identity".equals(fieldName)) { deserializedJobPatchProperties.identity = ManagedServiceIdentity.fromJson(reader); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobRunningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobRunningState.java new file mode 100644 index 0000000000000..382ef10f0ca79 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobRunningState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Current running state of the job. + */ +public final class JobRunningState extends ExpandableStringEnum { + /** + * Static value Ready for JobRunningState. + */ + public static final JobRunningState READY = fromString("Ready"); + + /** + * Static value Progressing for JobRunningState. + */ + public static final JobRunningState PROGRESSING = fromString("Progressing"); + + /** + * Static value Suspended for JobRunningState. + */ + public static final JobRunningState SUSPENDED = fromString("Suspended"); + + /** + * Creates a new instance of JobRunningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JobRunningState() { + } + + /** + * Creates or finds a JobRunningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobRunningState. + */ + public static JobRunningState fromString(String name) { + return fromString(name, JobRunningState.class); + } + + /** + * Gets known JobRunningState values. + * + * @return known JobRunningState values. + */ + public static Collection values() { + return values(JobRunningState.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobScaleRule.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobScaleRule.java index 8932f452a4297..def3294532089 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobScaleRule.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobScaleRule.java @@ -38,6 +38,12 @@ public final class JobScaleRule implements JsonSerializable { */ private List auth; + /* + * The resource ID of a user-assigned managed identity that is assigned to the job, or 'system' for system-assigned + * identity. + */ + private String identity; + /** * Creates an instance of JobScaleRule class. */ @@ -126,6 +132,28 @@ public JobScaleRule withAuth(List auth) { return this; } + /** + * Get the identity property: The resource ID of a user-assigned managed identity that is assigned to the job, or + * 'system' for system-assigned identity. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: The resource ID of a user-assigned managed identity that is assigned to the job, or + * 'system' for system-assigned identity. + * + * @param identity the identity value to set. + * @return the JobScaleRule object itself. + */ + public JobScaleRule withIdentity(String identity) { + this.identity = identity; + return this; + } + /** * Validates the instance. * @@ -147,6 +175,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("type", this.type); jsonWriter.writeUntypedField("metadata", this.metadata); jsonWriter.writeArrayField("auth", this.auth, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -174,6 +203,8 @@ public static JobScaleRule fromJson(JsonReader jsonReader) throws IOException { } else if ("auth".equals(fieldName)) { List auth = reader.readArray(reader1 -> ScaleRuleAuth.fromJson(reader1)); deserializedJobScaleRule.auth = auth; + } else if ("identity".equals(fieldName)) { + deserializedJobScaleRule.identity = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Jobs.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Jobs.java index f789354e54f91..674a99b394aca 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Jobs.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Jobs.java @@ -78,11 +78,12 @@ Response getDetectorWithResponse(String resourceGroupName, String j Diagnostics getDetector(String resourceGroupName, String jobName, String detectorName); /** + * Get the properties for a given Container App Job. + * * Get the properties of a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param apiName Proxy API Name for Container App Job. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request @@ -90,21 +91,22 @@ Response getDetectorWithResponse(String resourceGroupName, String j * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App Job along with {@link Response}. */ - Response proxyGetWithResponse(String resourceGroupName, String jobName, String apiName, Context context); + Response proxyGetWithResponse(String resourceGroupName, String jobName, Context context); /** + * Get the properties for a given Container App Job. + * * Get the properties of a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param apiName Proxy API Name for Container App Job. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App Job. */ - Job proxyGet(String resourceGroupName, String jobName, String apiName); + Job proxyGet(String resourceGroupName, String jobName); /** * Get the Container Apps Jobs in a given subscription. @@ -314,6 +316,56 @@ Response getDetectorWithResponse(String resourceGroupName, String j */ JobSecretsCollection listSecrets(String resourceGroupName, String jobName); + /** + * Resumes a suspended job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + Job resume(String resourceGroupName, String jobName); + + /** + * Resumes a suspended job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + Job resume(String resourceGroupName, String jobName, Context context); + + /** + * Suspends a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + Job suspend(String resourceGroupName, String jobName); + + /** + * Suspends a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + Job suspend(String resourceGroupName, String jobName, Context context); + /** * Get the properties of a Container Apps Job. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Kind.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Kind.java new file mode 100644 index 0000000000000..6bdc6796467c2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Kind.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Metadata used to render different experiences for resources of the same type; e.g. WorkflowApp is a kind of + * Microsoft.App/ContainerApps type. If supported, the resource provider must validate and persist this value. + */ +public final class Kind extends ExpandableStringEnum { + /** + * Static value workflowapp for Kind. + */ + public static final Kind WORKFLOWAPP = fromString("workflowapp"); + + /** + * Creates a new instance of Kind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Kind() { + } + + /** + * Creates or finds a Kind from its string representation. + * + * @param name a name to look for. + * @return the corresponding Kind. + */ + public static Kind fromString(String name) { + return fromString(name, Kind.class); + } + + /** + * Gets known Kind values. + * + * @return known Kind values. + */ + public static Collection values() { + return values(Kind.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Level.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Level.java new file mode 100644 index 0000000000000..cb7577f3909bc --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Level.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The specified logger's log level. + */ +public final class Level extends ExpandableStringEnum { + /** + * Static value off for Level. + */ + public static final Level OFF = fromString("off"); + + /** + * Static value error for Level. + */ + public static final Level ERROR = fromString("error"); + + /** + * Static value info for Level. + */ + public static final Level INFO = fromString("info"); + + /** + * Static value debug for Level. + */ + public static final Level DEBUG = fromString("debug"); + + /** + * Static value trace for Level. + */ + public static final Level TRACE = fromString("trace"); + + /** + * Static value warn for Level. + */ + public static final Level WARN = fromString("warn"); + + /** + * Creates a new instance of Level value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Level() { + } + + /** + * Creates or finds a Level from its string representation. + * + * @param name a name to look for. + * @return the corresponding Level. + */ + public static Level fromString(String name) { + return fromString(name, Level.class); + } + + /** + * Gets known Level values. + * + * @return known Level values. + */ + public static Collection values() { + return values(Level.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogAnalyticsConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogAnalyticsConfiguration.java index 4aaeb16fe2aec..da8a3c852632b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogAnalyticsConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogAnalyticsConfiguration.java @@ -26,6 +26,11 @@ public final class LogAnalyticsConfiguration implements JsonSerializable { + /* + * Logger name. + */ + private String logger; + + /* + * The specified logger's log level. + */ + private Level level; + + /** + * Creates an instance of LoggerSetting class. + */ + public LoggerSetting() { + } + + /** + * Get the logger property: Logger name. + * + * @return the logger value. + */ + public String logger() { + return this.logger; + } + + /** + * Set the logger property: Logger name. + * + * @param logger the logger value to set. + * @return the LoggerSetting object itself. + */ + public LoggerSetting withLogger(String logger) { + this.logger = logger; + return this; + } + + /** + * Get the level property: The specified logger's log level. + * + * @return the level value. + */ + public Level level() { + return this.level; + } + + /** + * Set the level property: The specified logger's log level. + * + * @param level the level value to set. + * @return the LoggerSetting object itself. + */ + public LoggerSetting withLevel(Level level) { + this.level = level; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logger() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property logger in model LoggerSetting")); + } + if (level() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property level in model LoggerSetting")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LoggerSetting.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("logger", this.logger); + jsonWriter.writeStringField("level", this.level == null ? null : this.level.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoggerSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoggerSetting if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LoggerSetting. + */ + public static LoggerSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoggerSetting deserializedLoggerSetting = new LoggerSetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logger".equals(fieldName)) { + deserializedLoggerSetting.logger = reader.getString(); + } else if ("level".equals(fieldName)) { + deserializedLoggerSetting.level = Level.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLoggerSetting; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogicApp.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogicApp.java new file mode 100644 index 0000000000000..e1e846984fc19 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogicApp.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.LogicAppInner; + +/** + * An immutable client-side representation of LogicApp. + */ +public interface LogicApp { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Object properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.LogicAppInner object. + * + * @return the inner object. + */ + LogicAppInner innerModel(); + + /** + * The entirety of the LogicApp definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The LogicApp definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the LogicApp definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the LogicApp definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, containerAppName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @return the next definition stage. + */ + WithCreate withExistingContainerApp(String resourceGroupName, String containerAppName); + } + + /** + * The stage of the LogicApp definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + LogicApp create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LogicApp create(Context context); + } + + /** + * The stage of the LogicApp definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Object properties); + } + } + + /** + * Begins update for the LogicApp resource. + * + * @return the stage of resource update. + */ + LogicApp.Update update(); + + /** + * The template for LogicApp update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LogicApp apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LogicApp apply(Context context); + } + + /** + * The LogicApp update stages. + */ + interface UpdateStages { + /** + * The stage of the LogicApp update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(Object properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LogicApp refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LogicApp refresh(Context context); + + /** + * Creates or updates the artifacts for the logic app. + * + * @param workflowArtifacts Application settings and files of the workflow. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deployWorkflowArtifactsWithResponse(WorkflowArtifacts workflowArtifacts, Context context); + + /** + * Creates or updates the artifacts for the logic app. + * + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deployWorkflowArtifacts(); + + /** + * Gets logic app's connections. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections along with {@link Response}. + */ + Response listWorkflowsConnectionsWithResponse(Context context); + + /** + * Gets logic app's connections. + * + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections. + */ + WorkflowEnvelope listWorkflowsConnections(); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogicApps.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogicApps.java new file mode 100644 index 0000000000000..b853015478be3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogicApps.java @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of LogicApps. + */ +public interface LogicApps { + /** + * Gets a logic app extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + Context context); + + /** + * Gets a logic app extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource. + */ + LogicApp get(String resourceGroupName, String containerAppName, String logicAppName); + + /** + * Deletes a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + Context context); + + /** + * Deletes a Logic App extension resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String containerAppName, String logicAppName); + + /** + * List the workflows for a logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements as paginated response with {@link PagedIterable}. + */ + PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + String logicAppName); + + /** + * List the workflows for a logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of workflow information elements as paginated response with {@link PagedIterable}. + */ + PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + String logicAppName, Context context); + + /** + * Get workflow information by its name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowName Workflow name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflow information by its name along with {@link Response}. + */ + Response getWorkflowWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, String workflowName, Context context); + + /** + * Get workflow information by its name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowName Workflow name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflow information by its name. + */ + WorkflowEnvelope getWorkflow(String resourceGroupName, String containerAppName, String logicAppName, + String workflowName); + + /** + * Creates or updates the artifacts for the logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param workflowArtifacts Application settings and files of the workflow. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deployWorkflowArtifactsWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, WorkflowArtifacts workflowArtifacts, Context context); + + /** + * Creates or updates the artifacts for the logic app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deployWorkflowArtifacts(String resourceGroupName, String containerAppName, String logicAppName); + + /** + * Gets logic app's connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections along with {@link Response}. + */ + Response listWorkflowsConnectionsWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, Context context); + + /** + * Gets logic app's connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the Logic App, the extension resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return logic app's connections. + */ + WorkflowEnvelope listWorkflowsConnections(String resourceGroupName, String containerAppName, String logicAppName); + + /** + * Proxies a the API call to the logic app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the LogicApp App, the extension resource. + * @param xMsLogicAppsProxyPath The proxy path for the API call. + * @param xMsLogicAppsProxyMethod The proxy method for the API call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object along with {@link Response}. + */ + Response invokeWithResponse(String resourceGroupName, String containerAppName, String logicAppName, + String xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod, Context context); + + /** + * Proxies a the API call to the logic app backed by the container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param logicAppName Name of the LogicApp App, the extension resource. + * @param xMsLogicAppsProxyPath The proxy path for the API call. + * @param xMsLogicAppsProxyMethod The proxy method for the API call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object invoke(String resourceGroupName, String containerAppName, String logicAppName, String xMsLogicAppsProxyPath, + LogicAppsProxyMethod xMsLogicAppsProxyMethod); + + /** + * Gets a logic app extension resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response}. + */ + LogicApp getById(String id); + + /** + * Gets a logic app extension resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a logic app extension resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Logic App extension resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Logic App extension resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new LogicApp resource. + * + * @param name resource name. + * @return the first stage of the new LogicApp definition. + */ + LogicApp.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogicAppsProxyMethod.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogicAppsProxyMethod.java new file mode 100644 index 0000000000000..f4702aad851da --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogicAppsProxyMethod.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for LogicAppsProxyMethod. + */ +public final class LogicAppsProxyMethod extends ExpandableStringEnum { + /** + * Static value GET for LogicAppsProxyMethod. + */ + public static final LogicAppsProxyMethod GET = fromString("GET"); + + /** + * Static value POST for LogicAppsProxyMethod. + */ + public static final LogicAppsProxyMethod POST = fromString("POST"); + + /** + * Creates a new instance of LogicAppsProxyMethod value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LogicAppsProxyMethod() { + } + + /** + * Creates or finds a LogicAppsProxyMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogicAppsProxyMethod. + */ + public static LogicAppsProxyMethod fromString(String name) { + return fromString(name, LogicAppsProxyMethod.class); + } + + /** + * Gets known LogicAppsProxyMethod values. + * + * @return known LogicAppsProxyMethod values. + */ + public static Collection values() { + return values(LogicAppsProxyMethod.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogsConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogsConfiguration.java new file mode 100644 index 0000000000000..eb495caff8908 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogsConfiguration.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Configuration of Open Telemetry logs. + */ +@Fluent +public final class LogsConfiguration implements JsonSerializable { + /* + * Open telemetry logs destinations + */ + private List destinations; + + /** + * Creates an instance of LogsConfiguration class. + */ + public LogsConfiguration() { + } + + /** + * Get the destinations property: Open telemetry logs destinations. + * + * @return the destinations value. + */ + public List destinations() { + return this.destinations; + } + + /** + * Set the destinations property: Open telemetry logs destinations. + * + * @param destinations the destinations value to set. + * @return the LogsConfiguration object itself. + */ + public LogsConfiguration withDestinations(List destinations) { + this.destinations = destinations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("destinations", this.destinations, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LogsConfiguration. + */ + public static LogsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsConfiguration deserializedLogsConfiguration = new LogsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("destinations".equals(fieldName)) { + List destinations = reader.readArray(reader1 -> reader1.getString()); + deserializedLogsConfiguration.destinations = destinations; + } else { + reader.skipChildren(); + } + } + + return deserializedLogsConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironment.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironment.java index b897d20957099..116461604263f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironment.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironment.java @@ -58,6 +58,14 @@ public interface ManagedEnvironment { */ String kind(); + /** + * Gets the identity property: Managed identities for the Managed Environment to interact with other Azure services + * without maintaining any secrets or credentials in code. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -125,6 +133,20 @@ public interface ManagedEnvironment { */ AppLogsConfiguration appLogsConfiguration(); + /** + * Gets the appInsightsConfiguration property: Environment level Application Insights configuration. + * + * @return the appInsightsConfiguration value. + */ + AppInsightsConfiguration appInsightsConfiguration(); + + /** + * Gets the openTelemetryConfiguration property: Environment Open Telemetry configuration. + * + * @return the openTelemetryConfiguration value. + */ + OpenTelemetryConfiguration openTelemetryConfiguration(); + /** * Gets the zoneRedundant property: Whether or not this Managed Environment is zone-redundant. * @@ -190,6 +212,21 @@ public interface ManagedEnvironment { */ ManagedEnvironmentPropertiesPeerTrafficConfiguration peerTrafficConfiguration(); + /** + * Gets the privateEndpointConnections property: Private endpoint connections to the resource. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the publicNetworkAccess property: Property to allow or block all public traffic. Allowed Values: 'Enabled', + * 'Disabled'. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + /** * Gets the region of the resource. * @@ -274,12 +311,14 @@ interface WithResourceGroup { * resource to be created, but also allows for any other optional properties to be specified. */ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithKind, - DefinitionStages.WithDaprAIInstrumentationKey, DefinitionStages.WithDaprAIConnectionString, - DefinitionStages.WithVnetConfiguration, DefinitionStages.WithAppLogsConfiguration, - DefinitionStages.WithZoneRedundant, DefinitionStages.WithCustomDomainConfiguration, - DefinitionStages.WithWorkloadProfiles, DefinitionStages.WithKedaConfiguration, - DefinitionStages.WithDaprConfiguration, DefinitionStages.WithInfrastructureResourceGroup, - DefinitionStages.WithPeerAuthentication, DefinitionStages.WithPeerTrafficConfiguration { + DefinitionStages.WithIdentity, DefinitionStages.WithDaprAIInstrumentationKey, + DefinitionStages.WithDaprAIConnectionString, DefinitionStages.WithVnetConfiguration, + DefinitionStages.WithAppLogsConfiguration, DefinitionStages.WithAppInsightsConfiguration, + DefinitionStages.WithOpenTelemetryConfiguration, DefinitionStages.WithZoneRedundant, + DefinitionStages.WithCustomDomainConfiguration, DefinitionStages.WithWorkloadProfiles, + DefinitionStages.WithKedaConfiguration, DefinitionStages.WithDaprConfiguration, + DefinitionStages.WithInfrastructureResourceGroup, DefinitionStages.WithPeerAuthentication, + DefinitionStages.WithPeerTrafficConfiguration, DefinitionStages.WithPublicNetworkAccess { /** * Executes the create request. * @@ -322,6 +361,21 @@ interface WithKind { WithCreate withKind(String kind); } + /** + * The stage of the ManagedEnvironment definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: Managed identities for the Managed Environment to interact with other + * Azure services without maintaining any secrets or credentials in code.. + * + * @param identity Managed identities for the Managed Environment to interact with other Azure services + * without maintaining any secrets or credentials in code. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + /** * The stage of the ManagedEnvironment definition allowing to specify daprAIInstrumentationKey. */ @@ -382,6 +436,32 @@ interface WithAppLogsConfiguration { WithCreate withAppLogsConfiguration(AppLogsConfiguration appLogsConfiguration); } + /** + * The stage of the ManagedEnvironment definition allowing to specify appInsightsConfiguration. + */ + interface WithAppInsightsConfiguration { + /** + * Specifies the appInsightsConfiguration property: Environment level Application Insights configuration. + * + * @param appInsightsConfiguration Environment level Application Insights configuration. + * @return the next definition stage. + */ + WithCreate withAppInsightsConfiguration(AppInsightsConfiguration appInsightsConfiguration); + } + + /** + * The stage of the ManagedEnvironment definition allowing to specify openTelemetryConfiguration. + */ + interface WithOpenTelemetryConfiguration { + /** + * Specifies the openTelemetryConfiguration property: Environment Open Telemetry configuration. + * + * @param openTelemetryConfiguration Environment Open Telemetry configuration. + * @return the next definition stage. + */ + WithCreate withOpenTelemetryConfiguration(OpenTelemetryConfiguration openTelemetryConfiguration); + } + /** * The stage of the ManagedEnvironment definition allowing to specify zoneRedundant. */ @@ -490,6 +570,21 @@ interface WithPeerTrafficConfiguration { WithCreate withPeerTrafficConfiguration( ManagedEnvironmentPropertiesPeerTrafficConfiguration peerTrafficConfiguration); } + + /** + * The stage of the ManagedEnvironment definition allowing to specify publicNetworkAccess. + */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Property to allow or block all public traffic. Allowed + * Values: 'Enabled', 'Disabled'.. + * + * @param publicNetworkAccess Property to allow or block all public traffic. Allowed Values: 'Enabled', + * 'Disabled'. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } } /** @@ -502,11 +597,13 @@ WithCreate withPeerTrafficConfiguration( /** * The template for ManagedEnvironment update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithKind, UpdateStages.WithDaprAIInstrumentationKey, - UpdateStages.WithDaprAIConnectionString, UpdateStages.WithVnetConfiguration, - UpdateStages.WithAppLogsConfiguration, UpdateStages.WithCustomDomainConfiguration, - UpdateStages.WithWorkloadProfiles, UpdateStages.WithKedaConfiguration, UpdateStages.WithDaprConfiguration, - UpdateStages.WithPeerAuthentication, UpdateStages.WithPeerTrafficConfiguration { + interface Update extends UpdateStages.WithTags, UpdateStages.WithKind, UpdateStages.WithIdentity, + UpdateStages.WithDaprAIInstrumentationKey, UpdateStages.WithDaprAIConnectionString, + UpdateStages.WithVnetConfiguration, UpdateStages.WithAppLogsConfiguration, + UpdateStages.WithAppInsightsConfiguration, UpdateStages.WithOpenTelemetryConfiguration, + UpdateStages.WithCustomDomainConfiguration, UpdateStages.WithWorkloadProfiles, + UpdateStages.WithKedaConfiguration, UpdateStages.WithDaprConfiguration, UpdateStages.WithPeerAuthentication, + UpdateStages.WithPeerTrafficConfiguration, UpdateStages.WithPublicNetworkAccess { /** * Executes the update request. * @@ -553,6 +650,21 @@ interface WithKind { Update withKind(String kind); } + /** + * The stage of the ManagedEnvironment update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: Managed identities for the Managed Environment to interact with other + * Azure services without maintaining any secrets or credentials in code.. + * + * @param identity Managed identities for the Managed Environment to interact with other Azure services + * without maintaining any secrets or credentials in code. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + /** * The stage of the ManagedEnvironment update allowing to specify daprAIInstrumentationKey. */ @@ -613,6 +725,32 @@ interface WithAppLogsConfiguration { Update withAppLogsConfiguration(AppLogsConfiguration appLogsConfiguration); } + /** + * The stage of the ManagedEnvironment update allowing to specify appInsightsConfiguration. + */ + interface WithAppInsightsConfiguration { + /** + * Specifies the appInsightsConfiguration property: Environment level Application Insights configuration. + * + * @param appInsightsConfiguration Environment level Application Insights configuration. + * @return the next definition stage. + */ + Update withAppInsightsConfiguration(AppInsightsConfiguration appInsightsConfiguration); + } + + /** + * The stage of the ManagedEnvironment update allowing to specify openTelemetryConfiguration. + */ + interface WithOpenTelemetryConfiguration { + /** + * Specifies the openTelemetryConfiguration property: Environment Open Telemetry configuration. + * + * @param openTelemetryConfiguration Environment Open Telemetry configuration. + * @return the next definition stage. + */ + Update withOpenTelemetryConfiguration(OpenTelemetryConfiguration openTelemetryConfiguration); + } + /** * The stage of the ManagedEnvironment update allowing to specify customDomainConfiguration. */ @@ -691,6 +829,21 @@ interface WithPeerTrafficConfiguration { Update withPeerTrafficConfiguration( ManagedEnvironmentPropertiesPeerTrafficConfiguration peerTrafficConfiguration); } + + /** + * The stage of the ManagedEnvironment update allowing to specify publicNetworkAccess. + */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Property to allow or block all public traffic. Allowed + * Values: 'Enabled', 'Disabled'.. + * + * @param publicNetworkAccess Property to allow or block all public traffic. Allowed Values: 'Enabled', + * 'Disabled'. + * @return the next definition stage. + */ + Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPrivateEndpointConnections.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPrivateEndpointConnections.java new file mode 100644 index 0000000000000..7bb6dfb9d798c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPrivateEndpointConnections.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ManagedEnvironmentPrivateEndpointConnections. + */ +public interface ManagedEnvironmentPrivateEndpointConnections { + /** + * List private endpoint connections for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName); + + /** + * List private endpoint connections for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified resource as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName, Context context); + + /** + * Get a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection for a given managed environment along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, Context context); + + /** + * Get a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection for a given managed environment. + */ + PrivateEndpointConnection get(String resourceGroupName, String environmentName, + String privateEndpointConnectionName); + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String environmentName, String privateEndpointConnectionName); + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String environmentName, String privateEndpointConnectionName, + Context context); + + /** + * Get a private endpoint connection for a given managed environment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection for a given managed environment along with {@link Response}. + */ + PrivateEndpointConnection getById(String id); + + /** + * Get a private endpoint connection for a given managed environment. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection for a given managed environment along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a private endpoint connection for a given managed environment. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PrivateEndpointConnection resource. + * + * @param name resource name. + * @return the first stage of the new PrivateEndpointConnection definition. + */ + PrivateEndpointConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPrivateLinkResources.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPrivateLinkResources.java new file mode 100644 index 0000000000000..480e3073148af --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPrivateLinkResources.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of ManagedEnvironmentPrivateLinkResources. + */ +public interface ManagedEnvironmentPrivateLinkResources { + /** + * List private link resources for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName); + + /** + * List private link resources for a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentStorageProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentStorageProperties.java index 72e0b7277b342..84c56b6a4eeec 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentStorageProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentStorageProperties.java @@ -22,6 +22,11 @@ public final class ManagedEnvironmentStorageProperties */ private AzureFileProperties azureFile; + /* + * NFS Azure file properties + */ + private NfsAzureFileProperties nfsAzureFile; + /** * Creates an instance of ManagedEnvironmentStorageProperties class. */ @@ -48,6 +53,26 @@ public ManagedEnvironmentStorageProperties withAzureFile(AzureFileProperties azu return this; } + /** + * Get the nfsAzureFile property: NFS Azure file properties. + * + * @return the nfsAzureFile value. + */ + public NfsAzureFileProperties nfsAzureFile() { + return this.nfsAzureFile; + } + + /** + * Set the nfsAzureFile property: NFS Azure file properties. + * + * @param nfsAzureFile the nfsAzureFile value to set. + * @return the ManagedEnvironmentStorageProperties object itself. + */ + public ManagedEnvironmentStorageProperties withNfsAzureFile(NfsAzureFileProperties nfsAzureFile) { + this.nfsAzureFile = nfsAzureFile; + return this; + } + /** * Validates the instance. * @@ -57,6 +82,9 @@ public void validate() { if (azureFile() != null) { azureFile().validate(); } + if (nfsAzureFile() != null) { + nfsAzureFile().validate(); + } } /** @@ -66,6 +94,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("azureFile", this.azureFile); + jsonWriter.writeJsonField("nfsAzureFile", this.nfsAzureFile); return jsonWriter.writeEndObject(); } @@ -87,6 +116,9 @@ public static ManagedEnvironmentStorageProperties fromJson(JsonReader jsonReader if ("azureFile".equals(fieldName)) { deserializedManagedEnvironmentStorageProperties.azureFile = AzureFileProperties.fromJson(reader); + } else if ("nfsAzureFile".equals(fieldName)) { + deserializedManagedEnvironmentStorageProperties.nfsAzureFile + = NfsAzureFileProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/MetricsConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/MetricsConfiguration.java new file mode 100644 index 0000000000000..5fa2a2d26131d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/MetricsConfiguration.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Configuration of Open Telemetry metrics. + */ +@Fluent +public final class MetricsConfiguration implements JsonSerializable { + /* + * Boolean indicating if including keda metrics + */ + private Boolean includeKeda; + + /* + * Open telemetry metrics destinations + */ + private List destinations; + + /** + * Creates an instance of MetricsConfiguration class. + */ + public MetricsConfiguration() { + } + + /** + * Get the includeKeda property: Boolean indicating if including keda metrics. + * + * @return the includeKeda value. + */ + public Boolean includeKeda() { + return this.includeKeda; + } + + /** + * Set the includeKeda property: Boolean indicating if including keda metrics. + * + * @param includeKeda the includeKeda value to set. + * @return the MetricsConfiguration object itself. + */ + public MetricsConfiguration withIncludeKeda(Boolean includeKeda) { + this.includeKeda = includeKeda; + return this; + } + + /** + * Get the destinations property: Open telemetry metrics destinations. + * + * @return the destinations value. + */ + public List destinations() { + return this.destinations; + } + + /** + * Set the destinations property: Open telemetry metrics destinations. + * + * @param destinations the destinations value to set. + * @return the MetricsConfiguration object itself. + */ + public MetricsConfiguration withDestinations(List destinations) { + this.destinations = destinations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("includeKeda", this.includeKeda); + jsonWriter.writeArrayField("destinations", this.destinations, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricsConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MetricsConfiguration. + */ + public static MetricsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricsConfiguration deserializedMetricsConfiguration = new MetricsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("includeKeda".equals(fieldName)) { + deserializedMetricsConfiguration.includeKeda = reader.getNullable(JsonReader::getBoolean); + } else if ("destinations".equals(fieldName)) { + List destinations = reader.readArray(reader1 -> reader1.getString()); + deserializedMetricsConfiguration.destinations = destinations; + } else { + reader.skipChildren(); + } + } + + return deserializedMetricsConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/NacosComponent.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/NacosComponent.java new file mode 100644 index 0000000000000..852c94665bfe7 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/NacosComponent.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Nacos properties. + */ +@Fluent +public final class NacosComponent extends JavaComponentProperties { + /* + * Type of the Java Component. + */ + private JavaComponentType componentType = JavaComponentType.NACOS; + + /* + * Java Component Ingress configurations. + */ + private JavaComponentIngress ingress; + + /* + * Provisioning state of the Java Component. + */ + private JavaComponentProvisioningState provisioningState; + + /** + * Creates an instance of NacosComponent class. + */ + public NacosComponent() { + } + + /** + * Get the componentType property: Type of the Java Component. + * + * @return the componentType value. + */ + @Override + public JavaComponentType componentType() { + return this.componentType; + } + + /** + * Get the ingress property: Java Component Ingress configurations. + * + * @return the ingress value. + */ + public JavaComponentIngress ingress() { + return this.ingress; + } + + /** + * Set the ingress property: Java Component Ingress configurations. + * + * @param ingress the ingress value to set. + * @return the NacosComponent object itself. + */ + public NacosComponent withIngress(JavaComponentIngress ingress) { + this.ingress = ingress; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Java Component. + * + * @return the provisioningState value. + */ + @Override + public JavaComponentProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public NacosComponent withConfigurations(List configurations) { + super.withConfigurations(configurations); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NacosComponent withScale(JavaComponentPropertiesScale scale) { + super.withScale(scale); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NacosComponent withServiceBinds(List serviceBinds) { + super.withServiceBinds(serviceBinds); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (ingress() != null) { + ingress().validate(); + } + if (configurations() != null) { + configurations().forEach(e -> e.validate()); + } + if (scale() != null) { + scale().validate(); + } + if (serviceBinds() != null) { + serviceBinds().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("configurations", configurations(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("scale", scale()); + jsonWriter.writeArrayField("serviceBinds", serviceBinds(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("componentType", this.componentType == null ? null : this.componentType.toString()); + jsonWriter.writeJsonField("ingress", this.ingress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NacosComponent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NacosComponent if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NacosComponent. + */ + public static NacosComponent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NacosComponent deserializedNacosComponent = new NacosComponent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedNacosComponent.provisioningState + = JavaComponentProvisioningState.fromString(reader.getString()); + } else if ("configurations".equals(fieldName)) { + List configurations + = reader.readArray(reader1 -> JavaComponentConfigurationProperty.fromJson(reader1)); + deserializedNacosComponent.withConfigurations(configurations); + } else if ("scale".equals(fieldName)) { + deserializedNacosComponent.withScale(JavaComponentPropertiesScale.fromJson(reader)); + } else if ("serviceBinds".equals(fieldName)) { + List serviceBinds + = reader.readArray(reader1 -> JavaComponentServiceBind.fromJson(reader1)); + deserializedNacosComponent.withServiceBinds(serviceBinds); + } else if ("componentType".equals(fieldName)) { + deserializedNacosComponent.componentType = JavaComponentType.fromString(reader.getString()); + } else if ("ingress".equals(fieldName)) { + deserializedNacosComponent.ingress = JavaComponentIngress.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNacosComponent; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/NfsAzureFileProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/NfsAzureFileProperties.java new file mode 100644 index 0000000000000..7b05dea106e27 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/NfsAzureFileProperties.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * NFS Azure File Properties. + */ +@Fluent +public final class NfsAzureFileProperties implements JsonSerializable { + /* + * Server for NFS azure file. + */ + private String server; + + /* + * Access mode for storage + */ + private AccessMode accessMode; + + /* + * NFS Azure file share name. + */ + private String shareName; + + /** + * Creates an instance of NfsAzureFileProperties class. + */ + public NfsAzureFileProperties() { + } + + /** + * Get the server property: Server for NFS azure file. + * + * @return the server value. + */ + public String server() { + return this.server; + } + + /** + * Set the server property: Server for NFS azure file. + * + * @param server the server value to set. + * @return the NfsAzureFileProperties object itself. + */ + public NfsAzureFileProperties withServer(String server) { + this.server = server; + return this; + } + + /** + * Get the accessMode property: Access mode for storage. + * + * @return the accessMode value. + */ + public AccessMode accessMode() { + return this.accessMode; + } + + /** + * Set the accessMode property: Access mode for storage. + * + * @param accessMode the accessMode value to set. + * @return the NfsAzureFileProperties object itself. + */ + public NfsAzureFileProperties withAccessMode(AccessMode accessMode) { + this.accessMode = accessMode; + return this; + } + + /** + * Get the shareName property: NFS Azure file share name. + * + * @return the shareName value. + */ + public String shareName() { + return this.shareName; + } + + /** + * Set the shareName property: NFS Azure file share name. + * + * @param shareName the shareName value to set. + * @return the NfsAzureFileProperties object itself. + */ + public NfsAzureFileProperties withShareName(String shareName) { + this.shareName = shareName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("server", this.server); + jsonWriter.writeStringField("accessMode", this.accessMode == null ? null : this.accessMode.toString()); + jsonWriter.writeStringField("shareName", this.shareName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NfsAzureFileProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NfsAzureFileProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the NfsAzureFileProperties. + */ + public static NfsAzureFileProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NfsAzureFileProperties deserializedNfsAzureFileProperties = new NfsAzureFileProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("server".equals(fieldName)) { + deserializedNfsAzureFileProperties.server = reader.getString(); + } else if ("accessMode".equals(fieldName)) { + deserializedNfsAzureFileProperties.accessMode = AccessMode.fromString(reader.getString()); + } else if ("shareName".equals(fieldName)) { + deserializedNfsAzureFileProperties.shareName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNfsAzureFileProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenTelemetryConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenTelemetryConfiguration.java new file mode 100644 index 0000000000000..96a98ff4db407 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenTelemetryConfiguration.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration of Open Telemetry. + */ +@Fluent +public final class OpenTelemetryConfiguration implements JsonSerializable { + /* + * Open telemetry destinations configuration + */ + private DestinationsConfiguration destinationsConfiguration; + + /* + * Open telemetry trace configuration + */ + private TracesConfiguration tracesConfiguration; + + /* + * Open telemetry logs configuration + */ + private LogsConfiguration logsConfiguration; + + /* + * Open telemetry metrics configuration + */ + private MetricsConfiguration metricsConfiguration; + + /** + * Creates an instance of OpenTelemetryConfiguration class. + */ + public OpenTelemetryConfiguration() { + } + + /** + * Get the destinationsConfiguration property: Open telemetry destinations configuration. + * + * @return the destinationsConfiguration value. + */ + public DestinationsConfiguration destinationsConfiguration() { + return this.destinationsConfiguration; + } + + /** + * Set the destinationsConfiguration property: Open telemetry destinations configuration. + * + * @param destinationsConfiguration the destinationsConfiguration value to set. + * @return the OpenTelemetryConfiguration object itself. + */ + public OpenTelemetryConfiguration + withDestinationsConfiguration(DestinationsConfiguration destinationsConfiguration) { + this.destinationsConfiguration = destinationsConfiguration; + return this; + } + + /** + * Get the tracesConfiguration property: Open telemetry trace configuration. + * + * @return the tracesConfiguration value. + */ + public TracesConfiguration tracesConfiguration() { + return this.tracesConfiguration; + } + + /** + * Set the tracesConfiguration property: Open telemetry trace configuration. + * + * @param tracesConfiguration the tracesConfiguration value to set. + * @return the OpenTelemetryConfiguration object itself. + */ + public OpenTelemetryConfiguration withTracesConfiguration(TracesConfiguration tracesConfiguration) { + this.tracesConfiguration = tracesConfiguration; + return this; + } + + /** + * Get the logsConfiguration property: Open telemetry logs configuration. + * + * @return the logsConfiguration value. + */ + public LogsConfiguration logsConfiguration() { + return this.logsConfiguration; + } + + /** + * Set the logsConfiguration property: Open telemetry logs configuration. + * + * @param logsConfiguration the logsConfiguration value to set. + * @return the OpenTelemetryConfiguration object itself. + */ + public OpenTelemetryConfiguration withLogsConfiguration(LogsConfiguration logsConfiguration) { + this.logsConfiguration = logsConfiguration; + return this; + } + + /** + * Get the metricsConfiguration property: Open telemetry metrics configuration. + * + * @return the metricsConfiguration value. + */ + public MetricsConfiguration metricsConfiguration() { + return this.metricsConfiguration; + } + + /** + * Set the metricsConfiguration property: Open telemetry metrics configuration. + * + * @param metricsConfiguration the metricsConfiguration value to set. + * @return the OpenTelemetryConfiguration object itself. + */ + public OpenTelemetryConfiguration withMetricsConfiguration(MetricsConfiguration metricsConfiguration) { + this.metricsConfiguration = metricsConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (destinationsConfiguration() != null) { + destinationsConfiguration().validate(); + } + if (tracesConfiguration() != null) { + tracesConfiguration().validate(); + } + if (logsConfiguration() != null) { + logsConfiguration().validate(); + } + if (metricsConfiguration() != null) { + metricsConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("destinationsConfiguration", this.destinationsConfiguration); + jsonWriter.writeJsonField("tracesConfiguration", this.tracesConfiguration); + jsonWriter.writeJsonField("logsConfiguration", this.logsConfiguration); + jsonWriter.writeJsonField("metricsConfiguration", this.metricsConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OpenTelemetryConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OpenTelemetryConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OpenTelemetryConfiguration. + */ + public static OpenTelemetryConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OpenTelemetryConfiguration deserializedOpenTelemetryConfiguration = new OpenTelemetryConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("destinationsConfiguration".equals(fieldName)) { + deserializedOpenTelemetryConfiguration.destinationsConfiguration + = DestinationsConfiguration.fromJson(reader); + } else if ("tracesConfiguration".equals(fieldName)) { + deserializedOpenTelemetryConfiguration.tracesConfiguration = TracesConfiguration.fromJson(reader); + } else if ("logsConfiguration".equals(fieldName)) { + deserializedOpenTelemetryConfiguration.logsConfiguration = LogsConfiguration.fromJson(reader); + } else if ("metricsConfiguration".equals(fieldName)) { + deserializedOpenTelemetryConfiguration.metricsConfiguration = MetricsConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOpenTelemetryConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OtlpConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OtlpConfiguration.java new file mode 100644 index 0000000000000..019c556544f5e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OtlpConfiguration.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Configuration of otlp. + */ +@Fluent +public final class OtlpConfiguration implements JsonSerializable { + /* + * The name of otlp configuration + */ + private String name; + + /* + * The endpoint of otlp configuration + */ + private String endpoint; + + /* + * Boolean indicating if otlp configuration is insecure + */ + private Boolean insecure; + + /* + * Headers of otlp configurations + */ + private List
headers; + + /** + * Creates an instance of OtlpConfiguration class. + */ + public OtlpConfiguration() { + } + + /** + * Get the name property: The name of otlp configuration. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of otlp configuration. + * + * @param name the name value to set. + * @return the OtlpConfiguration object itself. + */ + public OtlpConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the endpoint property: The endpoint of otlp configuration. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint property: The endpoint of otlp configuration. + * + * @param endpoint the endpoint value to set. + * @return the OtlpConfiguration object itself. + */ + public OtlpConfiguration withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get the insecure property: Boolean indicating if otlp configuration is insecure. + * + * @return the insecure value. + */ + public Boolean insecure() { + return this.insecure; + } + + /** + * Set the insecure property: Boolean indicating if otlp configuration is insecure. + * + * @param insecure the insecure value to set. + * @return the OtlpConfiguration object itself. + */ + public OtlpConfiguration withInsecure(Boolean insecure) { + this.insecure = insecure; + return this; + } + + /** + * Get the headers property: Headers of otlp configurations. + * + * @return the headers value. + */ + public List
headers() { + return this.headers; + } + + /** + * Set the headers property: Headers of otlp configurations. + * + * @param headers the headers value to set. + * @return the OtlpConfiguration object itself. + */ + public OtlpConfiguration withHeaders(List
headers) { + this.headers = headers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (headers() != null) { + headers().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("endpoint", this.endpoint); + jsonWriter.writeBooleanField("insecure", this.insecure); + jsonWriter.writeArrayField("headers", this.headers, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OtlpConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OtlpConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OtlpConfiguration. + */ + public static OtlpConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OtlpConfiguration deserializedOtlpConfiguration = new OtlpConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOtlpConfiguration.name = reader.getString(); + } else if ("endpoint".equals(fieldName)) { + deserializedOtlpConfiguration.endpoint = reader.getString(); + } else if ("insecure".equals(fieldName)) { + deserializedOtlpConfiguration.insecure = reader.getNullable(JsonReader::getBoolean); + } else if ("headers".equals(fieldName)) { + List
headers = reader.readArray(reader1 -> Header.fromJson(reader1)); + deserializedOtlpConfiguration.headers = headers; + } else { + reader.skipChildren(); + } + } + + return deserializedOtlpConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchApplyStatus.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchApplyStatus.java new file mode 100644 index 0000000000000..4b830fda01be3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchApplyStatus.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of the patch once it has been provisioned. + */ +public final class PatchApplyStatus extends ExpandableStringEnum { + /** + * Static value NotStarted for PatchApplyStatus. + */ + public static final PatchApplyStatus NOT_STARTED = fromString("NotStarted"); + + /** + * Static value RebaseInProgress for PatchApplyStatus. + */ + public static final PatchApplyStatus REBASE_IN_PROGRESS = fromString("RebaseInProgress"); + + /** + * Static value CreatingRevision for PatchApplyStatus. + */ + public static final PatchApplyStatus CREATING_REVISION = fromString("CreatingRevision"); + + /** + * Static value Succeeded for PatchApplyStatus. + */ + public static final PatchApplyStatus SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Canceled for PatchApplyStatus. + */ + public static final PatchApplyStatus CANCELED = fromString("Canceled"); + + /** + * Static value RebaseFailed for PatchApplyStatus. + */ + public static final PatchApplyStatus REBASE_FAILED = fromString("RebaseFailed"); + + /** + * Static value RevisionCreationFailed for PatchApplyStatus. + */ + public static final PatchApplyStatus REVISION_CREATION_FAILED = fromString("RevisionCreationFailed"); + + /** + * Static value ImagePushPullFailed for PatchApplyStatus. + */ + public static final PatchApplyStatus IMAGE_PUSH_PULL_FAILED = fromString("ImagePushPullFailed"); + + /** + * Static value ManuallySkipped for PatchApplyStatus. + */ + public static final PatchApplyStatus MANUALLY_SKIPPED = fromString("ManuallySkipped"); + + /** + * Creates a new instance of PatchApplyStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PatchApplyStatus() { + } + + /** + * Creates or finds a PatchApplyStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PatchApplyStatus. + */ + public static PatchApplyStatus fromString(String name) { + return fromString(name, PatchApplyStatus.class); + } + + /** + * Gets known PatchApplyStatus values. + * + * @return known PatchApplyStatus values. + */ + public static Collection values() { + return values(PatchApplyStatus.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchCollection.java new file mode 100644 index 0000000000000..ec63e8b856c8e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchCollection.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsPatchResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * Container App patch collection. + */ +@Fluent +public final class PatchCollection implements JsonSerializable { + /* + * Collection of patch resources. + */ + private List value; + + /* + * the link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of PatchCollection class. + */ + public PatchCollection() { + } + + /** + * Get the value property: Collection of patch resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of patch resources. + * + * @param value the value value to set. + * @return the PatchCollection object itself. + */ + public PatchCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: the link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: the link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the PatchCollection object itself. + */ + public PatchCollection withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model PatchCollection")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PatchCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatchCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatchCollection if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PatchCollection. + */ + public static PatchCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PatchCollection deserializedPatchCollection = new PatchCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ContainerAppsPatchResourceInner.fromJson(reader1)); + deserializedPatchCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPatchCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPatchCollection; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchDetails.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchDetails.java new file mode 100644 index 0000000000000..9f75361355744 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchDetails.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The detailed info of patch operation performing when applying a patch. + */ +@Immutable +public final class PatchDetails implements JsonSerializable { + /* + * The name of the target container for the patch. + */ + private String targetContainerName; + + /* + * The name of the target image for the patch. + */ + private String targetImage; + + /* + * The UTC timestamp that describes the latest detection was done. + */ + private OffsetDateTime lastDetectionTime; + + /* + * The status of the patch detection. + */ + private DetectionStatus detectionStatus; + + /* + * The name of the new image created by the patch. + */ + private String newImageName; + + /* + * New layer update details in the target image. + */ + private PatchDetailsNewLayer newLayer; + + /* + * The old layer details in the target image. + */ + private PatchDetailsOldLayer oldLayer; + + /* + * The type for the patch. + */ + private PatchType patchType; + + /** + * Creates an instance of PatchDetails class. + */ + public PatchDetails() { + } + + /** + * Get the targetContainerName property: The name of the target container for the patch. + * + * @return the targetContainerName value. + */ + public String targetContainerName() { + return this.targetContainerName; + } + + /** + * Get the targetImage property: The name of the target image for the patch. + * + * @return the targetImage value. + */ + public String targetImage() { + return this.targetImage; + } + + /** + * Get the lastDetectionTime property: The UTC timestamp that describes the latest detection was done. + * + * @return the lastDetectionTime value. + */ + public OffsetDateTime lastDetectionTime() { + return this.lastDetectionTime; + } + + /** + * Get the detectionStatus property: The status of the patch detection. + * + * @return the detectionStatus value. + */ + public DetectionStatus detectionStatus() { + return this.detectionStatus; + } + + /** + * Get the newImageName property: The name of the new image created by the patch. + * + * @return the newImageName value. + */ + public String newImageName() { + return this.newImageName; + } + + /** + * Get the newLayer property: New layer update details in the target image. + * + * @return the newLayer value. + */ + public PatchDetailsNewLayer newLayer() { + return this.newLayer; + } + + /** + * Get the oldLayer property: The old layer details in the target image. + * + * @return the oldLayer value. + */ + public PatchDetailsOldLayer oldLayer() { + return this.oldLayer; + } + + /** + * Get the patchType property: The type for the patch. + * + * @return the patchType value. + */ + public PatchType patchType() { + return this.patchType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (newLayer() != null) { + newLayer().validate(); + } + if (oldLayer() != null) { + oldLayer().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatchDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatchDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PatchDetails. + */ + public static PatchDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PatchDetails deserializedPatchDetails = new PatchDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetContainerName".equals(fieldName)) { + deserializedPatchDetails.targetContainerName = reader.getString(); + } else if ("targetImage".equals(fieldName)) { + deserializedPatchDetails.targetImage = reader.getString(); + } else if ("lastDetectionTime".equals(fieldName)) { + deserializedPatchDetails.lastDetectionTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("detectionStatus".equals(fieldName)) { + deserializedPatchDetails.detectionStatus = DetectionStatus.fromString(reader.getString()); + } else if ("newImageName".equals(fieldName)) { + deserializedPatchDetails.newImageName = reader.getString(); + } else if ("newLayer".equals(fieldName)) { + deserializedPatchDetails.newLayer = PatchDetailsNewLayer.fromJson(reader); + } else if ("oldLayer".equals(fieldName)) { + deserializedPatchDetails.oldLayer = PatchDetailsOldLayer.fromJson(reader); + } else if ("patchType".equals(fieldName)) { + deserializedPatchDetails.patchType = PatchType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPatchDetails; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchDetailsNewLayer.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchDetailsNewLayer.java new file mode 100644 index 0000000000000..0e6f2b59cab2b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchDetailsNewLayer.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * New layer update details in the target image. + */ +@Fluent +public final class PatchDetailsNewLayer implements JsonSerializable { + /* + * The details of the new layer for the target image. + */ + private String name; + + /* + * The framework and its version in the new run image for the target image. + */ + private String frameworkAndVersion; + + /* + * The OS name and its version in the new run image for the target image. + */ + private String osAndVersion; + + /** + * Creates an instance of PatchDetailsNewLayer class. + */ + public PatchDetailsNewLayer() { + } + + /** + * Get the name property: The details of the new layer for the target image. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The details of the new layer for the target image. + * + * @param name the name value to set. + * @return the PatchDetailsNewLayer object itself. + */ + public PatchDetailsNewLayer withName(String name) { + this.name = name; + return this; + } + + /** + * Get the frameworkAndVersion property: The framework and its version in the new run image for the target image. + * + * @return the frameworkAndVersion value. + */ + public String frameworkAndVersion() { + return this.frameworkAndVersion; + } + + /** + * Set the frameworkAndVersion property: The framework and its version in the new run image for the target image. + * + * @param frameworkAndVersion the frameworkAndVersion value to set. + * @return the PatchDetailsNewLayer object itself. + */ + public PatchDetailsNewLayer withFrameworkAndVersion(String frameworkAndVersion) { + this.frameworkAndVersion = frameworkAndVersion; + return this; + } + + /** + * Get the osAndVersion property: The OS name and its version in the new run image for the target image. + * + * @return the osAndVersion value. + */ + public String osAndVersion() { + return this.osAndVersion; + } + + /** + * Set the osAndVersion property: The OS name and its version in the new run image for the target image. + * + * @param osAndVersion the osAndVersion value to set. + * @return the PatchDetailsNewLayer object itself. + */ + public PatchDetailsNewLayer withOsAndVersion(String osAndVersion) { + this.osAndVersion = osAndVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("frameworkAndVersion", this.frameworkAndVersion); + jsonWriter.writeStringField("osAndVersion", this.osAndVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatchDetailsNewLayer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatchDetailsNewLayer if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the PatchDetailsNewLayer. + */ + public static PatchDetailsNewLayer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PatchDetailsNewLayer deserializedPatchDetailsNewLayer = new PatchDetailsNewLayer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPatchDetailsNewLayer.name = reader.getString(); + } else if ("frameworkAndVersion".equals(fieldName)) { + deserializedPatchDetailsNewLayer.frameworkAndVersion = reader.getString(); + } else if ("osAndVersion".equals(fieldName)) { + deserializedPatchDetailsNewLayer.osAndVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPatchDetailsNewLayer; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchDetailsOldLayer.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchDetailsOldLayer.java new file mode 100644 index 0000000000000..f67ae64e7ec55 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchDetailsOldLayer.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The old layer details in the target image. + */ +@Fluent +public final class PatchDetailsOldLayer implements JsonSerializable { + /* + * The details of the old layer for the target image. + */ + private String name; + + /* + * The framework and its version in the old run image for the target image. + */ + private String frameworkAndVersion; + + /* + * The OS name and its version in the old run image for the target image. + */ + private String osAndVersion; + + /** + * Creates an instance of PatchDetailsOldLayer class. + */ + public PatchDetailsOldLayer() { + } + + /** + * Get the name property: The details of the old layer for the target image. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The details of the old layer for the target image. + * + * @param name the name value to set. + * @return the PatchDetailsOldLayer object itself. + */ + public PatchDetailsOldLayer withName(String name) { + this.name = name; + return this; + } + + /** + * Get the frameworkAndVersion property: The framework and its version in the old run image for the target image. + * + * @return the frameworkAndVersion value. + */ + public String frameworkAndVersion() { + return this.frameworkAndVersion; + } + + /** + * Set the frameworkAndVersion property: The framework and its version in the old run image for the target image. + * + * @param frameworkAndVersion the frameworkAndVersion value to set. + * @return the PatchDetailsOldLayer object itself. + */ + public PatchDetailsOldLayer withFrameworkAndVersion(String frameworkAndVersion) { + this.frameworkAndVersion = frameworkAndVersion; + return this; + } + + /** + * Get the osAndVersion property: The OS name and its version in the old run image for the target image. + * + * @return the osAndVersion value. + */ + public String osAndVersion() { + return this.osAndVersion; + } + + /** + * Set the osAndVersion property: The OS name and its version in the old run image for the target image. + * + * @param osAndVersion the osAndVersion value to set. + * @return the PatchDetailsOldLayer object itself. + */ + public PatchDetailsOldLayer withOsAndVersion(String osAndVersion) { + this.osAndVersion = osAndVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("frameworkAndVersion", this.frameworkAndVersion); + jsonWriter.writeStringField("osAndVersion", this.osAndVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatchDetailsOldLayer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatchDetailsOldLayer if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the PatchDetailsOldLayer. + */ + public static PatchDetailsOldLayer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PatchDetailsOldLayer deserializedPatchDetailsOldLayer = new PatchDetailsOldLayer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPatchDetailsOldLayer.name = reader.getString(); + } else if ("frameworkAndVersion".equals(fieldName)) { + deserializedPatchDetailsOldLayer.frameworkAndVersion = reader.getString(); + } else if ("osAndVersion".equals(fieldName)) { + deserializedPatchDetailsOldLayer.osAndVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPatchDetailsOldLayer; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchProperties.java new file mode 100644 index 0000000000000..42bd0ccf9f07f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchProperties.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Top level properties that describes current states of the patch resource. + */ +@Fluent +public final class PatchProperties implements JsonSerializable { + /* + * The Azure resource id of the target environment for the patch. + */ + private String targetEnvironmentId; + + /* + * The Azure resource id of the target container app for the patch. + */ + private String targetContainerAppId; + + /* + * The Azure resource id of the target revision for the patch. + */ + private String targetRevisionId; + + /* + * The status of the patch operation. + */ + private PatchApplyStatus patchApplyStatus; + + /* + * The UTC timestamp that describes when the patch object was created. + */ + private OffsetDateTime createdAt; + + /* + * The UTC timestamp that describes when the patch object was last updated. + */ + private OffsetDateTime lastModifiedAt; + + /* + * Detailed info describes the patch operation for the target container app. + */ + private List patchDetails; + + /** + * Creates an instance of PatchProperties class. + */ + public PatchProperties() { + } + + /** + * Get the targetEnvironmentId property: The Azure resource id of the target environment for the patch. + * + * @return the targetEnvironmentId value. + */ + public String targetEnvironmentId() { + return this.targetEnvironmentId; + } + + /** + * Set the targetEnvironmentId property: The Azure resource id of the target environment for the patch. + * + * @param targetEnvironmentId the targetEnvironmentId value to set. + * @return the PatchProperties object itself. + */ + public PatchProperties withTargetEnvironmentId(String targetEnvironmentId) { + this.targetEnvironmentId = targetEnvironmentId; + return this; + } + + /** + * Get the targetContainerAppId property: The Azure resource id of the target container app for the patch. + * + * @return the targetContainerAppId value. + */ + public String targetContainerAppId() { + return this.targetContainerAppId; + } + + /** + * Set the targetContainerAppId property: The Azure resource id of the target container app for the patch. + * + * @param targetContainerAppId the targetContainerAppId value to set. + * @return the PatchProperties object itself. + */ + public PatchProperties withTargetContainerAppId(String targetContainerAppId) { + this.targetContainerAppId = targetContainerAppId; + return this; + } + + /** + * Get the targetRevisionId property: The Azure resource id of the target revision for the patch. + * + * @return the targetRevisionId value. + */ + public String targetRevisionId() { + return this.targetRevisionId; + } + + /** + * Set the targetRevisionId property: The Azure resource id of the target revision for the patch. + * + * @param targetRevisionId the targetRevisionId value to set. + * @return the PatchProperties object itself. + */ + public PatchProperties withTargetRevisionId(String targetRevisionId) { + this.targetRevisionId = targetRevisionId; + return this; + } + + /** + * Get the patchApplyStatus property: The status of the patch operation. + * + * @return the patchApplyStatus value. + */ + public PatchApplyStatus patchApplyStatus() { + return this.patchApplyStatus; + } + + /** + * Get the createdAt property: The UTC timestamp that describes when the patch object was created. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the lastModifiedAt property: The UTC timestamp that describes when the patch object was last updated. + * + * @return the lastModifiedAt value. + */ + public OffsetDateTime lastModifiedAt() { + return this.lastModifiedAt; + } + + /** + * Get the patchDetails property: Detailed info describes the patch operation for the target container app. + * + * @return the patchDetails value. + */ + public List patchDetails() { + return this.patchDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (patchDetails() != null) { + patchDetails().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetEnvironmentId", this.targetEnvironmentId); + jsonWriter.writeStringField("targetContainerAppId", this.targetContainerAppId); + jsonWriter.writeStringField("targetRevisionId", this.targetRevisionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatchProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PatchProperties. + */ + public static PatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PatchProperties deserializedPatchProperties = new PatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetEnvironmentId".equals(fieldName)) { + deserializedPatchProperties.targetEnvironmentId = reader.getString(); + } else if ("targetContainerAppId".equals(fieldName)) { + deserializedPatchProperties.targetContainerAppId = reader.getString(); + } else if ("targetRevisionId".equals(fieldName)) { + deserializedPatchProperties.targetRevisionId = reader.getString(); + } else if ("patchApplyStatus".equals(fieldName)) { + deserializedPatchProperties.patchApplyStatus = PatchApplyStatus.fromString(reader.getString()); + } else if ("createdAt".equals(fieldName)) { + deserializedPatchProperties.createdAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedAt".equals(fieldName)) { + deserializedPatchProperties.lastModifiedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("patchDetails".equals(fieldName)) { + List patchDetails = reader.readArray(reader1 -> PatchDetails.fromJson(reader1)); + deserializedPatchProperties.patchDetails = patchDetails; + } else { + reader.skipChildren(); + } + } + + return deserializedPatchProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchSkipConfig.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchSkipConfig.java new file mode 100644 index 0000000000000..8d8868383d617 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchSkipConfig.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The configuration for patcher to skip a patch or not. + */ +@Fluent +public final class PatchSkipConfig implements JsonSerializable { + /* + * The flag to indicate whether to skip the patch or not. + */ + private Boolean skip; + + /** + * Creates an instance of PatchSkipConfig class. + */ + public PatchSkipConfig() { + } + + /** + * Get the skip property: The flag to indicate whether to skip the patch or not. + * + * @return the skip value. + */ + public Boolean skip() { + return this.skip; + } + + /** + * Set the skip property: The flag to indicate whether to skip the patch or not. + * + * @param skip the skip value to set. + * @return the PatchSkipConfig object itself. + */ + public PatchSkipConfig withSkip(Boolean skip) { + this.skip = skip; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("skip", this.skip); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatchSkipConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatchSkipConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PatchSkipConfig. + */ + public static PatchSkipConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PatchSkipConfig deserializedPatchSkipConfig = new PatchSkipConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("skip".equals(fieldName)) { + deserializedPatchSkipConfig.skip = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedPatchSkipConfig; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchType.java new file mode 100644 index 0000000000000..3ee6cd1a3fd48 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type for the patch. + */ +public final class PatchType extends ExpandableStringEnum { + /** + * Static value FrameworkSecurity for PatchType. + */ + public static final PatchType FRAMEWORK_SECURITY = fromString("FrameworkSecurity"); + + /** + * Static value OSSecurity for PatchType. + */ + public static final PatchType OSSECURITY = fromString("OSSecurity"); + + /** + * Static value FrameworkAndOSSecurity for PatchType. + */ + public static final PatchType FRAMEWORK_AND_OSSECURITY = fromString("FrameworkAndOSSecurity"); + + /** + * Static value Other for PatchType. + */ + public static final PatchType OTHER = fromString("Other"); + + /** + * Creates a new instance of PatchType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PatchType() { + } + + /** + * Creates or finds a PatchType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PatchType. + */ + public static PatchType fromString(String name) { + return fromString(name, PatchType.class); + } + + /** + * Gets known PatchType values. + * + * @return known PatchType values. + */ + public static Collection values() { + return values(PatchType.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchingMode.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchingMode.java new file mode 100644 index 0000000000000..f2f90e3e09567 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PatchingMode.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Patching mode for the container app. Null or default in this field will be interpreted as Automatic by RP. Automatic + * mode will automatically apply available patches. Manual mode will require the user to manually apply patches. + * Disabled mode will stop patch detection and auto patching. + */ +public final class PatchingMode extends ExpandableStringEnum { + /** + * Static value Automatic for PatchingMode. + */ + public static final PatchingMode AUTOMATIC = fromString("Automatic"); + + /** + * Static value Manual for PatchingMode. + */ + public static final PatchingMode MANUAL = fromString("Manual"); + + /** + * Static value Disabled for PatchingMode. + */ + public static final PatchingMode DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of PatchingMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PatchingMode() { + } + + /** + * Creates or finds a PatchingMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding PatchingMode. + */ + public static PatchingMode fromString(String name) { + return fromString(name, PatchingMode.class); + } + + /** + * Gets known PatchingMode values. + * + * @return known PatchingMode values. + */ + public static Collection values() { + return values(PatchingMode.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PoolManagementType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PoolManagementType.java new file mode 100644 index 0000000000000..a7c307747cd0b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PoolManagementType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The pool management type of the session pool. + */ +public final class PoolManagementType extends ExpandableStringEnum { + /** + * Static value Manual for PoolManagementType. + */ + public static final PoolManagementType MANUAL = fromString("Manual"); + + /** + * Static value Dynamic for PoolManagementType. + */ + public static final PoolManagementType DYNAMIC = fromString("Dynamic"); + + /** + * Creates a new instance of PoolManagementType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PoolManagementType() { + } + + /** + * Creates or finds a PoolManagementType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PoolManagementType. + */ + public static PoolManagementType fromString(String name) { + return fromString(name, PoolManagementType.class); + } + + /** + * Gets known PoolManagementType values. + * + * @return known PoolManagementType values. + */ + public static Collection values() { + return values(PoolManagementType.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PreBuildStep.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PreBuildStep.java new file mode 100644 index 0000000000000..cfc480dae4f89 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PreBuildStep.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Model representing a pre-build step. + */ +@Fluent +public final class PreBuildStep implements JsonSerializable { + /* + * Description of the pre-build step. + */ + private String description; + + /* + * List of custom commands to run. + */ + private List scripts; + + /* + * Http get request to send before the build. + */ + private HttpGet httpGet; + + /** + * Creates an instance of PreBuildStep class. + */ + public PreBuildStep() { + } + + /** + * Get the description property: Description of the pre-build step. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the pre-build step. + * + * @param description the description value to set. + * @return the PreBuildStep object itself. + */ + public PreBuildStep withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the scripts property: List of custom commands to run. + * + * @return the scripts value. + */ + public List scripts() { + return this.scripts; + } + + /** + * Set the scripts property: List of custom commands to run. + * + * @param scripts the scripts value to set. + * @return the PreBuildStep object itself. + */ + public PreBuildStep withScripts(List scripts) { + this.scripts = scripts; + return this; + } + + /** + * Get the httpGet property: Http get request to send before the build. + * + * @return the httpGet value. + */ + public HttpGet httpGet() { + return this.httpGet; + } + + /** + * Set the httpGet property: Http get request to send before the build. + * + * @param httpGet the httpGet value to set. + * @return the PreBuildStep object itself. + */ + public PreBuildStep withHttpGet(HttpGet httpGet) { + this.httpGet = httpGet; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (httpGet() != null) { + httpGet().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("scripts", this.scripts, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("httpGet", this.httpGet); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PreBuildStep from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PreBuildStep if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PreBuildStep. + */ + public static PreBuildStep fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PreBuildStep deserializedPreBuildStep = new PreBuildStep(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedPreBuildStep.description = reader.getString(); + } else if ("scripts".equals(fieldName)) { + List scripts = reader.readArray(reader1 -> reader1.getString()); + deserializedPreBuildStep.scripts = scripts; + } else if ("httpGet".equals(fieldName)) { + deserializedPreBuildStep.httpGet = HttpGet.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPreBuildStep; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpoint.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..93625e4abf739 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpoint.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Private Endpoint resource. + */ +@Immutable +public final class PrivateEndpoint implements JsonSerializable { + /* + * The ARM identifier for Private Endpoint + */ + private String id; + + /** + * Creates an instance of PrivateEndpoint class. + */ + public PrivateEndpoint() { + } + + /** + * Get the id property: The ARM identifier for Private Endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpoint if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpoint. + */ + public static PrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpoint deserializedPrivateEndpoint = new PrivateEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpoint.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpoint; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointConnection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..d0cd177423c34 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointConnection.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateEndpointConnectionInner; +import java.util.List; + +/** + * An immutable client-side representation of PrivateEndpointConnection. + */ +public interface PrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + List groupIds(); + + /** + * Gets the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the + * connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + PrivateEndpointConnectionProvisioningState provisioningState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.PrivateEndpointConnectionInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); + + /** + * The entirety of the PrivateEndpointConnection definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The PrivateEndpointConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the PrivateEndpointConnection definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, environmentName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @return the next definition stage. + */ + WithCreate withExistingManagedEnvironment(String resourceGroupName, String environmentName); + } + + /** + * The stage of the PrivateEndpointConnection definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnection create(Context context); + } + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The resource of private end point.. + * + * @param privateEndpoint The resource of private end point. + * @return the next definition stage. + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + + /** + * Begins update for the PrivateEndpointConnection resource. + * + * @return the stage of resource update. + */ + PrivateEndpointConnection.Update update(); + + /** + * The template for PrivateEndpointConnection update. + */ + interface Update extends UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateEndpointConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateEndpointConnection apply(Context context); + } + + /** + * The PrivateEndpointConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The resource of private end point.. + * + * @param privateEndpoint The resource of private end point. + * @return the next definition stage. + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + Update withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointConnectionListResult.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 0000000000000..75d88ee3d0b96 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateEndpointConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * List of private endpoint connection associated with the specified resource. + */ +@Fluent +public final class PrivateEndpointConnectionListResult + implements JsonSerializable { + /* + * Array of private endpoint connections + */ + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + private String nextLink; + + /** + * Creates an instance of PrivateEndpointConnectionListResult class. + */ + public PrivateEndpointConnectionListResult() { + } + + /** + * Get the value property: Array of private endpoint connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private endpoint connections. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionListResult. + */ + public static PrivateEndpointConnectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionListResult deserializedPrivateEndpointConnectionListResult + = new PrivateEndpointConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedPrivateEndpointConnectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateEndpointConnectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionListResult; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointConnectionProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 0000000000000..8f010fe26dd4b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current provisioning state. + */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** + * Static value Succeeded for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Waiting for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState WAITING = fromString("Waiting"); + + /** + * Static value Updating for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Pending for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState PENDING = fromString("Pending"); + + /** + * Creates a new instance of PrivateEndpointConnectionProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointConnectionProvisioningState() { + } + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionProvisioningState. + */ + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** + * Gets known PrivateEndpointConnectionProvisioningState values. + * + * @return known PrivateEndpointConnectionProvisioningState values. + */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointServiceConnectionStatus.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 0000000000000..b56460c10ee87 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointServiceConnectionStatus.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The private endpoint connection status. + */ +public final class PrivateEndpointServiceConnectionStatus + extends ExpandableStringEnum { + /** + * Static value Pending for PrivateEndpointServiceConnectionStatus. + */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** + * Static value Approved for PrivateEndpointServiceConnectionStatus. + */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** + * Static value Rejected for PrivateEndpointServiceConnectionStatus. + */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Static value Disconnected for PrivateEndpointServiceConnectionStatus. + */ + public static final PrivateEndpointServiceConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates a new instance of PrivateEndpointServiceConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointServiceConnectionStatus() { + } + + /** + * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointServiceConnectionStatus. + */ + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** + * Gets known PrivateEndpointServiceConnectionStatus values. + * + * @return known PrivateEndpointServiceConnectionStatus values. + */ + public static Collection values() { + return values(PrivateEndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateLinkResource.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateLinkResource.java new file mode 100644 index 0000000000000..43ea727b07d34 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateLinkResource.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateLinkResourceInner; +import java.util.List; + +/** + * An immutable client-side representation of PrivateLinkResource. + */ +public interface PrivateLinkResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + String groupId(); + + /** + * Gets the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + List requiredMembers(); + + /** + * Gets the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + List requiredZoneNames(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.PrivateLinkResourceInner object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateLinkResourceListResult.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateLinkResourceListResult.java new file mode 100644 index 0000000000000..c6e6c7160c7c5 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateLinkResourceListResult.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateLinkResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of private link resources. + */ +@Fluent +public final class PrivateLinkResourceListResult implements JsonSerializable { + /* + * Array of private link resources + */ + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + private String nextLink; + + /** + * Creates an instance of PrivateLinkResourceListResult class. + */ + public PrivateLinkResourceListResult() { + } + + /** + * Get the value property: Array of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private link resources. + * + * @param value the value value to set. + * @return the PrivateLinkResourceListResult object itself. + */ + public PrivateLinkResourceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourceListResult. + */ + public static PrivateLinkResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceListResult deserializedPrivateLinkResourceListResult + = new PrivateLinkResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateLinkResourceInner.fromJson(reader1)); + deserializedPrivateLinkResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateLinkResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceListResult; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateLinkServiceConnectionState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..0c31b2ae3d9ce --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A collection of information about the state of the connection between service consumer and provider. + */ +@Fluent +public final class PrivateLinkServiceConnectionState implements JsonSerializable { + /* + * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + */ + private PrivateEndpointServiceConnectionStatus status; + + /* + * The reason for approval/rejection of the connection. + */ + private String description; + + /* + * A message indicating if changes on the service provider require any updates on the consumer. + */ + private String actionsRequired; + + /** + * Creates an instance of PrivateLinkServiceConnectionState class. + */ + public PrivateLinkServiceConnectionState() { + } + + /** + * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @return the status value. + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval/rejection of the connection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionsRequired the actionsRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("actionsRequired", this.actionsRequired); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceConnectionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceConnectionState if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkServiceConnectionState. + */ + public static PrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceConnectionState deserializedPrivateLinkServiceConnectionState + = new PrivateLinkServiceConnectionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.status + = PrivateEndpointServiceConnectionStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.description = reader.getString(); + } else if ("actionsRequired".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.actionsRequired = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceConnectionState; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PublicNetworkAccess.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PublicNetworkAccess.java new file mode 100644 index 0000000000000..0dacf1daad397 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PublicNetworkAccess.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Property to allow or block all public traffic. Allowed Values: 'Enabled', 'Disabled'. + */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** + * Static value Enabled for PublicNetworkAccess. + */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for PublicNetworkAccess. + */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of PublicNetworkAccess value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicNetworkAccess() { + } + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccess. + */ + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** + * Gets known PublicNetworkAccess values. + * + * @return known PublicNetworkAccess values. + */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/QueueScaleRule.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/QueueScaleRule.java index db2be3646f480..207032b0546cd 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/QueueScaleRule.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/QueueScaleRule.java @@ -17,6 +17,11 @@ */ @Fluent public final class QueueScaleRule implements JsonSerializable { + /* + * Storage account name. required if using managed identity to authenticate + */ + private String accountName; + /* * Queue name. */ @@ -32,12 +37,38 @@ public final class QueueScaleRule implements JsonSerializable { */ private List auth; + /* + * The resource ID of a user-assigned managed identity that is assigned to the Container App, or 'system' for + * system-assigned identity. + */ + private String identity; + /** * Creates an instance of QueueScaleRule class. */ public QueueScaleRule() { } + /** + * Get the accountName property: Storage account name. required if using managed identity to authenticate. + * + * @return the accountName value. + */ + public String accountName() { + return this.accountName; + } + + /** + * Set the accountName property: Storage account name. required if using managed identity to authenticate. + * + * @param accountName the accountName value to set. + * @return the QueueScaleRule object itself. + */ + public QueueScaleRule withAccountName(String accountName) { + this.accountName = accountName; + return this; + } + /** * Get the queueName property: Queue name. * @@ -98,6 +129,28 @@ public QueueScaleRule withAuth(List auth) { return this; } + /** + * Get the identity property: The resource ID of a user-assigned managed identity that is assigned to the Container + * App, or 'system' for system-assigned identity. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: The resource ID of a user-assigned managed identity that is assigned to the Container + * App, or 'system' for system-assigned identity. + * + * @param identity the identity value to set. + * @return the QueueScaleRule object itself. + */ + public QueueScaleRule withIdentity(String identity) { + this.identity = identity; + return this; + } + /** * Validates the instance. * @@ -115,9 +168,11 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accountName", this.accountName); jsonWriter.writeStringField("queueName", this.queueName); jsonWriter.writeNumberField("queueLength", this.queueLength); jsonWriter.writeArrayField("auth", this.auth, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -136,13 +191,17 @@ public static QueueScaleRule fromJson(JsonReader jsonReader) throws IOException String fieldName = reader.getFieldName(); reader.nextToken(); - if ("queueName".equals(fieldName)) { + if ("accountName".equals(fieldName)) { + deserializedQueueScaleRule.accountName = reader.getString(); + } else if ("queueName".equals(fieldName)) { deserializedQueueScaleRule.queueName = reader.getString(); } else if ("queueLength".equals(fieldName)) { deserializedQueueScaleRule.queueLength = reader.getNullable(JsonReader::getInt); } else if ("auth".equals(fieldName)) { List auth = reader.readArray(reader1 -> ScaleRuleAuth.fromJson(reader1)); deserializedQueueScaleRule.auth = auth; + } else if ("identity".equals(fieldName)) { + deserializedQueueScaleRule.identity = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ReplicaContainer.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ReplicaContainer.java index 7e6a12306caa1..28823652940ec 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ReplicaContainer.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ReplicaContainer.java @@ -61,6 +61,11 @@ public final class ReplicaContainer implements JsonSerializable { + /* + * Replica Name. + */ + private String name; + + /* + * Containers in the execution replica + */ + private List containers; + + /** + * Creates an instance of ReplicaExecutionStatus class. + */ + public ReplicaExecutionStatus() { + } + + /** + * Get the name property: Replica Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Replica Name. + * + * @param name the name value to set. + * @return the ReplicaExecutionStatus object itself. + */ + public ReplicaExecutionStatus withName(String name) { + this.name = name; + return this; + } + + /** + * Get the containers property: Containers in the execution replica. + * + * @return the containers value. + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers property: Containers in the execution replica. + * + * @param containers the containers value to set. + * @return the ReplicaExecutionStatus object itself. + */ + public ReplicaExecutionStatus withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (containers() != null) { + containers().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("containers", this.containers, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicaExecutionStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicaExecutionStatus if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReplicaExecutionStatus. + */ + public static ReplicaExecutionStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicaExecutionStatus deserializedReplicaExecutionStatus = new ReplicaExecutionStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedReplicaExecutionStatus.name = reader.getString(); + } else if ("containers".equals(fieldName)) { + List containers + = reader.readArray(reader1 -> ContainerExecutionStatus.fromJson(reader1)); + deserializedReplicaExecutionStatus.containers = containers; + } else { + reader.skipChildren(); + } + } + + return deserializedReplicaExecutionStatus; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Runtime.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Runtime.java new file mode 100644 index 0000000000000..22dc30e0dfea9 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Runtime.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Container App Runtime configuration. + */ +@Fluent +public final class Runtime implements JsonSerializable { + /* + * Java app configuration + */ + private RuntimeJava java; + + /* + * .NET app configuration + */ + private RuntimeDotnet dotnet; + + /** + * Creates an instance of Runtime class. + */ + public Runtime() { + } + + /** + * Get the java property: Java app configuration. + * + * @return the java value. + */ + public RuntimeJava java() { + return this.java; + } + + /** + * Set the java property: Java app configuration. + * + * @param java the java value to set. + * @return the Runtime object itself. + */ + public Runtime withJava(RuntimeJava java) { + this.java = java; + return this; + } + + /** + * Get the dotnet property: .NET app configuration. + * + * @return the dotnet value. + */ + public RuntimeDotnet dotnet() { + return this.dotnet; + } + + /** + * Set the dotnet property: .NET app configuration. + * + * @param dotnet the dotnet value to set. + * @return the Runtime object itself. + */ + public Runtime withDotnet(RuntimeDotnet dotnet) { + this.dotnet = dotnet; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (java() != null) { + java().validate(); + } + if (dotnet() != null) { + dotnet().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("java", this.java); + jsonWriter.writeJsonField("dotnet", this.dotnet); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Runtime from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Runtime if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Runtime. + */ + public static Runtime fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Runtime deserializedRuntime = new Runtime(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("java".equals(fieldName)) { + deserializedRuntime.java = RuntimeJava.fromJson(reader); + } else if ("dotnet".equals(fieldName)) { + deserializedRuntime.dotnet = RuntimeDotnet.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRuntime; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeDotnet.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeDotnet.java new file mode 100644 index 0000000000000..7014ac13eed64 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeDotnet.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * .NET app configuration. + */ +@Fluent +public final class RuntimeDotnet implements JsonSerializable { + /* + * Auto configure the ASP.NET Core Data Protection feature + */ + private Boolean autoConfigureDataProtection; + + /** + * Creates an instance of RuntimeDotnet class. + */ + public RuntimeDotnet() { + } + + /** + * Get the autoConfigureDataProtection property: Auto configure the ASP.NET Core Data Protection feature. + * + * @return the autoConfigureDataProtection value. + */ + public Boolean autoConfigureDataProtection() { + return this.autoConfigureDataProtection; + } + + /** + * Set the autoConfigureDataProtection property: Auto configure the ASP.NET Core Data Protection feature. + * + * @param autoConfigureDataProtection the autoConfigureDataProtection value to set. + * @return the RuntimeDotnet object itself. + */ + public RuntimeDotnet withAutoConfigureDataProtection(Boolean autoConfigureDataProtection) { + this.autoConfigureDataProtection = autoConfigureDataProtection; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("autoConfigureDataProtection", this.autoConfigureDataProtection); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuntimeDotnet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuntimeDotnet if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RuntimeDotnet. + */ + public static RuntimeDotnet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuntimeDotnet deserializedRuntimeDotnet = new RuntimeDotnet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("autoConfigureDataProtection".equals(fieldName)) { + deserializedRuntimeDotnet.autoConfigureDataProtection = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedRuntimeDotnet; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeJava.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeJava.java new file mode 100644 index 0000000000000..93e9e6efbbd2c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeJava.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Java app configuration. + */ +@Fluent +public final class RuntimeJava implements JsonSerializable { + /* + * Enable jmx core metrics for the java app + */ + private Boolean enableMetrics; + + /* + * Diagnostic capabilities achieved by java agent + */ + private RuntimeJavaAgent javaAgent; + + /** + * Creates an instance of RuntimeJava class. + */ + public RuntimeJava() { + } + + /** + * Get the enableMetrics property: Enable jmx core metrics for the java app. + * + * @return the enableMetrics value. + */ + public Boolean enableMetrics() { + return this.enableMetrics; + } + + /** + * Set the enableMetrics property: Enable jmx core metrics for the java app. + * + * @param enableMetrics the enableMetrics value to set. + * @return the RuntimeJava object itself. + */ + public RuntimeJava withEnableMetrics(Boolean enableMetrics) { + this.enableMetrics = enableMetrics; + return this; + } + + /** + * Get the javaAgent property: Diagnostic capabilities achieved by java agent. + * + * @return the javaAgent value. + */ + public RuntimeJavaAgent javaAgent() { + return this.javaAgent; + } + + /** + * Set the javaAgent property: Diagnostic capabilities achieved by java agent. + * + * @param javaAgent the javaAgent value to set. + * @return the RuntimeJava object itself. + */ + public RuntimeJava withJavaAgent(RuntimeJavaAgent javaAgent) { + this.javaAgent = javaAgent; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (javaAgent() != null) { + javaAgent().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enableMetrics", this.enableMetrics); + jsonWriter.writeJsonField("javaAgent", this.javaAgent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuntimeJava from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuntimeJava if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RuntimeJava. + */ + public static RuntimeJava fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuntimeJava deserializedRuntimeJava = new RuntimeJava(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableMetrics".equals(fieldName)) { + deserializedRuntimeJava.enableMetrics = reader.getNullable(JsonReader::getBoolean); + } else if ("javaAgent".equals(fieldName)) { + deserializedRuntimeJava.javaAgent = RuntimeJavaAgent.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRuntimeJava; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeJavaAgent.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeJavaAgent.java new file mode 100644 index 0000000000000..4287f43e0134b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeJavaAgent.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Diagnostic capabilities achieved by java agent. + */ +@Fluent +public final class RuntimeJavaAgent implements JsonSerializable { + /* + * Enable java agent injection for the java app. + */ + private Boolean enabled; + + /* + * Capabilities on the java logging scenario. + */ + private RuntimeJavaAgentLogging logging; + + /** + * Creates an instance of RuntimeJavaAgent class. + */ + public RuntimeJavaAgent() { + } + + /** + * Get the enabled property: Enable java agent injection for the java app. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Enable java agent injection for the java app. + * + * @param enabled the enabled value to set. + * @return the RuntimeJavaAgent object itself. + */ + public RuntimeJavaAgent withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the logging property: Capabilities on the java logging scenario. + * + * @return the logging value. + */ + public RuntimeJavaAgentLogging logging() { + return this.logging; + } + + /** + * Set the logging property: Capabilities on the java logging scenario. + * + * @param logging the logging value to set. + * @return the RuntimeJavaAgent object itself. + */ + public RuntimeJavaAgent withLogging(RuntimeJavaAgentLogging logging) { + this.logging = logging; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logging() != null) { + logging().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeJsonField("logging", this.logging); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuntimeJavaAgent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuntimeJavaAgent if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RuntimeJavaAgent. + */ + public static RuntimeJavaAgent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuntimeJavaAgent deserializedRuntimeJavaAgent = new RuntimeJavaAgent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedRuntimeJavaAgent.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("logging".equals(fieldName)) { + deserializedRuntimeJavaAgent.logging = RuntimeJavaAgentLogging.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRuntimeJavaAgent; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeJavaAgentLogging.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeJavaAgentLogging.java new file mode 100644 index 0000000000000..eeda05ff1b8db --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RuntimeJavaAgentLogging.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Capabilities on the java logging scenario. + */ +@Fluent +public final class RuntimeJavaAgentLogging implements JsonSerializable { + /* + * Settings of the logger for the java app. + */ + private List loggerSettings; + + /** + * Creates an instance of RuntimeJavaAgentLogging class. + */ + public RuntimeJavaAgentLogging() { + } + + /** + * Get the loggerSettings property: Settings of the logger for the java app. + * + * @return the loggerSettings value. + */ + public List loggerSettings() { + return this.loggerSettings; + } + + /** + * Set the loggerSettings property: Settings of the logger for the java app. + * + * @param loggerSettings the loggerSettings value to set. + * @return the RuntimeJavaAgentLogging object itself. + */ + public RuntimeJavaAgentLogging withLoggerSettings(List loggerSettings) { + this.loggerSettings = loggerSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (loggerSettings() != null) { + loggerSettings().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("loggerSettings", this.loggerSettings, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuntimeJavaAgentLogging from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuntimeJavaAgentLogging if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RuntimeJavaAgentLogging. + */ + public static RuntimeJavaAgentLogging fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuntimeJavaAgentLogging deserializedRuntimeJavaAgentLogging = new RuntimeJavaAgentLogging(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("loggerSettings".equals(fieldName)) { + List loggerSettings = reader.readArray(reader1 -> LoggerSetting.fromJson(reader1)); + deserializedRuntimeJavaAgentLogging.loggerSettings = loggerSettings; + } else { + reader.skipChildren(); + } + } + + return deserializedRuntimeJavaAgentLogging; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Scale.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Scale.java index c60016286de4a..a4dd0926cc514 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Scale.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Scale.java @@ -27,6 +27,16 @@ public final class Scale implements JsonSerializable { */ private Integer maxReplicas; + /* + * Optional. KEDA Cooldown Period. Defaults to 300 seconds if not set. + */ + private Integer cooldownPeriod; + + /* + * Optional. KEDA Polling Interval. Defaults to 30 seconds if not set. + */ + private Integer pollingInterval; + /* * Scaling rules. */ @@ -78,6 +88,46 @@ public Scale withMaxReplicas(Integer maxReplicas) { return this; } + /** + * Get the cooldownPeriod property: Optional. KEDA Cooldown Period. Defaults to 300 seconds if not set. + * + * @return the cooldownPeriod value. + */ + public Integer cooldownPeriod() { + return this.cooldownPeriod; + } + + /** + * Set the cooldownPeriod property: Optional. KEDA Cooldown Period. Defaults to 300 seconds if not set. + * + * @param cooldownPeriod the cooldownPeriod value to set. + * @return the Scale object itself. + */ + public Scale withCooldownPeriod(Integer cooldownPeriod) { + this.cooldownPeriod = cooldownPeriod; + return this; + } + + /** + * Get the pollingInterval property: Optional. KEDA Polling Interval. Defaults to 30 seconds if not set. + * + * @return the pollingInterval value. + */ + public Integer pollingInterval() { + return this.pollingInterval; + } + + /** + * Set the pollingInterval property: Optional. KEDA Polling Interval. Defaults to 30 seconds if not set. + * + * @param pollingInterval the pollingInterval value to set. + * @return the Scale object itself. + */ + public Scale withPollingInterval(Integer pollingInterval) { + this.pollingInterval = pollingInterval; + return this; + } + /** * Get the rules property: Scaling rules. * @@ -117,6 +167,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeNumberField("minReplicas", this.minReplicas); jsonWriter.writeNumberField("maxReplicas", this.maxReplicas); + jsonWriter.writeNumberField("cooldownPeriod", this.cooldownPeriod); + jsonWriter.writeNumberField("pollingInterval", this.pollingInterval); jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -140,6 +192,10 @@ public static Scale fromJson(JsonReader jsonReader) throws IOException { deserializedScale.minReplicas = reader.getNullable(JsonReader::getInt); } else if ("maxReplicas".equals(fieldName)) { deserializedScale.maxReplicas = reader.getNullable(JsonReader::getInt); + } else if ("cooldownPeriod".equals(fieldName)) { + deserializedScale.cooldownPeriod = reader.getNullable(JsonReader::getInt); + } else if ("pollingInterval".equals(fieldName)) { + deserializedScale.pollingInterval = reader.getNullable(JsonReader::getInt); } else if ("rules".equals(fieldName)) { List rules = reader.readArray(reader1 -> ScaleRule.fromJson(reader1)); deserializedScale.rules = rules; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleConfiguration.java new file mode 100644 index 0000000000000..2450afb2fa288 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleConfiguration.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Scale configuration. + */ +@Fluent +public final class ScaleConfiguration implements JsonSerializable { + /* + * The maximum count of sessions at the same time. + */ + private Integer maxConcurrentSessions; + + /* + * The minimum count of ready session instances. + */ + private Integer readySessionInstances; + + /** + * Creates an instance of ScaleConfiguration class. + */ + public ScaleConfiguration() { + } + + /** + * Get the maxConcurrentSessions property: The maximum count of sessions at the same time. + * + * @return the maxConcurrentSessions value. + */ + public Integer maxConcurrentSessions() { + return this.maxConcurrentSessions; + } + + /** + * Set the maxConcurrentSessions property: The maximum count of sessions at the same time. + * + * @param maxConcurrentSessions the maxConcurrentSessions value to set. + * @return the ScaleConfiguration object itself. + */ + public ScaleConfiguration withMaxConcurrentSessions(Integer maxConcurrentSessions) { + this.maxConcurrentSessions = maxConcurrentSessions; + return this; + } + + /** + * Get the readySessionInstances property: The minimum count of ready session instances. + * + * @return the readySessionInstances value. + */ + public Integer readySessionInstances() { + return this.readySessionInstances; + } + + /** + * Set the readySessionInstances property: The minimum count of ready session instances. + * + * @param readySessionInstances the readySessionInstances value to set. + * @return the ScaleConfiguration object itself. + */ + public ScaleConfiguration withReadySessionInstances(Integer readySessionInstances) { + this.readySessionInstances = readySessionInstances; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maxConcurrentSessions", this.maxConcurrentSessions); + jsonWriter.writeNumberField("readySessionInstances", this.readySessionInstances); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScaleConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScaleConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ScaleConfiguration. + */ + public static ScaleConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScaleConfiguration deserializedScaleConfiguration = new ScaleConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxConcurrentSessions".equals(fieldName)) { + deserializedScaleConfiguration.maxConcurrentSessions = reader.getNullable(JsonReader::getInt); + } else if ("readySessionInstances".equals(fieldName)) { + deserializedScaleConfiguration.readySessionInstances = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedScaleConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScgRoute.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScgRoute.java new file mode 100644 index 0000000000000..05dd4be6c0604 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScgRoute.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Spring Cloud Gateway route definition. + */ +@Fluent +public final class ScgRoute implements JsonSerializable { + /* + * Id of the route + */ + private String id; + + /* + * Uri of the route + */ + private String uri; + + /* + * Predicates of the route + */ + private List predicates; + + /* + * Filters of the route + */ + private List filters; + + /* + * Order of the route + */ + private Long order; + + /** + * Creates an instance of ScgRoute class. + */ + public ScgRoute() { + } + + /** + * Get the id property: Id of the route. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Id of the route. + * + * @param id the id value to set. + * @return the ScgRoute object itself. + */ + public ScgRoute withId(String id) { + this.id = id; + return this; + } + + /** + * Get the uri property: Uri of the route. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: Uri of the route. + * + * @param uri the uri value to set. + * @return the ScgRoute object itself. + */ + public ScgRoute withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the predicates property: Predicates of the route. + * + * @return the predicates value. + */ + public List predicates() { + return this.predicates; + } + + /** + * Set the predicates property: Predicates of the route. + * + * @param predicates the predicates value to set. + * @return the ScgRoute object itself. + */ + public ScgRoute withPredicates(List predicates) { + this.predicates = predicates; + return this; + } + + /** + * Get the filters property: Filters of the route. + * + * @return the filters value. + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters property: Filters of the route. + * + * @param filters the filters value to set. + * @return the ScgRoute object itself. + */ + public ScgRoute withFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * Get the order property: Order of the route. + * + * @return the order value. + */ + public Long order() { + return this.order; + } + + /** + * Set the order property: Order of the route. + * + * @param order the order value to set. + * @return the ScgRoute object itself. + */ + public ScgRoute withOrder(Long order) { + this.order = order; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property id in model ScgRoute")); + } + if (uri() == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property uri in model ScgRoute")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ScgRoute.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("uri", this.uri); + jsonWriter.writeArrayField("predicates", this.predicates, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("filters", this.filters, (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("order", this.order); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScgRoute from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScgRoute if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ScgRoute. + */ + public static ScgRoute fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScgRoute deserializedScgRoute = new ScgRoute(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedScgRoute.id = reader.getString(); + } else if ("uri".equals(fieldName)) { + deserializedScgRoute.uri = reader.getString(); + } else if ("predicates".equals(fieldName)) { + List predicates = reader.readArray(reader1 -> reader1.getString()); + deserializedScgRoute.predicates = predicates; + } else if ("filters".equals(fieldName)) { + List filters = reader.readArray(reader1 -> reader1.getString()); + deserializedScgRoute.filters = filters; + } else if ("order".equals(fieldName)) { + deserializedScgRoute.order = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedScgRoute; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ServiceBind.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ServiceBind.java index 0bf6482a7897a..07493cbd84d3f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ServiceBind.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ServiceBind.java @@ -10,6 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.Map; /** * Configuration to bind a ContainerApp to a dev ContainerApp Service. @@ -26,6 +27,16 @@ public final class ServiceBind implements JsonSerializable { */ private String name; + /* + * Type of the client to be used to connect to the service + */ + private String clientType; + + /* + * Customized keys for customizing injected values to the app + */ + private Map customizedKeys; + /** * Creates an instance of ServiceBind class. */ @@ -72,6 +83,46 @@ public ServiceBind withName(String name) { return this; } + /** + * Get the clientType property: Type of the client to be used to connect to the service. + * + * @return the clientType value. + */ + public String clientType() { + return this.clientType; + } + + /** + * Set the clientType property: Type of the client to be used to connect to the service. + * + * @param clientType the clientType value to set. + * @return the ServiceBind object itself. + */ + public ServiceBind withClientType(String clientType) { + this.clientType = clientType; + return this; + } + + /** + * Get the customizedKeys property: Customized keys for customizing injected values to the app. + * + * @return the customizedKeys value. + */ + public Map customizedKeys() { + return this.customizedKeys; + } + + /** + * Set the customizedKeys property: Customized keys for customizing injected values to the app. + * + * @param customizedKeys the customizedKeys value to set. + * @return the ServiceBind object itself. + */ + public ServiceBind withCustomizedKeys(Map customizedKeys) { + this.customizedKeys = customizedKeys; + return this; + } + /** * Validates the instance. * @@ -88,6 +139,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("serviceId", this.serviceId); jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("clientType", this.clientType); + jsonWriter.writeMapField("customizedKeys", this.customizedKeys, + (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -110,6 +164,11 @@ public static ServiceBind fromJson(JsonReader jsonReader) throws IOException { deserializedServiceBind.serviceId = reader.getString(); } else if ("name".equals(fieldName)) { deserializedServiceBind.name = reader.getString(); + } else if ("clientType".equals(fieldName)) { + deserializedServiceBind.clientType = reader.getString(); + } else if ("customizedKeys".equals(fieldName)) { + Map customizedKeys = reader.readMap(reader1 -> reader1.getString()); + deserializedServiceBind.customizedKeys = customizedKeys; } else { reader.skipChildren(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionContainer.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionContainer.java new file mode 100644 index 0000000000000..f762c588cbc3c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionContainer.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Container definitions for the sessions of the session pool. + */ +@Fluent +public final class SessionContainer implements JsonSerializable { + /* + * Container image tag. + */ + private String image; + + /* + * Custom container name. + */ + private String name; + + /* + * Container start command. + */ + private List command; + + /* + * Container start command arguments. + */ + private List args; + + /* + * Container environment variables. + */ + private List env; + + /* + * Container resource requirements. + */ + private SessionContainerResources resources; + + /** + * Creates an instance of SessionContainer class. + */ + public SessionContainer() { + } + + /** + * Get the image property: Container image tag. + * + * @return the image value. + */ + public String image() { + return this.image; + } + + /** + * Set the image property: Container image tag. + * + * @param image the image value to set. + * @return the SessionContainer object itself. + */ + public SessionContainer withImage(String image) { + this.image = image; + return this; + } + + /** + * Get the name property: Custom container name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Custom container name. + * + * @param name the name value to set. + * @return the SessionContainer object itself. + */ + public SessionContainer withName(String name) { + this.name = name; + return this; + } + + /** + * Get the command property: Container start command. + * + * @return the command value. + */ + public List command() { + return this.command; + } + + /** + * Set the command property: Container start command. + * + * @param command the command value to set. + * @return the SessionContainer object itself. + */ + public SessionContainer withCommand(List command) { + this.command = command; + return this; + } + + /** + * Get the args property: Container start command arguments. + * + * @return the args value. + */ + public List args() { + return this.args; + } + + /** + * Set the args property: Container start command arguments. + * + * @param args the args value to set. + * @return the SessionContainer object itself. + */ + public SessionContainer withArgs(List args) { + this.args = args; + return this; + } + + /** + * Get the env property: Container environment variables. + * + * @return the env value. + */ + public List env() { + return this.env; + } + + /** + * Set the env property: Container environment variables. + * + * @param env the env value to set. + * @return the SessionContainer object itself. + */ + public SessionContainer withEnv(List env) { + this.env = env; + return this; + } + + /** + * Get the resources property: Container resource requirements. + * + * @return the resources value. + */ + public SessionContainerResources resources() { + return this.resources; + } + + /** + * Set the resources property: Container resource requirements. + * + * @param resources the resources value to set. + * @return the SessionContainer object itself. + */ + public SessionContainer withResources(SessionContainerResources resources) { + this.resources = resources; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (env() != null) { + env().forEach(e -> e.validate()); + } + if (resources() != null) { + resources().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("image", this.image); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("command", this.command, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("args", this.args, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("env", this.env, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("resources", this.resources); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionContainer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionContainer if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionContainer. + */ + public static SessionContainer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionContainer deserializedSessionContainer = new SessionContainer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("image".equals(fieldName)) { + deserializedSessionContainer.image = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSessionContainer.name = reader.getString(); + } else if ("command".equals(fieldName)) { + List command = reader.readArray(reader1 -> reader1.getString()); + deserializedSessionContainer.command = command; + } else if ("args".equals(fieldName)) { + List args = reader.readArray(reader1 -> reader1.getString()); + deserializedSessionContainer.args = args; + } else if ("env".equals(fieldName)) { + List env = reader.readArray(reader1 -> EnvironmentVar.fromJson(reader1)); + deserializedSessionContainer.env = env; + } else if ("resources".equals(fieldName)) { + deserializedSessionContainer.resources = SessionContainerResources.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionContainer; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionContainerResources.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionContainerResources.java new file mode 100644 index 0000000000000..3a8dc5ac072f3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionContainerResources.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Container resource requirements for sessions of the session pool. + */ +@Fluent +public final class SessionContainerResources implements JsonSerializable { + /* + * Required CPU in cores, e.g. 0.5 + */ + private Double cpu; + + /* + * Required memory, e.g. "250Mb" + */ + private String memory; + + /** + * Creates an instance of SessionContainerResources class. + */ + public SessionContainerResources() { + } + + /** + * Get the cpu property: Required CPU in cores, e.g. 0.5. + * + * @return the cpu value. + */ + public Double cpu() { + return this.cpu; + } + + /** + * Set the cpu property: Required CPU in cores, e.g. 0.5. + * + * @param cpu the cpu value to set. + * @return the SessionContainerResources object itself. + */ + public SessionContainerResources withCpu(Double cpu) { + this.cpu = cpu; + return this; + } + + /** + * Get the memory property: Required memory, e.g. "250Mb". + * + * @return the memory value. + */ + public String memory() { + return this.memory; + } + + /** + * Set the memory property: Required memory, e.g. "250Mb". + * + * @param memory the memory value to set. + * @return the SessionContainerResources object itself. + */ + public SessionContainerResources withMemory(String memory) { + this.memory = memory; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("cpu", this.cpu); + jsonWriter.writeStringField("memory", this.memory); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionContainerResources from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionContainerResources if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionContainerResources. + */ + public static SessionContainerResources fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionContainerResources deserializedSessionContainerResources = new SessionContainerResources(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cpu".equals(fieldName)) { + deserializedSessionContainerResources.cpu = reader.getNullable(JsonReader::getDouble); + } else if ("memory".equals(fieldName)) { + deserializedSessionContainerResources.memory = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionContainerResources; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionIngress.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionIngress.java new file mode 100644 index 0000000000000..59b318068c964 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionIngress.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Session pool ingress configuration. + */ +@Fluent +public final class SessionIngress implements JsonSerializable { + /* + * Target port in containers for traffic from ingress + */ + private Integer targetPort; + + /** + * Creates an instance of SessionIngress class. + */ + public SessionIngress() { + } + + /** + * Get the targetPort property: Target port in containers for traffic from ingress. + * + * @return the targetPort value. + */ + public Integer targetPort() { + return this.targetPort; + } + + /** + * Set the targetPort property: Target port in containers for traffic from ingress. + * + * @param targetPort the targetPort value to set. + * @return the SessionIngress object itself. + */ + public SessionIngress withTargetPort(Integer targetPort) { + this.targetPort = targetPort; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("targetPort", this.targetPort); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionIngress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionIngress if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionIngress. + */ + public static SessionIngress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionIngress deserializedSessionIngress = new SessionIngress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetPort".equals(fieldName)) { + deserializedSessionIngress.targetPort = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionIngress; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionNetworkConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionNetworkConfiguration.java new file mode 100644 index 0000000000000..36279a48ba126 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionNetworkConfiguration.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Session network configuration. + */ +@Fluent +public final class SessionNetworkConfiguration implements JsonSerializable { + /* + * Network status for the sessions. + */ + private SessionNetworkStatus status; + + /** + * Creates an instance of SessionNetworkConfiguration class. + */ + public SessionNetworkConfiguration() { + } + + /** + * Get the status property: Network status for the sessions. + * + * @return the status value. + */ + public SessionNetworkStatus status() { + return this.status; + } + + /** + * Set the status property: Network status for the sessions. + * + * @param status the status value to set. + * @return the SessionNetworkConfiguration object itself. + */ + public SessionNetworkConfiguration withStatus(SessionNetworkStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionNetworkConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionNetworkConfiguration if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionNetworkConfiguration. + */ + public static SessionNetworkConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionNetworkConfiguration deserializedSessionNetworkConfiguration = new SessionNetworkConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedSessionNetworkConfiguration.status + = SessionNetworkStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionNetworkConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionNetworkStatus.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionNetworkStatus.java new file mode 100644 index 0000000000000..e6e7e6b37e90e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionNetworkStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Network status for the sessions. + */ +public final class SessionNetworkStatus extends ExpandableStringEnum { + /** + * Static value EgressEnabled for SessionNetworkStatus. + */ + public static final SessionNetworkStatus EGRESS_ENABLED = fromString("EgressEnabled"); + + /** + * Static value EgressDisabled for SessionNetworkStatus. + */ + public static final SessionNetworkStatus EGRESS_DISABLED = fromString("EgressDisabled"); + + /** + * Creates a new instance of SessionNetworkStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SessionNetworkStatus() { + } + + /** + * Creates or finds a SessionNetworkStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SessionNetworkStatus. + */ + public static SessionNetworkStatus fromString(String name) { + return fromString(name, SessionNetworkStatus.class); + } + + /** + * Gets known SessionNetworkStatus values. + * + * @return known SessionNetworkStatus values. + */ + public static Collection values() { + return values(SessionNetworkStatus.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPool.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPool.java new file mode 100644 index 0000000000000..563164248f5c2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPool.java @@ -0,0 +1,481 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.SessionPoolInner; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of SessionPool. + */ +public interface SessionPool { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the environmentId property: Resource ID of the session pool's environment. + * + * @return the environmentId value. + */ + String environmentId(); + + /** + * Gets the containerType property: The container type of the sessions. + * + * @return the containerType value. + */ + ContainerType containerType(); + + /** + * Gets the poolManagementType property: The pool management type of the session pool. + * + * @return the poolManagementType value. + */ + PoolManagementType poolManagementType(); + + /** + * Gets the nodeCount property: The number of nodes the session pool is using. + * + * @return the nodeCount value. + */ + Integer nodeCount(); + + /** + * Gets the scaleConfiguration property: The scale configuration of the session pool. + * + * @return the scaleConfiguration value. + */ + ScaleConfiguration scaleConfiguration(); + + /** + * Gets the secrets property: The secrets of the session pool. + * + * @return the secrets value. + */ + List secrets(); + + /** + * Gets the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is dynamic. + * + * @return the dynamicPoolConfiguration value. + */ + DynamicPoolConfiguration dynamicPoolConfiguration(); + + /** + * Gets the customContainerTemplate property: The custom container configuration if the containerType is + * CustomContainer. + * + * @return the customContainerTemplate value. + */ + CustomContainerTemplate customContainerTemplate(); + + /** + * Gets the sessionNetworkConfiguration property: The network configuration of the sessions in the session pool. + * + * @return the sessionNetworkConfiguration value. + */ + SessionNetworkConfiguration sessionNetworkConfiguration(); + + /** + * Gets the poolManagementEndpoint property: The endpoint to manage the pool. + * + * @return the poolManagementEndpoint value. + */ + String poolManagementEndpoint(); + + /** + * Gets the provisioningState property: Provisioning state of the session pool. + * + * @return the provisioningState value. + */ + SessionPoolProvisioningState provisioningState(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.SessionPoolInner object. + * + * @return the inner object. + */ + SessionPoolInner innerModel(); + + /** + * The entirety of the SessionPool definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The SessionPool definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SessionPool definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the SessionPool definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the SessionPool definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the SessionPool definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, DefinitionStages.WithEnvironmentId, DefinitionStages.WithContainerType, + DefinitionStages.WithPoolManagementType, DefinitionStages.WithScaleConfiguration, + DefinitionStages.WithSecrets, DefinitionStages.WithDynamicPoolConfiguration, + DefinitionStages.WithCustomContainerTemplate, DefinitionStages.WithSessionNetworkConfiguration { + /** + * Executes the create request. + * + * @return the created resource. + */ + SessionPool create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SessionPool create(Context context); + } + + /** + * The stage of the SessionPool definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the SessionPool definition allowing to specify environmentId. + */ + interface WithEnvironmentId { + /** + * Specifies the environmentId property: Resource ID of the session pool's environment.. + * + * @param environmentId Resource ID of the session pool's environment. + * @return the next definition stage. + */ + WithCreate withEnvironmentId(String environmentId); + } + + /** + * The stage of the SessionPool definition allowing to specify containerType. + */ + interface WithContainerType { + /** + * Specifies the containerType property: The container type of the sessions.. + * + * @param containerType The container type of the sessions. + * @return the next definition stage. + */ + WithCreate withContainerType(ContainerType containerType); + } + + /** + * The stage of the SessionPool definition allowing to specify poolManagementType. + */ + interface WithPoolManagementType { + /** + * Specifies the poolManagementType property: The pool management type of the session pool.. + * + * @param poolManagementType The pool management type of the session pool. + * @return the next definition stage. + */ + WithCreate withPoolManagementType(PoolManagementType poolManagementType); + } + + /** + * The stage of the SessionPool definition allowing to specify scaleConfiguration. + */ + interface WithScaleConfiguration { + /** + * Specifies the scaleConfiguration property: The scale configuration of the session pool.. + * + * @param scaleConfiguration The scale configuration of the session pool. + * @return the next definition stage. + */ + WithCreate withScaleConfiguration(ScaleConfiguration scaleConfiguration); + } + + /** + * The stage of the SessionPool definition allowing to specify secrets. + */ + interface WithSecrets { + /** + * Specifies the secrets property: The secrets of the session pool.. + * + * @param secrets The secrets of the session pool. + * @return the next definition stage. + */ + WithCreate withSecrets(List secrets); + } + + /** + * The stage of the SessionPool definition allowing to specify dynamicPoolConfiguration. + */ + interface WithDynamicPoolConfiguration { + /** + * Specifies the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is + * dynamic.. + * + * @param dynamicPoolConfiguration The pool configuration if the poolManagementType is dynamic. + * @return the next definition stage. + */ + WithCreate withDynamicPoolConfiguration(DynamicPoolConfiguration dynamicPoolConfiguration); + } + + /** + * The stage of the SessionPool definition allowing to specify customContainerTemplate. + */ + interface WithCustomContainerTemplate { + /** + * Specifies the customContainerTemplate property: The custom container configuration if the containerType + * is CustomContainer.. + * + * @param customContainerTemplate The custom container configuration if the containerType is + * CustomContainer. + * @return the next definition stage. + */ + WithCreate withCustomContainerTemplate(CustomContainerTemplate customContainerTemplate); + } + + /** + * The stage of the SessionPool definition allowing to specify sessionNetworkConfiguration. + */ + interface WithSessionNetworkConfiguration { + /** + * Specifies the sessionNetworkConfiguration property: The network configuration of the sessions in the + * session pool.. + * + * @param sessionNetworkConfiguration The network configuration of the sessions in the session pool. + * @return the next definition stage. + */ + WithCreate withSessionNetworkConfiguration(SessionNetworkConfiguration sessionNetworkConfiguration); + } + } + + /** + * Begins update for the SessionPool resource. + * + * @return the stage of resource update. + */ + SessionPool.Update update(); + + /** + * The template for SessionPool update. + */ + interface Update extends UpdateStages.WithScaleConfiguration, UpdateStages.WithSecrets, + UpdateStages.WithDynamicPoolConfiguration, UpdateStages.WithCustomContainerTemplate, + UpdateStages.WithSessionNetworkConfiguration { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SessionPool apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SessionPool apply(Context context); + } + + /** + * The SessionPool update stages. + */ + interface UpdateStages { + /** + * The stage of the SessionPool update allowing to specify scaleConfiguration. + */ + interface WithScaleConfiguration { + /** + * Specifies the scaleConfiguration property: The scale configuration of the session pool.. + * + * @param scaleConfiguration The scale configuration of the session pool. + * @return the next definition stage. + */ + Update withScaleConfiguration(ScaleConfiguration scaleConfiguration); + } + + /** + * The stage of the SessionPool update allowing to specify secrets. + */ + interface WithSecrets { + /** + * Specifies the secrets property: The secrets of the session pool.. + * + * @param secrets The secrets of the session pool. + * @return the next definition stage. + */ + Update withSecrets(List secrets); + } + + /** + * The stage of the SessionPool update allowing to specify dynamicPoolConfiguration. + */ + interface WithDynamicPoolConfiguration { + /** + * Specifies the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is + * dynamic.. + * + * @param dynamicPoolConfiguration The pool configuration if the poolManagementType is dynamic. + * @return the next definition stage. + */ + Update withDynamicPoolConfiguration(DynamicPoolConfiguration dynamicPoolConfiguration); + } + + /** + * The stage of the SessionPool update allowing to specify customContainerTemplate. + */ + interface WithCustomContainerTemplate { + /** + * Specifies the customContainerTemplate property: The custom container configuration if the containerType + * is CustomContainer.. + * + * @param customContainerTemplate The custom container configuration if the containerType is + * CustomContainer. + * @return the next definition stage. + */ + Update withCustomContainerTemplate(CustomContainerTemplate customContainerTemplate); + } + + /** + * The stage of the SessionPool update allowing to specify sessionNetworkConfiguration. + */ + interface WithSessionNetworkConfiguration { + /** + * Specifies the sessionNetworkConfiguration property: The network configuration of the sessions in the + * session pool.. + * + * @param sessionNetworkConfiguration The network configuration of the sessions in the session pool. + * @return the next definition stage. + */ + Update withSessionNetworkConfiguration(SessionNetworkConfiguration sessionNetworkConfiguration); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SessionPool refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SessionPool refresh(Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolCollection.java new file mode 100644 index 0000000000000..17bf434642417 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolCollection.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.fluent.models.SessionPoolInner; +import java.io.IOException; +import java.util.List; + +/** + * Session pool collection Azure resource. + */ +@Fluent +public final class SessionPoolCollection implements JsonSerializable { + /* + * Collection of resources. + */ + private List value; + + /* + * Link to next page of resources. + */ + private String nextLink; + + /** + * Creates an instance of SessionPoolCollection class. + */ + public SessionPoolCollection() { + } + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the SessionPoolCollection object itself. + */ + public SessionPoolCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model SessionPoolCollection")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SessionPoolCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionPoolCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionPoolCollection if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SessionPoolCollection. + */ + public static SessionPoolCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionPoolCollection deserializedSessionPoolCollection = new SessionPoolCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> SessionPoolInner.fromJson(reader1)); + deserializedSessionPoolCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSessionPoolCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionPoolCollection; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolProvisioningState.java new file mode 100644 index 0000000000000..8b4fd83bbc766 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolProvisioningState.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of the session pool. + */ +public final class SessionPoolProvisioningState extends ExpandableStringEnum { + /** + * Static value InProgress for SessionPoolProvisioningState. + */ + public static final SessionPoolProvisioningState IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Succeeded for SessionPoolProvisioningState. + */ + public static final SessionPoolProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for SessionPoolProvisioningState. + */ + public static final SessionPoolProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for SessionPoolProvisioningState. + */ + public static final SessionPoolProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Deleting for SessionPoolProvisioningState. + */ + public static final SessionPoolProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of SessionPoolProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SessionPoolProvisioningState() { + } + + /** + * Creates or finds a SessionPoolProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SessionPoolProvisioningState. + */ + public static SessionPoolProvisioningState fromString(String name) { + return fromString(name, SessionPoolProvisioningState.class); + } + + /** + * Gets known SessionPoolProvisioningState values. + * + * @return known SessionPoolProvisioningState values. + */ + public static Collection values() { + return values(SessionPoolProvisioningState.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolSecret.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolSecret.java new file mode 100644 index 0000000000000..4d80150f7cf5f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolSecret.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Secret definition. + */ +@Fluent +public final class SessionPoolSecret implements JsonSerializable { + /* + * Secret Name. + */ + private String name; + + /* + * Secret Value. + */ + private String value; + + /** + * Creates an instance of SessionPoolSecret class. + */ + public SessionPoolSecret() { + } + + /** + * Get the name property: Secret Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Secret Name. + * + * @param name the name value to set. + * @return the SessionPoolSecret object itself. + */ + public SessionPoolSecret withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: Secret Value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Secret Value. + * + * @param value the value value to set. + * @return the SessionPoolSecret object itself. + */ + public SessionPoolSecret withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionPoolSecret from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionPoolSecret if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionPoolSecret. + */ + public static SessionPoolSecret fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionPoolSecret deserializedSessionPoolSecret = new SessionPoolSecret(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSessionPoolSecret.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedSessionPoolSecret.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionPoolSecret; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolUpdatableProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolUpdatableProperties.java new file mode 100644 index 0000000000000..de08b47b15868 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolUpdatableProperties.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.fluent.models.SessionPoolUpdatablePropertiesProperties; +import java.io.IOException; +import java.util.List; + +/** + * Container App session pool updatable properties. + */ +@Fluent +public final class SessionPoolUpdatableProperties implements JsonSerializable { + /* + * Session pool resource specific updatable properties. + */ + private SessionPoolUpdatablePropertiesProperties innerProperties; + + /** + * Creates an instance of SessionPoolUpdatableProperties class. + */ + public SessionPoolUpdatableProperties() { + } + + /** + * Get the innerProperties property: Session pool resource specific updatable properties. + * + * @return the innerProperties value. + */ + private SessionPoolUpdatablePropertiesProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the scaleConfiguration property: The scale configuration of the session pool. + * + * @return the scaleConfiguration value. + */ + public ScaleConfiguration scaleConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().scaleConfiguration(); + } + + /** + * Set the scaleConfiguration property: The scale configuration of the session pool. + * + * @param scaleConfiguration the scaleConfiguration value to set. + * @return the SessionPoolUpdatableProperties object itself. + */ + public SessionPoolUpdatableProperties withScaleConfiguration(ScaleConfiguration scaleConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolUpdatablePropertiesProperties(); + } + this.innerProperties().withScaleConfiguration(scaleConfiguration); + return this; + } + + /** + * Get the secrets property: The secrets of the session pool. + * + * @return the secrets value. + */ + public List secrets() { + return this.innerProperties() == null ? null : this.innerProperties().secrets(); + } + + /** + * Set the secrets property: The secrets of the session pool. + * + * @param secrets the secrets value to set. + * @return the SessionPoolUpdatableProperties object itself. + */ + public SessionPoolUpdatableProperties withSecrets(List secrets) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolUpdatablePropertiesProperties(); + } + this.innerProperties().withSecrets(secrets); + return this; + } + + /** + * Get the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is dynamic. + * + * @return the dynamicPoolConfiguration value. + */ + public DynamicPoolConfiguration dynamicPoolConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().dynamicPoolConfiguration(); + } + + /** + * Set the dynamicPoolConfiguration property: The pool configuration if the poolManagementType is dynamic. + * + * @param dynamicPoolConfiguration the dynamicPoolConfiguration value to set. + * @return the SessionPoolUpdatableProperties object itself. + */ + public SessionPoolUpdatableProperties + withDynamicPoolConfiguration(DynamicPoolConfiguration dynamicPoolConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolUpdatablePropertiesProperties(); + } + this.innerProperties().withDynamicPoolConfiguration(dynamicPoolConfiguration); + return this; + } + + /** + * Get the customContainerTemplate property: The custom container configuration if the containerType is + * CustomContainer. + * + * @return the customContainerTemplate value. + */ + public CustomContainerTemplate customContainerTemplate() { + return this.innerProperties() == null ? null : this.innerProperties().customContainerTemplate(); + } + + /** + * Set the customContainerTemplate property: The custom container configuration if the containerType is + * CustomContainer. + * + * @param customContainerTemplate the customContainerTemplate value to set. + * @return the SessionPoolUpdatableProperties object itself. + */ + public SessionPoolUpdatableProperties withCustomContainerTemplate(CustomContainerTemplate customContainerTemplate) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolUpdatablePropertiesProperties(); + } + this.innerProperties().withCustomContainerTemplate(customContainerTemplate); + return this; + } + + /** + * Get the sessionNetworkConfiguration property: The network configuration of the sessions in the session pool. + * + * @return the sessionNetworkConfiguration value. + */ + public SessionNetworkConfiguration sessionNetworkConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().sessionNetworkConfiguration(); + } + + /** + * Set the sessionNetworkConfiguration property: The network configuration of the sessions in the session pool. + * + * @param sessionNetworkConfiguration the sessionNetworkConfiguration value to set. + * @return the SessionPoolUpdatableProperties object itself. + */ + public SessionPoolUpdatableProperties + withSessionNetworkConfiguration(SessionNetworkConfiguration sessionNetworkConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new SessionPoolUpdatablePropertiesProperties(); + } + this.innerProperties().withSessionNetworkConfiguration(sessionNetworkConfiguration); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionPoolUpdatableProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionPoolUpdatableProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionPoolUpdatableProperties. + */ + public static SessionPoolUpdatableProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionPoolUpdatableProperties deserializedSessionPoolUpdatableProperties + = new SessionPoolUpdatableProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedSessionPoolUpdatableProperties.innerProperties + = SessionPoolUpdatablePropertiesProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionPoolUpdatableProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionRegistryCredentials.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionRegistryCredentials.java new file mode 100644 index 0000000000000..8284b71e8d326 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionRegistryCredentials.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Session pool private registry credentials. + */ +@Fluent +public final class SessionRegistryCredentials implements JsonSerializable { + /* + * Container registry server. + */ + private String registryServer; + + /* + * Container registry username. + */ + private String username; + + /* + * The name of the secret that contains the registry login password + */ + private String passwordSecretRef; + + /** + * Creates an instance of SessionRegistryCredentials class. + */ + public SessionRegistryCredentials() { + } + + /** + * Get the registryServer property: Container registry server. + * + * @return the registryServer value. + */ + public String registryServer() { + return this.registryServer; + } + + /** + * Set the registryServer property: Container registry server. + * + * @param registryServer the registryServer value to set. + * @return the SessionRegistryCredentials object itself. + */ + public SessionRegistryCredentials withRegistryServer(String registryServer) { + this.registryServer = registryServer; + return this; + } + + /** + * Get the username property: Container registry username. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Container registry username. + * + * @param username the username value to set. + * @return the SessionRegistryCredentials object itself. + */ + public SessionRegistryCredentials withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the passwordSecretRef property: The name of the secret that contains the registry login password. + * + * @return the passwordSecretRef value. + */ + public String passwordSecretRef() { + return this.passwordSecretRef; + } + + /** + * Set the passwordSecretRef property: The name of the secret that contains the registry login password. + * + * @param passwordSecretRef the passwordSecretRef value to set. + * @return the SessionRegistryCredentials object itself. + */ + public SessionRegistryCredentials withPasswordSecretRef(String passwordSecretRef) { + this.passwordSecretRef = passwordSecretRef; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("registryServer", this.registryServer); + jsonWriter.writeStringField("username", this.username); + jsonWriter.writeStringField("passwordSecretRef", this.passwordSecretRef); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionRegistryCredentials from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionRegistryCredentials if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionRegistryCredentials. + */ + public static SessionRegistryCredentials fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionRegistryCredentials deserializedSessionRegistryCredentials = new SessionRegistryCredentials(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("registryServer".equals(fieldName)) { + deserializedSessionRegistryCredentials.registryServer = reader.getString(); + } else if ("username".equals(fieldName)) { + deserializedSessionRegistryCredentials.username = reader.getString(); + } else if ("passwordSecretRef".equals(fieldName)) { + deserializedSessionRegistryCredentials.passwordSecretRef = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionRegistryCredentials; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SmbStorage.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SmbStorage.java new file mode 100644 index 0000000000000..c5667f1d4fb26 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SmbStorage.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * SMB storage properties. + */ +@Fluent +public final class SmbStorage implements JsonSerializable { + /* + * The host name or IP address of the SMB server. + */ + private String host; + + /* + * The path to the SMB shared folder. + */ + private String shareName; + + /* + * The user to log on to the SMB server. + */ + private String username; + + /* + * The domain name for the user. + */ + private String domain; + + /* + * The password for the user. + */ + private String password; + + /* + * Access mode for storage + */ + private AccessMode accessMode; + + /** + * Creates an instance of SmbStorage class. + */ + public SmbStorage() { + } + + /** + * Get the host property: The host name or IP address of the SMB server. + * + * @return the host value. + */ + public String host() { + return this.host; + } + + /** + * Set the host property: The host name or IP address of the SMB server. + * + * @param host the host value to set. + * @return the SmbStorage object itself. + */ + public SmbStorage withHost(String host) { + this.host = host; + return this; + } + + /** + * Get the shareName property: The path to the SMB shared folder. + * + * @return the shareName value. + */ + public String shareName() { + return this.shareName; + } + + /** + * Set the shareName property: The path to the SMB shared folder. + * + * @param shareName the shareName value to set. + * @return the SmbStorage object itself. + */ + public SmbStorage withShareName(String shareName) { + this.shareName = shareName; + return this; + } + + /** + * Get the username property: The user to log on to the SMB server. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The user to log on to the SMB server. + * + * @param username the username value to set. + * @return the SmbStorage object itself. + */ + public SmbStorage withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the domain property: The domain name for the user. + * + * @return the domain value. + */ + public String domain() { + return this.domain; + } + + /** + * Set the domain property: The domain name for the user. + * + * @param domain the domain value to set. + * @return the SmbStorage object itself. + */ + public SmbStorage withDomain(String domain) { + this.domain = domain; + return this; + } + + /** + * Get the password property: The password for the user. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password for the user. + * + * @param password the password value to set. + * @return the SmbStorage object itself. + */ + public SmbStorage withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the accessMode property: Access mode for storage. + * + * @return the accessMode value. + */ + public AccessMode accessMode() { + return this.accessMode; + } + + /** + * Set the accessMode property: Access mode for storage. + * + * @param accessMode the accessMode value to set. + * @return the SmbStorage object itself. + */ + public SmbStorage withAccessMode(AccessMode accessMode) { + this.accessMode = accessMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("host", this.host); + jsonWriter.writeStringField("shareName", this.shareName); + jsonWriter.writeStringField("username", this.username); + jsonWriter.writeStringField("domain", this.domain); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeStringField("accessMode", this.accessMode == null ? null : this.accessMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SmbStorage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SmbStorage if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the SmbStorage. + */ + public static SmbStorage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SmbStorage deserializedSmbStorage = new SmbStorage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("host".equals(fieldName)) { + deserializedSmbStorage.host = reader.getString(); + } else if ("shareName".equals(fieldName)) { + deserializedSmbStorage.shareName = reader.getString(); + } else if ("username".equals(fieldName)) { + deserializedSmbStorage.username = reader.getString(); + } else if ("domain".equals(fieldName)) { + deserializedSmbStorage.domain = reader.getString(); + } else if ("password".equals(fieldName)) { + deserializedSmbStorage.password = reader.getString(); + } else if ("accessMode".equals(fieldName)) { + deserializedSmbStorage.accessMode = AccessMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSmbStorage; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControl.java index 14349f87c7ce2..bb8d64ff2fbf6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControl.java @@ -120,7 +120,7 @@ interface WithParentResource { * to be created, but also allows for any other optional properties to be specified. */ interface WithCreate extends DefinitionStages.WithRepoUrl, DefinitionStages.WithBranch, - DefinitionStages.WithGithubActionConfiguration { + DefinitionStages.WithGithubActionConfiguration, DefinitionStages.WithXMsGithubAuxiliary { /** * Executes the create request. * @@ -180,6 +180,19 @@ interface WithGithubActionConfiguration { */ WithCreate withGithubActionConfiguration(GithubActionConfiguration githubActionConfiguration); } + + /** + * The stage of the SourceControl definition allowing to specify xMsGithubAuxiliary. + */ + interface WithXMsGithubAuxiliary { + /** + * Specifies the xMsGithubAuxiliary property: Github personal access token used for SourceControl.. + * + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. + * @return the next definition stage. + */ + WithCreate withXMsGithubAuxiliary(String xMsGithubAuxiliary); + } } /** @@ -192,8 +205,8 @@ interface WithGithubActionConfiguration { /** * The template for SourceControl update. */ - interface Update - extends UpdateStages.WithRepoUrl, UpdateStages.WithBranch, UpdateStages.WithGithubActionConfiguration { + interface Update extends UpdateStages.WithRepoUrl, UpdateStages.WithBranch, + UpdateStages.WithGithubActionConfiguration, UpdateStages.WithXMsGithubAuxiliary { /** * Executes the update request. * @@ -257,6 +270,19 @@ interface WithGithubActionConfiguration { */ Update withGithubActionConfiguration(GithubActionConfiguration githubActionConfiguration); } + + /** + * The stage of the SourceControl update allowing to specify xMsGithubAuxiliary. + */ + interface WithXMsGithubAuxiliary { + /** + * Specifies the xMsGithubAuxiliary property: Github personal access token used for SourceControl.. + * + * @param xMsGithubAuxiliary Github personal access token used for SourceControl. + * @return the next definition stage. + */ + Update withXMsGithubAuxiliary(String xMsGithubAuxiliary); + } } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SpringBootAdminComponent.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SpringBootAdminComponent.java new file mode 100644 index 0000000000000..061353f4758ae --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SpringBootAdminComponent.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Spring Boot Admin properties. + */ +@Fluent +public final class SpringBootAdminComponent extends JavaComponentProperties { + /* + * Type of the Java Component. + */ + private JavaComponentType componentType = JavaComponentType.SPRING_BOOT_ADMIN; + + /* + * Java Component Ingress configurations. + */ + private JavaComponentIngress ingress; + + /* + * Provisioning state of the Java Component. + */ + private JavaComponentProvisioningState provisioningState; + + /** + * Creates an instance of SpringBootAdminComponent class. + */ + public SpringBootAdminComponent() { + } + + /** + * Get the componentType property: Type of the Java Component. + * + * @return the componentType value. + */ + @Override + public JavaComponentType componentType() { + return this.componentType; + } + + /** + * Get the ingress property: Java Component Ingress configurations. + * + * @return the ingress value. + */ + public JavaComponentIngress ingress() { + return this.ingress; + } + + /** + * Set the ingress property: Java Component Ingress configurations. + * + * @param ingress the ingress value to set. + * @return the SpringBootAdminComponent object itself. + */ + public SpringBootAdminComponent withIngress(JavaComponentIngress ingress) { + this.ingress = ingress; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Java Component. + * + * @return the provisioningState value. + */ + @Override + public JavaComponentProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public SpringBootAdminComponent withConfigurations(List configurations) { + super.withConfigurations(configurations); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SpringBootAdminComponent withScale(JavaComponentPropertiesScale scale) { + super.withScale(scale); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SpringBootAdminComponent withServiceBinds(List serviceBinds) { + super.withServiceBinds(serviceBinds); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (ingress() != null) { + ingress().validate(); + } + if (configurations() != null) { + configurations().forEach(e -> e.validate()); + } + if (scale() != null) { + scale().validate(); + } + if (serviceBinds() != null) { + serviceBinds().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("configurations", configurations(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("scale", scale()); + jsonWriter.writeArrayField("serviceBinds", serviceBinds(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("componentType", this.componentType == null ? null : this.componentType.toString()); + jsonWriter.writeJsonField("ingress", this.ingress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SpringBootAdminComponent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SpringBootAdminComponent if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SpringBootAdminComponent. + */ + public static SpringBootAdminComponent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SpringBootAdminComponent deserializedSpringBootAdminComponent = new SpringBootAdminComponent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedSpringBootAdminComponent.provisioningState + = JavaComponentProvisioningState.fromString(reader.getString()); + } else if ("configurations".equals(fieldName)) { + List configurations + = reader.readArray(reader1 -> JavaComponentConfigurationProperty.fromJson(reader1)); + deserializedSpringBootAdminComponent.withConfigurations(configurations); + } else if ("scale".equals(fieldName)) { + deserializedSpringBootAdminComponent.withScale(JavaComponentPropertiesScale.fromJson(reader)); + } else if ("serviceBinds".equals(fieldName)) { + List serviceBinds + = reader.readArray(reader1 -> JavaComponentServiceBind.fromJson(reader1)); + deserializedSpringBootAdminComponent.withServiceBinds(serviceBinds); + } else if ("componentType".equals(fieldName)) { + deserializedSpringBootAdminComponent.componentType + = JavaComponentType.fromString(reader.getString()); + } else if ("ingress".equals(fieldName)) { + deserializedSpringBootAdminComponent.ingress = JavaComponentIngress.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSpringBootAdminComponent; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SpringCloudConfigComponent.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SpringCloudConfigComponent.java new file mode 100644 index 0000000000000..a4afd4bfc2525 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SpringCloudConfigComponent.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Spring Cloud Config properties. + */ +@Fluent +public final class SpringCloudConfigComponent extends JavaComponentProperties { + /* + * Type of the Java Component. + */ + private JavaComponentType componentType = JavaComponentType.SPRING_CLOUD_CONFIG; + + /* + * Provisioning state of the Java Component. + */ + private JavaComponentProvisioningState provisioningState; + + /** + * Creates an instance of SpringCloudConfigComponent class. + */ + public SpringCloudConfigComponent() { + } + + /** + * Get the componentType property: Type of the Java Component. + * + * @return the componentType value. + */ + @Override + public JavaComponentType componentType() { + return this.componentType; + } + + /** + * Get the provisioningState property: Provisioning state of the Java Component. + * + * @return the provisioningState value. + */ + @Override + public JavaComponentProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public SpringCloudConfigComponent withConfigurations(List configurations) { + super.withConfigurations(configurations); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SpringCloudConfigComponent withScale(JavaComponentPropertiesScale scale) { + super.withScale(scale); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SpringCloudConfigComponent withServiceBinds(List serviceBinds) { + super.withServiceBinds(serviceBinds); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (configurations() != null) { + configurations().forEach(e -> e.validate()); + } + if (scale() != null) { + scale().validate(); + } + if (serviceBinds() != null) { + serviceBinds().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("configurations", configurations(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("scale", scale()); + jsonWriter.writeArrayField("serviceBinds", serviceBinds(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("componentType", this.componentType == null ? null : this.componentType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SpringCloudConfigComponent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SpringCloudConfigComponent if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SpringCloudConfigComponent. + */ + public static SpringCloudConfigComponent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SpringCloudConfigComponent deserializedSpringCloudConfigComponent = new SpringCloudConfigComponent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedSpringCloudConfigComponent.provisioningState + = JavaComponentProvisioningState.fromString(reader.getString()); + } else if ("configurations".equals(fieldName)) { + List configurations + = reader.readArray(reader1 -> JavaComponentConfigurationProperty.fromJson(reader1)); + deserializedSpringCloudConfigComponent.withConfigurations(configurations); + } else if ("scale".equals(fieldName)) { + deserializedSpringCloudConfigComponent.withScale(JavaComponentPropertiesScale.fromJson(reader)); + } else if ("serviceBinds".equals(fieldName)) { + List serviceBinds + = reader.readArray(reader1 -> JavaComponentServiceBind.fromJson(reader1)); + deserializedSpringCloudConfigComponent.withServiceBinds(serviceBinds); + } else if ("componentType".equals(fieldName)) { + deserializedSpringCloudConfigComponent.componentType + = JavaComponentType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSpringCloudConfigComponent; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SpringCloudEurekaComponent.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SpringCloudEurekaComponent.java new file mode 100644 index 0000000000000..fe9c7ab1e498b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SpringCloudEurekaComponent.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Spring Cloud Eureka properties. + */ +@Fluent +public final class SpringCloudEurekaComponent extends JavaComponentProperties { + /* + * Type of the Java Component. + */ + private JavaComponentType componentType = JavaComponentType.SPRING_CLOUD_EUREKA; + + /* + * Java Component Ingress configurations. + */ + private JavaComponentIngress ingress; + + /* + * Provisioning state of the Java Component. + */ + private JavaComponentProvisioningState provisioningState; + + /** + * Creates an instance of SpringCloudEurekaComponent class. + */ + public SpringCloudEurekaComponent() { + } + + /** + * Get the componentType property: Type of the Java Component. + * + * @return the componentType value. + */ + @Override + public JavaComponentType componentType() { + return this.componentType; + } + + /** + * Get the ingress property: Java Component Ingress configurations. + * + * @return the ingress value. + */ + public JavaComponentIngress ingress() { + return this.ingress; + } + + /** + * Set the ingress property: Java Component Ingress configurations. + * + * @param ingress the ingress value to set. + * @return the SpringCloudEurekaComponent object itself. + */ + public SpringCloudEurekaComponent withIngress(JavaComponentIngress ingress) { + this.ingress = ingress; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Java Component. + * + * @return the provisioningState value. + */ + @Override + public JavaComponentProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public SpringCloudEurekaComponent withConfigurations(List configurations) { + super.withConfigurations(configurations); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SpringCloudEurekaComponent withScale(JavaComponentPropertiesScale scale) { + super.withScale(scale); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SpringCloudEurekaComponent withServiceBinds(List serviceBinds) { + super.withServiceBinds(serviceBinds); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (ingress() != null) { + ingress().validate(); + } + if (configurations() != null) { + configurations().forEach(e -> e.validate()); + } + if (scale() != null) { + scale().validate(); + } + if (serviceBinds() != null) { + serviceBinds().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("configurations", configurations(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("scale", scale()); + jsonWriter.writeArrayField("serviceBinds", serviceBinds(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("componentType", this.componentType == null ? null : this.componentType.toString()); + jsonWriter.writeJsonField("ingress", this.ingress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SpringCloudEurekaComponent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SpringCloudEurekaComponent if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SpringCloudEurekaComponent. + */ + public static SpringCloudEurekaComponent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SpringCloudEurekaComponent deserializedSpringCloudEurekaComponent = new SpringCloudEurekaComponent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedSpringCloudEurekaComponent.provisioningState + = JavaComponentProvisioningState.fromString(reader.getString()); + } else if ("configurations".equals(fieldName)) { + List configurations + = reader.readArray(reader1 -> JavaComponentConfigurationProperty.fromJson(reader1)); + deserializedSpringCloudEurekaComponent.withConfigurations(configurations); + } else if ("scale".equals(fieldName)) { + deserializedSpringCloudEurekaComponent.withScale(JavaComponentPropertiesScale.fromJson(reader)); + } else if ("serviceBinds".equals(fieldName)) { + List serviceBinds + = reader.readArray(reader1 -> JavaComponentServiceBind.fromJson(reader1)); + deserializedSpringCloudEurekaComponent.withServiceBinds(serviceBinds); + } else if ("componentType".equals(fieldName)) { + deserializedSpringCloudEurekaComponent.componentType + = JavaComponentType.fromString(reader.getString()); + } else if ("ingress".equals(fieldName)) { + deserializedSpringCloudEurekaComponent.ingress = JavaComponentIngress.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSpringCloudEurekaComponent; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SpringCloudGatewayComponent.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SpringCloudGatewayComponent.java new file mode 100644 index 0000000000000..53a06e6813bbc --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SpringCloudGatewayComponent.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Spring Cloud Gateway properties. + */ +@Fluent +public final class SpringCloudGatewayComponent extends JavaComponentProperties { + /* + * Type of the Java Component. + */ + private JavaComponentType componentType = JavaComponentType.SPRING_CLOUD_GATEWAY; + + /* + * Java Component Ingress configurations. + */ + private JavaComponentIngress ingress; + + /* + * Gateway route definition + */ + private List springCloudGatewayRoutes; + + /* + * Provisioning state of the Java Component. + */ + private JavaComponentProvisioningState provisioningState; + + /** + * Creates an instance of SpringCloudGatewayComponent class. + */ + public SpringCloudGatewayComponent() { + } + + /** + * Get the componentType property: Type of the Java Component. + * + * @return the componentType value. + */ + @Override + public JavaComponentType componentType() { + return this.componentType; + } + + /** + * Get the ingress property: Java Component Ingress configurations. + * + * @return the ingress value. + */ + public JavaComponentIngress ingress() { + return this.ingress; + } + + /** + * Set the ingress property: Java Component Ingress configurations. + * + * @param ingress the ingress value to set. + * @return the SpringCloudGatewayComponent object itself. + */ + public SpringCloudGatewayComponent withIngress(JavaComponentIngress ingress) { + this.ingress = ingress; + return this; + } + + /** + * Get the springCloudGatewayRoutes property: Gateway route definition. + * + * @return the springCloudGatewayRoutes value. + */ + public List springCloudGatewayRoutes() { + return this.springCloudGatewayRoutes; + } + + /** + * Set the springCloudGatewayRoutes property: Gateway route definition. + * + * @param springCloudGatewayRoutes the springCloudGatewayRoutes value to set. + * @return the SpringCloudGatewayComponent object itself. + */ + public SpringCloudGatewayComponent withSpringCloudGatewayRoutes(List springCloudGatewayRoutes) { + this.springCloudGatewayRoutes = springCloudGatewayRoutes; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Java Component. + * + * @return the provisioningState value. + */ + @Override + public JavaComponentProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public SpringCloudGatewayComponent withConfigurations(List configurations) { + super.withConfigurations(configurations); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SpringCloudGatewayComponent withScale(JavaComponentPropertiesScale scale) { + super.withScale(scale); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SpringCloudGatewayComponent withServiceBinds(List serviceBinds) { + super.withServiceBinds(serviceBinds); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (ingress() != null) { + ingress().validate(); + } + if (springCloudGatewayRoutes() != null) { + springCloudGatewayRoutes().forEach(e -> e.validate()); + } + if (configurations() != null) { + configurations().forEach(e -> e.validate()); + } + if (scale() != null) { + scale().validate(); + } + if (serviceBinds() != null) { + serviceBinds().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("configurations", configurations(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("scale", scale()); + jsonWriter.writeArrayField("serviceBinds", serviceBinds(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("componentType", this.componentType == null ? null : this.componentType.toString()); + jsonWriter.writeJsonField("ingress", this.ingress); + jsonWriter.writeArrayField("springCloudGatewayRoutes", this.springCloudGatewayRoutes, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SpringCloudGatewayComponent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SpringCloudGatewayComponent if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SpringCloudGatewayComponent. + */ + public static SpringCloudGatewayComponent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SpringCloudGatewayComponent deserializedSpringCloudGatewayComponent = new SpringCloudGatewayComponent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedSpringCloudGatewayComponent.provisioningState + = JavaComponentProvisioningState.fromString(reader.getString()); + } else if ("configurations".equals(fieldName)) { + List configurations + = reader.readArray(reader1 -> JavaComponentConfigurationProperty.fromJson(reader1)); + deserializedSpringCloudGatewayComponent.withConfigurations(configurations); + } else if ("scale".equals(fieldName)) { + deserializedSpringCloudGatewayComponent.withScale(JavaComponentPropertiesScale.fromJson(reader)); + } else if ("serviceBinds".equals(fieldName)) { + List serviceBinds + = reader.readArray(reader1 -> JavaComponentServiceBind.fromJson(reader1)); + deserializedSpringCloudGatewayComponent.withServiceBinds(serviceBinds); + } else if ("componentType".equals(fieldName)) { + deserializedSpringCloudGatewayComponent.componentType + = JavaComponentType.fromString(reader.getString()); + } else if ("ingress".equals(fieldName)) { + deserializedSpringCloudGatewayComponent.ingress = JavaComponentIngress.fromJson(reader); + } else if ("springCloudGatewayRoutes".equals(fieldName)) { + List springCloudGatewayRoutes = reader.readArray(reader1 -> ScgRoute.fromJson(reader1)); + deserializedSpringCloudGatewayComponent.springCloudGatewayRoutes = springCloudGatewayRoutes; + } else { + reader.skipChildren(); + } + } + + return deserializedSpringCloudGatewayComponent; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/StorageType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/StorageType.java index 7d1be632a2b1c..b99a84237d6de 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/StorageType.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/StorageType.java @@ -26,6 +26,16 @@ public final class StorageType extends ExpandableStringEnum { */ public static final StorageType SECRET = fromString("Secret"); + /** + * Static value NfsAzureFile for StorageType. + */ + public static final StorageType NFS_AZURE_FILE = fromString("NfsAzureFile"); + + /** + * Static value Smb for StorageType. + */ + public static final StorageType SMB = fromString("Smb"); + /** * Creates a new instance of StorageType value. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpConnectionPool.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpConnectionPool.java new file mode 100644 index 0000000000000..e99cce94111dc --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpConnectionPool.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines parameters for tcp connection pooling. + */ +@Fluent +public final class TcpConnectionPool implements JsonSerializable { + /* + * Maximum number of tcp connections allowed + */ + private Integer maxConnections; + + /** + * Creates an instance of TcpConnectionPool class. + */ + public TcpConnectionPool() { + } + + /** + * Get the maxConnections property: Maximum number of tcp connections allowed. + * + * @return the maxConnections value. + */ + public Integer maxConnections() { + return this.maxConnections; + } + + /** + * Set the maxConnections property: Maximum number of tcp connections allowed. + * + * @param maxConnections the maxConnections value to set. + * @return the TcpConnectionPool object itself. + */ + public TcpConnectionPool withMaxConnections(Integer maxConnections) { + this.maxConnections = maxConnections; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maxConnections", this.maxConnections); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TcpConnectionPool from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TcpConnectionPool if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TcpConnectionPool. + */ + public static TcpConnectionPool fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TcpConnectionPool deserializedTcpConnectionPool = new TcpConnectionPool(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxConnections".equals(fieldName)) { + deserializedTcpConnectionPool.maxConnections = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTcpConnectionPool; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpRetryPolicy.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpRetryPolicy.java new file mode 100644 index 0000000000000..f53b603c908fd --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpRetryPolicy.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Policy that defines tcp request retry conditions. + */ +@Fluent +public final class TcpRetryPolicy implements JsonSerializable { + /* + * Maximum number of attempts to connect to the tcp service + */ + private Integer maxConnectAttempts; + + /** + * Creates an instance of TcpRetryPolicy class. + */ + public TcpRetryPolicy() { + } + + /** + * Get the maxConnectAttempts property: Maximum number of attempts to connect to the tcp service. + * + * @return the maxConnectAttempts value. + */ + public Integer maxConnectAttempts() { + return this.maxConnectAttempts; + } + + /** + * Set the maxConnectAttempts property: Maximum number of attempts to connect to the tcp service. + * + * @param maxConnectAttempts the maxConnectAttempts value to set. + * @return the TcpRetryPolicy object itself. + */ + public TcpRetryPolicy withMaxConnectAttempts(Integer maxConnectAttempts) { + this.maxConnectAttempts = maxConnectAttempts; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maxConnectAttempts", this.maxConnectAttempts); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TcpRetryPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TcpRetryPolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TcpRetryPolicy. + */ + public static TcpRetryPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TcpRetryPolicy deserializedTcpRetryPolicy = new TcpRetryPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxConnectAttempts".equals(fieldName)) { + deserializedTcpRetryPolicy.maxConnectAttempts = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTcpRetryPolicy; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpScaleRule.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpScaleRule.java index 1937b8b008f1c..721410594a0f2 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpScaleRule.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TcpScaleRule.java @@ -28,6 +28,12 @@ public final class TcpScaleRule implements JsonSerializable { */ private List auth; + /* + * The resource ID of a user-assigned managed identity that is assigned to the Container App, or 'system' for + * system-assigned identity. + */ + private String identity; + /** * Creates an instance of TcpScaleRule class. */ @@ -74,6 +80,28 @@ public TcpScaleRule withAuth(List auth) { return this; } + /** + * Get the identity property: The resource ID of a user-assigned managed identity that is assigned to the Container + * App, or 'system' for system-assigned identity. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: The resource ID of a user-assigned managed identity that is assigned to the Container + * App, or 'system' for system-assigned identity. + * + * @param identity the identity value to set. + * @return the TcpScaleRule object itself. + */ + public TcpScaleRule withIdentity(String identity) { + this.identity = identity; + return this; + } + /** * Validates the instance. * @@ -93,6 +121,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); jsonWriter.writeArrayField("auth", this.auth, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -117,6 +146,8 @@ public static TcpScaleRule fromJson(JsonReader jsonReader) throws IOException { } else if ("auth".equals(fieldName)) { List auth = reader.readArray(reader1 -> ScaleRuleAuth.fromJson(reader1)); deserializedTcpScaleRule.auth = auth; + } else if ("identity".equals(fieldName)) { + deserializedTcpScaleRule.identity = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TimeoutPolicy.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TimeoutPolicy.java new file mode 100644 index 0000000000000..4f5f3f4a792c9 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TimeoutPolicy.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Policy to set request timeouts. + */ +@Fluent +public final class TimeoutPolicy implements JsonSerializable { + /* + * Timeout, in seconds, for a request to respond + */ + private Integer responseTimeoutInSeconds; + + /* + * Timeout, in seconds, for a request to initiate a connection + */ + private Integer connectionTimeoutInSeconds; + + /** + * Creates an instance of TimeoutPolicy class. + */ + public TimeoutPolicy() { + } + + /** + * Get the responseTimeoutInSeconds property: Timeout, in seconds, for a request to respond. + * + * @return the responseTimeoutInSeconds value. + */ + public Integer responseTimeoutInSeconds() { + return this.responseTimeoutInSeconds; + } + + /** + * Set the responseTimeoutInSeconds property: Timeout, in seconds, for a request to respond. + * + * @param responseTimeoutInSeconds the responseTimeoutInSeconds value to set. + * @return the TimeoutPolicy object itself. + */ + public TimeoutPolicy withResponseTimeoutInSeconds(Integer responseTimeoutInSeconds) { + this.responseTimeoutInSeconds = responseTimeoutInSeconds; + return this; + } + + /** + * Get the connectionTimeoutInSeconds property: Timeout, in seconds, for a request to initiate a connection. + * + * @return the connectionTimeoutInSeconds value. + */ + public Integer connectionTimeoutInSeconds() { + return this.connectionTimeoutInSeconds; + } + + /** + * Set the connectionTimeoutInSeconds property: Timeout, in seconds, for a request to initiate a connection. + * + * @param connectionTimeoutInSeconds the connectionTimeoutInSeconds value to set. + * @return the TimeoutPolicy object itself. + */ + public TimeoutPolicy withConnectionTimeoutInSeconds(Integer connectionTimeoutInSeconds) { + this.connectionTimeoutInSeconds = connectionTimeoutInSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("responseTimeoutInSeconds", this.responseTimeoutInSeconds); + jsonWriter.writeNumberField("connectionTimeoutInSeconds", this.connectionTimeoutInSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TimeoutPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TimeoutPolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TimeoutPolicy. + */ + public static TimeoutPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TimeoutPolicy deserializedTimeoutPolicy = new TimeoutPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("responseTimeoutInSeconds".equals(fieldName)) { + deserializedTimeoutPolicy.responseTimeoutInSeconds = reader.getNullable(JsonReader::getInt); + } else if ("connectionTimeoutInSeconds".equals(fieldName)) { + deserializedTimeoutPolicy.connectionTimeoutInSeconds = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTimeoutPolicy; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TracesConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TracesConfiguration.java new file mode 100644 index 0000000000000..b5dc7a72acb84 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TracesConfiguration.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Configuration of Open Telemetry traces. + */ +@Fluent +public final class TracesConfiguration implements JsonSerializable { + /* + * Boolean indicating if including dapr traces + */ + private Boolean includeDapr; + + /* + * Open telemetry traces destinations + */ + private List destinations; + + /** + * Creates an instance of TracesConfiguration class. + */ + public TracesConfiguration() { + } + + /** + * Get the includeDapr property: Boolean indicating if including dapr traces. + * + * @return the includeDapr value. + */ + public Boolean includeDapr() { + return this.includeDapr; + } + + /** + * Set the includeDapr property: Boolean indicating if including dapr traces. + * + * @param includeDapr the includeDapr value to set. + * @return the TracesConfiguration object itself. + */ + public TracesConfiguration withIncludeDapr(Boolean includeDapr) { + this.includeDapr = includeDapr; + return this; + } + + /** + * Get the destinations property: Open telemetry traces destinations. + * + * @return the destinations value. + */ + public List destinations() { + return this.destinations; + } + + /** + * Set the destinations property: Open telemetry traces destinations. + * + * @param destinations the destinations value to set. + * @return the TracesConfiguration object itself. + */ + public TracesConfiguration withDestinations(List destinations) { + this.destinations = destinations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("includeDapr", this.includeDapr); + jsonWriter.writeArrayField("destinations", this.destinations, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TracesConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TracesConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TracesConfiguration. + */ + public static TracesConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TracesConfiguration deserializedTracesConfiguration = new TracesConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("includeDapr".equals(fieldName)) { + deserializedTracesConfiguration.includeDapr = reader.getNullable(JsonReader::getBoolean); + } else if ("destinations".equals(fieldName)) { + List destinations = reader.readArray(reader1 -> reader1.getString()); + deserializedTracesConfiguration.destinations = destinations; + } else { + reader.skipChildren(); + } + } + + return deserializedTracesConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Volume.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Volume.java index 39def41083a22..ca6bb42b124fe 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Volume.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Volume.java @@ -39,7 +39,7 @@ public final class Volume implements JsonSerializable { private List secrets; /* - * Mount options used while mounting the AzureFile. Must be a comma-separated string. + * Mount options used while mounting the Azure file share or NFS Azure file share. Must be a comma-separated string. */ private String mountOptions; @@ -132,7 +132,8 @@ public Volume withSecrets(List secrets) { } /** - * Get the mountOptions property: Mount options used while mounting the AzureFile. Must be a comma-separated string. + * Get the mountOptions property: Mount options used while mounting the Azure file share or NFS Azure file share. + * Must be a comma-separated string. * * @return the mountOptions value. */ @@ -141,7 +142,8 @@ public String mountOptions() { } /** - * Set the mountOptions property: Mount options used while mounting the AzureFile. Must be a comma-separated string. + * Set the mountOptions property: Mount options used while mounting the Azure file share or NFS Azure file share. + * Must be a comma-separated string. * * @param mountOptions the mountOptions value to set. * @return the Volume object itself. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowArtifacts.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowArtifacts.java new file mode 100644 index 0000000000000..9c7938f32a4b2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowArtifacts.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The workflow filter. + */ +@Fluent +public final class WorkflowArtifacts implements JsonSerializable { + /* + * Application settings of the workflow. + */ + private Object appSettings; + + /* + * Files of the app. + */ + private Object files; + + /* + * Files of the app to delete. + */ + private List filesToDelete; + + /** + * Creates an instance of WorkflowArtifacts class. + */ + public WorkflowArtifacts() { + } + + /** + * Get the appSettings property: Application settings of the workflow. + * + * @return the appSettings value. + */ + public Object appSettings() { + return this.appSettings; + } + + /** + * Set the appSettings property: Application settings of the workflow. + * + * @param appSettings the appSettings value to set. + * @return the WorkflowArtifacts object itself. + */ + public WorkflowArtifacts withAppSettings(Object appSettings) { + this.appSettings = appSettings; + return this; + } + + /** + * Get the files property: Files of the app. + * + * @return the files value. + */ + public Object files() { + return this.files; + } + + /** + * Set the files property: Files of the app. + * + * @param files the files value to set. + * @return the WorkflowArtifacts object itself. + */ + public WorkflowArtifacts withFiles(Object files) { + this.files = files; + return this; + } + + /** + * Get the filesToDelete property: Files of the app to delete. + * + * @return the filesToDelete value. + */ + public List filesToDelete() { + return this.filesToDelete; + } + + /** + * Set the filesToDelete property: Files of the app to delete. + * + * @param filesToDelete the filesToDelete value to set. + * @return the WorkflowArtifacts object itself. + */ + public WorkflowArtifacts withFilesToDelete(List filesToDelete) { + this.filesToDelete = filesToDelete; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeUntypedField("appSettings", this.appSettings); + jsonWriter.writeUntypedField("files", this.files); + jsonWriter.writeArrayField("filesToDelete", this.filesToDelete, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkflowArtifacts from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkflowArtifacts if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkflowArtifacts. + */ + public static WorkflowArtifacts fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkflowArtifacts deserializedWorkflowArtifacts = new WorkflowArtifacts(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appSettings".equals(fieldName)) { + deserializedWorkflowArtifacts.appSettings = reader.readUntyped(); + } else if ("files".equals(fieldName)) { + deserializedWorkflowArtifacts.files = reader.readUntyped(); + } else if ("filesToDelete".equals(fieldName)) { + List filesToDelete = reader.readArray(reader1 -> reader1.getString()); + deserializedWorkflowArtifacts.filesToDelete = filesToDelete; + } else { + reader.skipChildren(); + } + } + + return deserializedWorkflowArtifacts; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowEnvelope.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowEnvelope.java new file mode 100644 index 0000000000000..a336b2e04a279 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowEnvelope.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.resourcemanager.appcontainers.fluent.models.WorkflowEnvelopeInner; + +/** + * An immutable client-side representation of WorkflowEnvelope. + */ +public interface WorkflowEnvelope { + /** + * Gets the id property: The resource id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Gets the resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Gets the resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the kind property: The resource kind. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the location property: The resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the properties property: Additional workflow properties. + * + * @return the properties value. + */ + WorkflowEnvelopeProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.WorkflowEnvelopeInner object. + * + * @return the inner object. + */ + WorkflowEnvelopeInner innerModel(); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowEnvelopeCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowEnvelopeCollection.java new file mode 100644 index 0000000000000..0486c23645b5d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowEnvelopeCollection.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appcontainers.fluent.models.WorkflowEnvelopeInner; +import java.io.IOException; +import java.util.List; + +/** + * Collection of workflow information elements. + */ +@Fluent +public final class WorkflowEnvelopeCollection implements JsonSerializable { + /* + * Collection of resources. + */ + private List value; + + /* + * Link to next page of resources. + */ + private String nextLink; + + /** + * Creates an instance of WorkflowEnvelopeCollection class. + */ + public WorkflowEnvelopeCollection() { + } + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the WorkflowEnvelopeCollection object itself. + */ + public WorkflowEnvelopeCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model WorkflowEnvelopeCollection")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkflowEnvelopeCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkflowEnvelopeCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkflowEnvelopeCollection if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WorkflowEnvelopeCollection. + */ + public static WorkflowEnvelopeCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkflowEnvelopeCollection deserializedWorkflowEnvelopeCollection = new WorkflowEnvelopeCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> WorkflowEnvelopeInner.fromJson(reader1)); + deserializedWorkflowEnvelopeCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedWorkflowEnvelopeCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkflowEnvelopeCollection; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowEnvelopeProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowEnvelopeProperties.java new file mode 100644 index 0000000000000..0b02ca1d55b6e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowEnvelopeProperties.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Additional workflow properties. + */ +@Fluent +public final class WorkflowEnvelopeProperties implements JsonSerializable { + /* + * Gets or sets the files. + */ + private Object files; + + /* + * Gets or sets the state of the workflow. + */ + private WorkflowState flowState; + + /* + * Gets or sets workflow health. + */ + private WorkflowHealth health; + + /** + * Creates an instance of WorkflowEnvelopeProperties class. + */ + public WorkflowEnvelopeProperties() { + } + + /** + * Get the files property: Gets or sets the files. + * + * @return the files value. + */ + public Object files() { + return this.files; + } + + /** + * Set the files property: Gets or sets the files. + * + * @param files the files value to set. + * @return the WorkflowEnvelopeProperties object itself. + */ + public WorkflowEnvelopeProperties withFiles(Object files) { + this.files = files; + return this; + } + + /** + * Get the flowState property: Gets or sets the state of the workflow. + * + * @return the flowState value. + */ + public WorkflowState flowState() { + return this.flowState; + } + + /** + * Set the flowState property: Gets or sets the state of the workflow. + * + * @param flowState the flowState value to set. + * @return the WorkflowEnvelopeProperties object itself. + */ + public WorkflowEnvelopeProperties withFlowState(WorkflowState flowState) { + this.flowState = flowState; + return this; + } + + /** + * Get the health property: Gets or sets workflow health. + * + * @return the health value. + */ + public WorkflowHealth health() { + return this.health; + } + + /** + * Set the health property: Gets or sets workflow health. + * + * @param health the health value to set. + * @return the WorkflowEnvelopeProperties object itself. + */ + public WorkflowEnvelopeProperties withHealth(WorkflowHealth health) { + this.health = health; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (health() != null) { + health().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeUntypedField("files", this.files); + jsonWriter.writeStringField("flowState", this.flowState == null ? null : this.flowState.toString()); + jsonWriter.writeJsonField("health", this.health); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkflowEnvelopeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkflowEnvelopeProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkflowEnvelopeProperties. + */ + public static WorkflowEnvelopeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkflowEnvelopeProperties deserializedWorkflowEnvelopeProperties = new WorkflowEnvelopeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("files".equals(fieldName)) { + deserializedWorkflowEnvelopeProperties.files = reader.readUntyped(); + } else if ("flowState".equals(fieldName)) { + deserializedWorkflowEnvelopeProperties.flowState = WorkflowState.fromString(reader.getString()); + } else if ("health".equals(fieldName)) { + deserializedWorkflowEnvelopeProperties.health = WorkflowHealth.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkflowEnvelopeProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowHealth.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowHealth.java new file mode 100644 index 0000000000000..f141ff4b75d75 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowHealth.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the workflow health. + */ +@Fluent +public final class WorkflowHealth implements JsonSerializable { + /* + * Gets or sets the workflow health state. + */ + private WorkflowHealthState state; + + /* + * Gets or sets the workflow error. + */ + private ErrorEntity error; + + /** + * Creates an instance of WorkflowHealth class. + */ + public WorkflowHealth() { + } + + /** + * Get the state property: Gets or sets the workflow health state. + * + * @return the state value. + */ + public WorkflowHealthState state() { + return this.state; + } + + /** + * Set the state property: Gets or sets the workflow health state. + * + * @param state the state value to set. + * @return the WorkflowHealth object itself. + */ + public WorkflowHealth withState(WorkflowHealthState state) { + this.state = state; + return this; + } + + /** + * Get the error property: Gets or sets the workflow error. + * + * @return the error value. + */ + public ErrorEntity error() { + return this.error; + } + + /** + * Set the error property: Gets or sets the workflow error. + * + * @param error the error value to set. + * @return the WorkflowHealth object itself. + */ + public WorkflowHealth withError(ErrorEntity error) { + this.error = error; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (state() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property state in model WorkflowHealth")); + } + if (error() != null) { + error().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkflowHealth.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkflowHealth from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkflowHealth if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WorkflowHealth. + */ + public static WorkflowHealth fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkflowHealth deserializedWorkflowHealth = new WorkflowHealth(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedWorkflowHealth.state = WorkflowHealthState.fromString(reader.getString()); + } else if ("error".equals(fieldName)) { + deserializedWorkflowHealth.error = ErrorEntity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkflowHealth; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowHealthState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowHealthState.java new file mode 100644 index 0000000000000..ef6bef9d07522 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowHealthState.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +/** + * Gets or sets the workflow health state. + */ +public enum WorkflowHealthState { + /** + * Enum value NotSpecified. + */ + NOT_SPECIFIED("NotSpecified"), + + /** + * Enum value Healthy. + */ + HEALTHY("Healthy"), + + /** + * Enum value Unhealthy. + */ + UNHEALTHY("Unhealthy"), + + /** + * Enum value Unknown. + */ + UNKNOWN("Unknown"); + + /** + * The actual serialized value for a WorkflowHealthState instance. + */ + private final String value; + + WorkflowHealthState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a WorkflowHealthState instance. + * + * @param value the serialized value to parse. + * @return the parsed WorkflowHealthState object, or null if unable to parse. + */ + public static WorkflowHealthState fromString(String value) { + if (value == null) { + return null; + } + WorkflowHealthState[] items = WorkflowHealthState.values(); + for (WorkflowHealthState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowState.java new file mode 100644 index 0000000000000..9a6ebb3f9680e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The workflow state. + */ +public final class WorkflowState extends ExpandableStringEnum { + /** + * Static value NotSpecified for WorkflowState. + */ + public static final WorkflowState NOT_SPECIFIED = fromString("NotSpecified"); + + /** + * Static value Completed for WorkflowState. + */ + public static final WorkflowState COMPLETED = fromString("Completed"); + + /** + * Static value Enabled for WorkflowState. + */ + public static final WorkflowState ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for WorkflowState. + */ + public static final WorkflowState DISABLED = fromString("Disabled"); + + /** + * Static value Deleted for WorkflowState. + */ + public static final WorkflowState DELETED = fromString("Deleted"); + + /** + * Static value Suspended for WorkflowState. + */ + public static final WorkflowState SUSPENDED = fromString("Suspended"); + + /** + * Creates a new instance of WorkflowState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WorkflowState() { + } + + /** + * Creates or finds a WorkflowState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkflowState. + */ + public static WorkflowState fromString(String name) { + return fromString(name, WorkflowState.class); + } + + /** + * Gets known WorkflowState values. + * + * @return known WorkflowState values. + */ + public static Collection values() { + return values(WorkflowState.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkloadProfile.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkloadProfile.java index 78d195bd398b5..27110830fd9e2 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkloadProfile.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkloadProfile.java @@ -22,6 +22,11 @@ public final class WorkloadProfile implements JsonSerializable */ private String name; + /* + * Whether to use a FIPS-enabled OS. Supported only for dedicated workload profiles. + */ + private Boolean enableFips; + /* * Workload profile type for the workloads to run on. */ @@ -63,6 +68,26 @@ public WorkloadProfile withName(String name) { return this; } + /** + * Get the enableFips property: Whether to use a FIPS-enabled OS. Supported only for dedicated workload profiles. + * + * @return the enableFips value. + */ + public Boolean enableFips() { + return this.enableFips; + } + + /** + * Set the enableFips property: Whether to use a FIPS-enabled OS. Supported only for dedicated workload profiles. + * + * @param enableFips the enableFips value to set. + * @return the WorkloadProfile object itself. + */ + public WorkloadProfile withEnableFips(Boolean enableFips) { + this.enableFips = enableFips; + return this; + } + /** * Get the workloadProfileType property: Workload profile type for the workloads to run on. * @@ -150,6 +175,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("name", this.name); jsonWriter.writeStringField("workloadProfileType", this.workloadProfileType); + jsonWriter.writeBooleanField("enableFips", this.enableFips); jsonWriter.writeNumberField("minimumCount", this.minimumCount); jsonWriter.writeNumberField("maximumCount", this.maximumCount); return jsonWriter.writeEndObject(); @@ -175,6 +201,8 @@ public static WorkloadProfile fromJson(JsonReader jsonReader) throws IOException deserializedWorkloadProfile.name = reader.getString(); } else if ("workloadProfileType".equals(fieldName)) { deserializedWorkloadProfile.workloadProfileType = reader.getString(); + } else if ("enableFips".equals(fieldName)) { + deserializedWorkloadProfile.enableFips = reader.getNullable(JsonReader::getBoolean); } else if ("minimumCount".equals(fieldName)) { deserializedWorkloadProfile.minimumCount = reader.getNullable(JsonReader::getInt); } else if ("maximumCount".equals(fieldName)) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/package-info.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/package-info.java index a5d836af42d9f..c0b9d82b3bd07 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/package-info.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/package-info.java @@ -4,6 +4,8 @@ /** * Package containing the data models for ContainerAppsApiClient. - * null. + * Functions is an extension resource to revisions and the api listed is used to proxy the call from Web RP to the + * function app's host process, this api is not exposed to users and only Web RP is allowed to invoke functions + * extension resource. */ package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/package-info.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/package-info.java index 82dc538e0b9f7..5e8cbf3c1591d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/package-info.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/package-info.java @@ -4,6 +4,8 @@ /** * Package containing the classes for ContainerAppsApiClient. - * null. + * Functions is an extension resource to revisions and the api listed is used to proxy the call from Web RP to the + * function app's host process, this api is not exposed to users and only Web RP is allowed to invoke functions + * extension resource. */ package com.azure.resourcemanager.appcontainers; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-appcontainers/proxy-config.json b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-appcontainers/proxy-config.json index 64676a1f668ce..6f609874b9071 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-appcontainers/proxy-config.json +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-appcontainers/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.appcontainers.implementation.AvailableWorkloadProfilesClientImpl$AvailableWorkloadProfilesService"],["com.azure.resourcemanager.appcontainers.implementation.BillingMetersClientImpl$BillingMetersService"],["com.azure.resourcemanager.appcontainers.implementation.CertificatesClientImpl$CertificatesService"],["com.azure.resourcemanager.appcontainers.implementation.ConnectedEnvironmentsCertificatesClientImpl$ConnectedEnvironmentsCertificatesService"],["com.azure.resourcemanager.appcontainers.implementation.ConnectedEnvironmentsClientImpl$ConnectedEnvironmentsService"],["com.azure.resourcemanager.appcontainers.implementation.ConnectedEnvironmentsDaprComponentsClientImpl$ConnectedEnvironmentsDaprComponentsService"],["com.azure.resourcemanager.appcontainers.implementation.ConnectedEnvironmentsStoragesClientImpl$ConnectedEnvironmentsStoragesService"],["com.azure.resourcemanager.appcontainers.implementation.ContainerAppsAuthConfigsClientImpl$ContainerAppsAuthConfigsService"],["com.azure.resourcemanager.appcontainers.implementation.ContainerAppsClientImpl$ContainerAppsService"],["com.azure.resourcemanager.appcontainers.implementation.ContainerAppsDiagnosticsClientImpl$ContainerAppsDiagnosticsService"],["com.azure.resourcemanager.appcontainers.implementation.ContainerAppsRevisionReplicasClientImpl$ContainerAppsRevisionReplicasService"],["com.azure.resourcemanager.appcontainers.implementation.ContainerAppsRevisionsClientImpl$ContainerAppsRevisionsService"],["com.azure.resourcemanager.appcontainers.implementation.ContainerAppsSourceControlsClientImpl$ContainerAppsSourceControlsService"],["com.azure.resourcemanager.appcontainers.implementation.DaprComponentsClientImpl$DaprComponentsService"],["com.azure.resourcemanager.appcontainers.implementation.JobsClientImpl$JobsService"],["com.azure.resourcemanager.appcontainers.implementation.JobsExecutionsClientImpl$JobsExecutionsService"],["com.azure.resourcemanager.appcontainers.implementation.ManagedCertificatesClientImpl$ManagedCertificatesService"],["com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentDiagnosticsClientImpl$ManagedEnvironmentDiagnosticsService"],["com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentUsagesClientImpl$ManagedEnvironmentUsagesService"],["com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentsClientImpl$ManagedEnvironmentsService"],["com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentsDiagnosticsClientImpl$ManagedEnvironmentsDiagnosticsService"],["com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentsStoragesClientImpl$ManagedEnvironmentsStoragesService"],["com.azure.resourcemanager.appcontainers.implementation.NamespacesClientImpl$NamespacesService"],["com.azure.resourcemanager.appcontainers.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.appcontainers.implementation.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.appcontainers.implementation.UsagesClientImpl$UsagesService"]] \ No newline at end of file +[["com.azure.resourcemanager.appcontainers.implementation.AppResilienciesClientImpl$AppResilienciesService"],["com.azure.resourcemanager.appcontainers.implementation.AvailableWorkloadProfilesClientImpl$AvailableWorkloadProfilesService"],["com.azure.resourcemanager.appcontainers.implementation.BillingMetersClientImpl$BillingMetersService"],["com.azure.resourcemanager.appcontainers.implementation.BuildAuthTokensClientImpl$BuildAuthTokensService"],["com.azure.resourcemanager.appcontainers.implementation.BuildersClientImpl$BuildersService"],["com.azure.resourcemanager.appcontainers.implementation.BuildsByBuilderResourcesClientImpl$BuildsByBuilderResourcesService"],["com.azure.resourcemanager.appcontainers.implementation.BuildsClientImpl$BuildsService"],["com.azure.resourcemanager.appcontainers.implementation.CertificatesClientImpl$CertificatesService"],["com.azure.resourcemanager.appcontainers.implementation.ConnectedEnvironmentsCertificatesClientImpl$ConnectedEnvironmentsCertificatesService"],["com.azure.resourcemanager.appcontainers.implementation.ConnectedEnvironmentsClientImpl$ConnectedEnvironmentsService"],["com.azure.resourcemanager.appcontainers.implementation.ConnectedEnvironmentsDaprComponentsClientImpl$ConnectedEnvironmentsDaprComponentsService"],["com.azure.resourcemanager.appcontainers.implementation.ConnectedEnvironmentsStoragesClientImpl$ConnectedEnvironmentsStoragesService"],["com.azure.resourcemanager.appcontainers.implementation.ContainerAppsAuthConfigsClientImpl$ContainerAppsAuthConfigsService"],["com.azure.resourcemanager.appcontainers.implementation.ContainerAppsBuildsByContainerAppsClientImpl$ContainerAppsBuildsByContainerAppsService"],["com.azure.resourcemanager.appcontainers.implementation.ContainerAppsBuildsClientImpl$ContainerAppsBuildsService"],["com.azure.resourcemanager.appcontainers.implementation.ContainerAppsClientImpl$ContainerAppsService"],["com.azure.resourcemanager.appcontainers.implementation.ContainerAppsDiagnosticsClientImpl$ContainerAppsDiagnosticsService"],["com.azure.resourcemanager.appcontainers.implementation.ContainerAppsPatchesClientImpl$ContainerAppsPatchesService"],["com.azure.resourcemanager.appcontainers.implementation.ContainerAppsRevisionReplicasClientImpl$ContainerAppsRevisionReplicasService"],["com.azure.resourcemanager.appcontainers.implementation.ContainerAppsRevisionsClientImpl$ContainerAppsRevisionsService"],["com.azure.resourcemanager.appcontainers.implementation.ContainerAppsSessionPoolsClientImpl$ContainerAppsSessionPoolsService"],["com.azure.resourcemanager.appcontainers.implementation.ContainerAppsSourceControlsClientImpl$ContainerAppsSourceControlsService"],["com.azure.resourcemanager.appcontainers.implementation.DaprComponentResiliencyPoliciesClientImpl$DaprComponentResiliencyPoliciesService"],["com.azure.resourcemanager.appcontainers.implementation.DaprComponentsClientImpl$DaprComponentsService"],["com.azure.resourcemanager.appcontainers.implementation.DaprSubscriptionsClientImpl$DaprSubscriptionsService"],["com.azure.resourcemanager.appcontainers.implementation.DotNetComponentsClientImpl$DotNetComponentsService"],["com.azure.resourcemanager.appcontainers.implementation.FunctionsExtensionsClientImpl$FunctionsExtensionsService"],["com.azure.resourcemanager.appcontainers.implementation.JavaComponentsClientImpl$JavaComponentsService"],["com.azure.resourcemanager.appcontainers.implementation.JobsClientImpl$JobsService"],["com.azure.resourcemanager.appcontainers.implementation.JobsExecutionsClientImpl$JobsExecutionsService"],["com.azure.resourcemanager.appcontainers.implementation.LogicAppsClientImpl$LogicAppsService"],["com.azure.resourcemanager.appcontainers.implementation.ManagedCertificatesClientImpl$ManagedCertificatesService"],["com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentDiagnosticsClientImpl$ManagedEnvironmentDiagnosticsService"],["com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentPrivateEndpointConnectionsClientImpl$ManagedEnvironmentPrivateEndpointConnectionsService"],["com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentPrivateLinkResourcesClientImpl$ManagedEnvironmentPrivateLinkResourcesService"],["com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentUsagesClientImpl$ManagedEnvironmentUsagesService"],["com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentsClientImpl$ManagedEnvironmentsService"],["com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentsDiagnosticsClientImpl$ManagedEnvironmentsDiagnosticsService"],["com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentsStoragesClientImpl$ManagedEnvironmentsStoragesService"],["com.azure.resourcemanager.appcontainers.implementation.NamespacesClientImpl$NamespacesService"],["com.azure.resourcemanager.appcontainers.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.appcontainers.implementation.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.appcontainers.implementation.UsagesClientImpl$UsagesService"]] \ No newline at end of file diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AppResiliencyCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AppResiliencyCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..a655e3e64ef75 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AppResiliencyCreateOrUpdateSamples.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.CircuitBreakerPolicy; +import com.azure.resourcemanager.appcontainers.models.HeaderMatch; +import com.azure.resourcemanager.appcontainers.models.HttpConnectionPool; +import com.azure.resourcemanager.appcontainers.models.HttpRetryPolicy; +import com.azure.resourcemanager.appcontainers.models.TcpConnectionPool; +import com.azure.resourcemanager.appcontainers.models.TcpRetryPolicy; +import com.azure.resourcemanager.appcontainers.models.TimeoutPolicy; +import java.util.Arrays; + +/** + * Samples for AppResiliency CreateOrUpdate. + */ +public final class AppResiliencyCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AppResiliency_CreateOrUpdate + * .json + */ + /** + * Sample code: Create or Update App Resiliency. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + createOrUpdateAppResiliency(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.appResiliencies() + .define("resiliency-policy-1") + .withExistingContainerApp("rg", "testcontainerApp0") + .withTimeoutPolicy(new TimeoutPolicy().withResponseTimeoutInSeconds(15).withConnectionTimeoutInSeconds(5)) + .withHttpRetryPolicy( + new HttpRetryPolicy().withMaxRetries(5) + .withInitialDelayInMilliseconds(1000L) + .withMaxIntervalInMilliseconds(10000L) + .withHeaders( + Arrays.asList(new HeaderMatch().withHeaderProperty("X-Content-Type").withPrefixMatch("GOATS"))) + .withHttpStatusCodes(Arrays.asList(502, 503)) + .withErrors(Arrays.asList("5xx", "connect-failure", "reset", "retriable-headers", + "retriable-status-codes"))) + .withTcpRetryPolicy(new TcpRetryPolicy().withMaxConnectAttempts(3)) + .withCircuitBreakerPolicy(new CircuitBreakerPolicy().withConsecutiveErrors(5) + .withIntervalInSeconds(10) + .withMaxEjectionPercent(50)) + .withHttpConnectionPool( + new HttpConnectionPool().withHttp1MaxPendingRequests(1024).withHttp2MaxRequests(1024)) + .withTcpConnectionPool(new TcpConnectionPool().withMaxConnections(100)) + .create(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AppResiliencyDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AppResiliencyDeleteSamples.java new file mode 100644 index 0000000000000..5f243cf60b93c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AppResiliencyDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for AppResiliency Delete. + */ +public final class AppResiliencyDeleteSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AppResiliency_Delete.json + */ + /** + * Sample code: Delete App Resiliency. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteAppResiliency(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.appResiliencies() + .deleteWithResponse("rg", "testcontainerApp0", "resiliency-policy-1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AppResiliencyGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AppResiliencyGetSamples.java new file mode 100644 index 0000000000000..670ab66923862 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AppResiliencyGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for AppResiliency Get. + */ +public final class AppResiliencyGetSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AppResiliency_Get.json + */ + /** + * Sample code: Get App Resiliency. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getAppResiliency(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.appResiliencies() + .getWithResponse("rg", "testcontainerApp0", "resiliency-policy-1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AppResiliencyListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AppResiliencyListSamples.java new file mode 100644 index 0000000000000..022fbc84dd4be --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AppResiliencyListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for AppResiliency List. + */ +public final class AppResiliencyListSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AppResiliency_List.json + */ + /** + * Sample code: List App Resiliency. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listAppResiliency(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.appResiliencies().list("rg", "testcontainerApp0", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AppResiliencyUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AppResiliencyUpdateSamples.java new file mode 100644 index 0000000000000..8c2670f7cc53a --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AppResiliencyUpdateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.AppResiliency; +import com.azure.resourcemanager.appcontainers.models.TimeoutPolicy; + +/** + * Samples for AppResiliency Update. + */ +public final class AppResiliencyUpdateSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AppResiliency_Patch.json + */ + /** + * Sample code: Update App Resiliency. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void updateAppResiliency(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + AppResiliency resource = manager.appResiliencies() + .getWithResponse("rg", "testcontainerApp0", "resiliency-policy-1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTimeoutPolicy(new TimeoutPolicy().withResponseTimeoutInSeconds(30).withConnectionTimeoutInSeconds(40)) + .apply(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilesGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilesGetSamples.java index a743f3bc8d693..a12d7a7123a3a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilesGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilesGetSamples.java @@ -9,8 +9,8 @@ */ public final class AvailableWorkloadProfilesGetSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/AvailableWorkloadProfiles_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * AvailableWorkloadProfiles_Get.json */ /** * Sample code: BillingMeters_Get. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BillingMetersGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BillingMetersGetSamples.java index 49da87a0b63bf..1e5e9c0983c09 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BillingMetersGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BillingMetersGetSamples.java @@ -10,7 +10,7 @@ public final class BillingMetersGetSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/BillingMeters_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/BillingMeters_Get.json */ /** * Sample code: BillingMeters_Get. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildAuthTokenListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildAuthTokenListSamples.java new file mode 100644 index 0000000000000..45d362c81aa80 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildAuthTokenListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for BuildAuthToken List. + */ +public final class BuildAuthTokenListSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builds_ListAuthToken.json + */ + /** + * Sample code: Get Build Auth Token. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getBuildAuthToken(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.buildAuthTokens().listWithResponse("rg", "testBuilder", "testBuild", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildersCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..e9e8a6ba2f2e6 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildersCreateOrUpdateSamples.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.ContainerRegistry; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.appcontainers.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Builders CreateOrUpdate. + */ +public final class BuildersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_CreateOrUpdate.json + */ + /** + * Sample code: Builders_CreateOrUpdate_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + buildersCreateOrUpdate0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.builders() + .define("testBuilder") + .withRegion("eastus") + .withExistingResourceGroup("rg") + .withTags(mapOf("company", "Microsoft")) + .withIdentity(new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new UserAssignedIdentity()))) + .withEnvironmentId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/managedEnvironments/testEnv") + .withContainerRegistries(Arrays.asList(new ContainerRegistry() + .withContainerRegistryServer("test.azurecr.io") + .withIdentityResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"), + new ContainerRegistry().withContainerRegistryServer("test2.azurecr.io") + .withIdentityResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildersDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildersDeleteSamples.java new file mode 100644 index 0000000000000..607a1d8c3eb07 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildersDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for Builders Delete. + */ +public final class BuildersDeleteSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_Delete.json + */ + /** + * Sample code: Builders_Delete_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void buildersDelete0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.builders().delete("rg", "testBuilder", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildersGetByResourceGroupSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildersGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..8d647b3858e61 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildersGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for Builders GetByResourceGroup. + */ +public final class BuildersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_Get.json + */ + /** + * Sample code: Builders_Get_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void buildersGet0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.builders().getByResourceGroupWithResponse("rg", "testBuilder", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildersListByResourceGroupSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildersListByResourceGroupSamples.java new file mode 100644 index 0000000000000..0364f5cb3260e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildersListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for Builders ListByResourceGroup. + */ +public final class BuildersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_ListByResourceGroup + * .json + */ + /** + * Sample code: Builders_ListByResourceGroup_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + buildersListByResourceGroup0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.builders().listByResourceGroup("rg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildersListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildersListSamples.java new file mode 100644 index 0000000000000..e9c08445ff528 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildersListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for Builders List. + */ +public final class BuildersListSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_ListBySubscription. + * json + */ + /** + * Sample code: Builders_ListBySubscription_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + buildersListBySubscription0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.builders().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildersUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildersUpdateSamples.java new file mode 100644 index 0000000000000..c1058b7caa3d7 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildersUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.BuilderResource; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Builders Update. + */ +public final class BuildersUpdateSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_Update.json + */ + /** + * Sample code: Builders_Update_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void buildersUpdate0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + BuilderResource resource = manager.builders() + .getByResourceGroupWithResponse("rg", "testBuilder", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("mytag1", "myvalue1")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildsByBuilderResourceListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildsByBuilderResourceListSamples.java new file mode 100644 index 0000000000000..47c677bbd637d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildsByBuilderResourceListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for BuildsByBuilderResource List. + */ +public final class BuildsByBuilderResourceListSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builds_ListByBuilderResource + * .json + */ + /** + * Sample code: Builds_ListByBuilderResource_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + buildsListByBuilderResource0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.buildsByBuilderResources().list("rg", "testBuilder", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..888b6b413aff2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildsCreateOrUpdateSamples.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.BuildConfiguration; +import com.azure.resourcemanager.appcontainers.models.ContainerRegistryWithCustomImage; +import com.azure.resourcemanager.appcontainers.models.EnvironmentVariable; +import com.azure.resourcemanager.appcontainers.models.HttpGet; +import com.azure.resourcemanager.appcontainers.models.PreBuildStep; +import java.util.Arrays; + +/** + * Samples for Builds CreateOrUpdate. + */ +public final class BuildsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builds_CreateOrUpdate.json + */ + /** + * Sample code: Builds_CreateOrUpdate_WithConfig. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + buildsCreateOrUpdateWithConfig(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.builds() + .define("testBuild-123456789az") + .withExistingBuilder("rg", "testBuilder") + .withDestinationContainerRegistry(new ContainerRegistryWithCustomImage().withServer("test.azurecr.io") + .withImage("test.azurecr.io/repo:tag")) + .withConfiguration(new BuildConfiguration().withBaseOs("DebianBullseye") + .withPlatform("dotnetcore") + .withPlatformVersion("7.0") + .withEnvironmentVariables(Arrays.asList(new EnvironmentVariable().withName("foo1").withValue("bar1"), + new EnvironmentVariable().withName("foo2").withValue("bar2"))) + .withPreBuildSteps(Arrays.asList( + new PreBuildStep().withDescription("First pre build step.") + .withScripts(Arrays.asList("echo 'hello'", "echo 'world'")) + .withHttpGet(new HttpGet().withUrl("https://microsoft.com") + .withFileName("output.txt") + .withHeaders(Arrays.asList("foo", "bar"))), + new PreBuildStep().withDescription("Second pre build step.") + .withScripts(Arrays.asList("echo 'hello'", "echo 'again'")) + .withHttpGet(new HttpGet().withUrl("https://microsoft.com") + .withFileName("output.txt") + .withHeaders(Arrays.asList("foo")))))) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * Builds_CreateOrUpdate_NoConfig.json + */ + /** + * Sample code: Builds_CreateOrUpdate_NoConfig. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + buildsCreateOrUpdateNoConfig(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.builds().define("testBuild").withExistingBuilder("rg", "testBuilder").create(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildsDeleteSamples.java new file mode 100644 index 0000000000000..389843972d58e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for Builds Delete. + */ +public final class BuildsDeleteSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builds_Delete.json + */ + /** + * Sample code: Builds_Delete_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void buildsDelete0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.builds().delete("rg", "testBuilder", "testBuild", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildsGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildsGetSamples.java new file mode 100644 index 0000000000000..790eea4af08d3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BuildsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for Builds Get. + */ +public final class BuildsGetSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builds_Get.json + */ + /** + * Sample code: Builds_Get_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void buildsGet0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.builds().getWithResponse("rg", "testBuilder", "testBuild", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesCreateOrUpdateSamples.java index d87594f1e45e7..d48c5b3b5427f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesCreateOrUpdateSamples.java @@ -5,15 +5,40 @@ package com.azure.resourcemanager.appcontainers.generated; import com.azure.resourcemanager.appcontainers.fluent.models.CertificateInner; +import com.azure.resourcemanager.appcontainers.models.CertificateKeyVaultProperties; import com.azure.resourcemanager.appcontainers.models.CertificateProperties; +import com.azure.resourcemanager.appcontainers.models.CertificateType; /** * Samples for Certificates CreateOrUpdate. */ public final class CertificatesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * Certificate_CreateOrUpdate_FromKeyVault.json + */ + /** + * Sample code: Create or Update Certificate using Managed Identity. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateCertificateUsingManagedIdentity( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.certificates() + .createOrUpdateWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", + new CertificateInner().withLocation("East US") + .withProperties(new CertificateProperties() + .withCertificateKeyVaultProperties(new CertificateKeyVaultProperties().withIdentity( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/microsoft.managedidentity/userassignedidentities/test-user-mi") + .withKeyVaultUrl("fakeTokenPlaceholder")) + .withCertificateType(CertificateType.SERVER_SSLCERTIFICATE)), + com.azure.core.util.Context.NONE); + } + /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificate_CreateOrUpdate.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificate_CreateOrUpdate. + * json */ /** * Sample code: Create or Update Certificate. @@ -26,7 +51,8 @@ public final class CertificatesCreateOrUpdateSamples { .createOrUpdateWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", new CertificateInner().withLocation("East US") .withProperties(new CertificateProperties().withPassword("fakeTokenPlaceholder") - .withValue("Y2VydA==".getBytes())), + .withValue("Y2VydA==".getBytes()) + .withCertificateType(CertificateType.IMAGE_PULL_TRUSTED_CA)), com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesDeleteSamples.java index 6c736ff3b2744..08afcdbf2e23a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesDeleteSamples.java @@ -10,7 +10,7 @@ public final class CertificatesDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificate_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificate_Delete.json */ /** * Sample code: Delete Certificate. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesGetSamples.java index 6e1b220689552..47a47515f36a0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesGetSamples.java @@ -10,7 +10,7 @@ public final class CertificatesGetSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificate_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificate_Get.json */ /** * Sample code: Get Certificate. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesListSamples.java index ebf41a6ece997..8662b17bb6cba 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesListSamples.java @@ -9,9 +9,8 @@ */ public final class CertificatesListSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificates_ListByManagedEnvironment - * .json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * Certificates_ListByManagedEnvironment.json */ /** * Sample code: List Certificates by Managed Environment. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesUpdateSamples.java index 7b6401dd72ea7..15102202b7c31 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesUpdateSamples.java @@ -14,7 +14,7 @@ public final class CertificatesUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificates_Patch.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificates_Patch.json */ /** * Sample code: Patch Certificate. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesCreateOrUpdateSamples.java index 0b537d554d639..0d9f1a91a4970 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesCreateOrUpdateSamples.java @@ -11,7 +11,7 @@ */ public final class ConnectedEnvironmentsCertificatesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ConnectedEnvironmentsCertificate_CreateOrUpdate.json */ /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesDeleteSamples.java index ab352ced853fd..6306306c35d93 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class ConnectedEnvironmentsCertificatesDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ConnectedEnvironmentsCertificate_Delete.json */ /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesGetSamples.java index b8a837d21fc17..8cdb91ea0feba 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesGetSamples.java @@ -9,9 +9,8 @@ */ public final class ConnectedEnvironmentsCertificatesGetSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsCertificate_Get. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironmentsCertificate_Get.json */ /** * Sample code: Get Certificate. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesListSamples.java index de96329e808e5..71bf1736d13bc 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesListSamples.java @@ -9,7 +9,7 @@ */ public final class ConnectedEnvironmentsCertificatesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json */ /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesUpdateSamples.java index 801e465114224..94a92b8ee1172 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesUpdateSamples.java @@ -13,7 +13,7 @@ */ public final class ConnectedEnvironmentsCertificatesUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ConnectedEnvironmentsCertificates_Patch.json */ /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCheckNameAvailabilitySamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCheckNameAvailabilitySamples.java index 2fe2280d612d3..08100a185f5e1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCheckNameAvailabilitySamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCheckNameAvailabilitySamples.java @@ -11,7 +11,7 @@ */ public final class ConnectedEnvironmentsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ConnectedEnvironmentsCertificates_CheckNameAvailability.json */ /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCreateOrUpdateSamples.java index 6fd6c551eb4e6..b86fb0b7cbb26 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCreateOrUpdateSamples.java @@ -11,9 +11,8 @@ */ public final class ConnectedEnvironmentsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironments_CreateOrUpdate. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironments_CreateOrUpdate.json */ /** * Sample code: Create kube environments. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsCreateOrUpdateSamples.java index 694863e6fd757..40144d4aa6a04 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsCreateOrUpdateSamples.java @@ -4,7 +4,9 @@ package com.azure.resourcemanager.appcontainers.generated; +import com.azure.resourcemanager.appcontainers.models.DaprComponentServiceBinding; import com.azure.resourcemanager.appcontainers.models.DaprMetadata; +import com.azure.resourcemanager.appcontainers.models.DaprServiceBindMetadata; import com.azure.resourcemanager.appcontainers.models.Secret; import java.util.Arrays; @@ -13,7 +15,7 @@ */ public final class ConnectedEnvironmentsDaprComponentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json */ /** @@ -36,6 +38,10 @@ public final class ConnectedEnvironmentsDaprComponentsCreateOrUpdateSamples { new DaprMetadata().withName("collection").withValue("items"), new DaprMetadata().withName("masterkey").withSecretRef("fakeTokenPlaceholder"))) .withScopes(Arrays.asList("container-app-1", "container-app-2")) + .withServiceComponentBind(Arrays.asList(new DaprComponentServiceBinding().withName("statestore") + .withServiceId( + "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis") + .withMetadata(new DaprServiceBindMetadata().withName("daprcomponentBind").withValue("redis-bind")))) .create(); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsDeleteSamples.java index 3c173d413bef8..e70ee6e10a3f5 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class ConnectedEnvironmentsDaprComponentsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ConnectedEnvironmentsDaprComponents_Delete.json */ /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsGetSamples.java index 00e79566b1b86..dad57a35024c6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsGetSamples.java @@ -9,7 +9,7 @@ */ public final class ConnectedEnvironmentsDaprComponentsGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ConnectedEnvironmentsDaprComponents_Get.json */ /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListSamples.java index fa7d391c93629..6b9cc0f5ae4a8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListSamples.java @@ -9,7 +9,7 @@ */ public final class ConnectedEnvironmentsDaprComponentsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ConnectedEnvironmentsDaprComponents_List.json */ /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListSecretsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListSecretsSamples.java index fdff058dc63e8..2cd3cc0fb7d94 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListSecretsSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListSecretsSamples.java @@ -9,7 +9,7 @@ */ public final class ConnectedEnvironmentsDaprComponentsListSecretsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ConnectedEnvironmentsDaprComponents_ListSecrets.json */ /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDeleteSamples.java index 59ad583a85824..dbd6a8ef2db22 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDeleteSamples.java @@ -10,7 +10,8 @@ public final class ConnectedEnvironmentsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironments_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironments_Delete + * .json */ /** * Sample code: Delete connected environment by connectedEnvironmentName. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsGetByResourceGroupSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsGetByResourceGroupSamples.java index 3726bc3f20331..4a1513f9a4a78 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsGetByResourceGroupSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsGetByResourceGroupSamples.java @@ -10,7 +10,8 @@ public final class ConnectedEnvironmentsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironments_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironments_Get. + * json */ /** * Sample code: Get connected environment by connectedEnvironmentName. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListByResourceGroupSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListByResourceGroupSamples.java index 6aad37d8eed5a..d8eb3c1f3aefb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListByResourceGroupSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class ConnectedEnvironmentsListByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ConnectedEnvironments_ListByResourceGroup.json */ /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListSamples.java index 14de3c94fb226..3f75a3e3bbbb0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListSamples.java @@ -9,7 +9,7 @@ */ public final class ConnectedEnvironmentsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ConnectedEnvironments_ListBySubscription.json */ /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesCreateOrUpdateSamples.java index f12e39933d6af..6d4af124e1a80 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesCreateOrUpdateSamples.java @@ -13,7 +13,7 @@ */ public final class ConnectedEnvironmentsStoragesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ConnectedEnvironmentsStorages_CreateOrUpdate.json */ /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesDeleteSamples.java index 361b14336095f..e1a810979bac0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesDeleteSamples.java @@ -9,9 +9,8 @@ */ public final class ConnectedEnvironmentsStoragesDeleteSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsStorages_Delete. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironmentsStorages_Delete.json */ /** * Sample code: List environments storages by subscription. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesGetSamples.java index cd817d0bb25ee..190191c171c58 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesGetSamples.java @@ -9,9 +9,8 @@ */ public final class ConnectedEnvironmentsStoragesGetSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsStorages_Get. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironmentsStorages_Get.json */ /** * Sample code: get a environments storage properties by subscription. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesListSamples.java index 9a6e850602bf3..6e70076ff3017 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesListSamples.java @@ -9,9 +9,8 @@ */ public final class ConnectedEnvironmentsStoragesListSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsStorages_List. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ConnectedEnvironmentsStorages_List.json */ /** * Sample code: List environments storages by subscription. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsUpdateSamples.java index 0a49b09f71993..6122dc7fdd37c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsUpdateSamples.java @@ -10,7 +10,8 @@ public final class ConnectedEnvironmentsUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironments_Patch.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironments_Patch. + * json */ /** * Sample code: Patch Managed Environment. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsCreateOrUpdateSamples.java index 2f6b98751bbeb..143d66b9a81c8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsCreateOrUpdateSamples.java @@ -18,7 +18,8 @@ public final class ContainerAppsAuthConfigsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/AuthConfigs_CreateOrUpdate.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AuthConfigs_CreateOrUpdate. + * json */ /** * Sample code: Create or Update Container App AuthConfig. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsDeleteSamples.java index 4792a764577bc..a49b07fbfbffe 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsDeleteSamples.java @@ -10,7 +10,7 @@ public final class ContainerAppsAuthConfigsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/AuthConfigs_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AuthConfigs_Delete.json */ /** * Sample code: Delete Container App AuthConfig. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsGetSamples.java index 4d593954a15e5..9417356a6833d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsGetSamples.java @@ -10,7 +10,7 @@ public final class ContainerAppsAuthConfigsGetSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/AuthConfigs_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AuthConfigs_Get.json */ /** * Sample code: Get Container App's AuthConfig. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsListByContainerAppSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsListByContainerAppSamples.java index 0eaf80d4f4856..143b77f848280 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsListByContainerAppSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsListByContainerAppSamples.java @@ -10,7 +10,8 @@ public final class ContainerAppsAuthConfigsListByContainerAppSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/AuthConfigs_ListByContainer.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AuthConfigs_ListByContainer. + * json */ /** * Sample code: List Auth Configs by Container Apps. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsBuildsByContainerAppListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsBuildsByContainerAppListSamples.java new file mode 100644 index 0000000000000..6686bd6a506e4 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsBuildsByContainerAppListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for ContainerAppsBuildsByContainerApp List. + */ +public final class ContainerAppsBuildsByContainerAppListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerAppsBuilds_ListByContainerApp.json + */ + /** + * Sample code: ContainerAppsBuilds_ListByContainerApp_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void containerAppsBuildsListByContainerApp0( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsBuildsByContainerApps().list("rg", "testCapp", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsBuildsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsBuildsDeleteSamples.java new file mode 100644 index 0000000000000..d794bce2bd4a9 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsBuildsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for ContainerAppsBuilds Delete. + */ +public final class ContainerAppsBuildsDeleteSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsBuilds_Delete. + * json + */ + /** + * Sample code: ContainerAppsBuilds_Delete_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + containerAppsBuildsDelete0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsBuilds().delete("rg", "testCapp", "testBuild", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsBuildsGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsBuildsGetSamples.java new file mode 100644 index 0000000000000..02938b7801e76 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsBuildsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for ContainerAppsBuilds Get. + */ +public final class ContainerAppsBuildsGetSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsBuilds_Get.json + */ + /** + * Sample code: ContainerAppsBuilds_Get_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + containerAppsBuildsGet0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsBuilds().getWithResponse("rg", "testCapp", "testBuild", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsCreateOrUpdateSamples.java index eddb8920ece9e..753b5257eccab 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsCreateOrUpdateSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.appcontainers.generated; import com.azure.resourcemanager.appcontainers.models.Action; +import com.azure.resourcemanager.appcontainers.models.ActiveRevisionsMode; import com.azure.resourcemanager.appcontainers.models.Affinity; import com.azure.resourcemanager.appcontainers.models.AppProtocol; import com.azure.resourcemanager.appcontainers.models.BindingType; @@ -14,11 +15,17 @@ import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeTcpSocket; +import com.azure.resourcemanager.appcontainers.models.ContainerAppPropertiesPatchingConfiguration; import com.azure.resourcemanager.appcontainers.models.ContainerResources; import com.azure.resourcemanager.appcontainers.models.CorsPolicy; import com.azure.resourcemanager.appcontainers.models.CustomDomain; import com.azure.resourcemanager.appcontainers.models.CustomScaleRule; import com.azure.resourcemanager.appcontainers.models.Dapr; +import com.azure.resourcemanager.appcontainers.models.ExtendedLocation; +import com.azure.resourcemanager.appcontainers.models.ExtendedLocationTypes; +import com.azure.resourcemanager.appcontainers.models.IdentitySettings; +import com.azure.resourcemanager.appcontainers.models.IdentitySettingsLifeCycle; +import com.azure.resourcemanager.appcontainers.models.ImageType; import com.azure.resourcemanager.appcontainers.models.Ingress; import com.azure.resourcemanager.appcontainers.models.IngressClientCertificateMode; import com.azure.resourcemanager.appcontainers.models.IngressPortMapping; @@ -26,15 +33,31 @@ import com.azure.resourcemanager.appcontainers.models.IngressTransportMethod; import com.azure.resourcemanager.appcontainers.models.InitContainer; import com.azure.resourcemanager.appcontainers.models.IpSecurityRestrictionRule; +import com.azure.resourcemanager.appcontainers.models.Kind; +import com.azure.resourcemanager.appcontainers.models.Level; +import com.azure.resourcemanager.appcontainers.models.LoggerSetting; import com.azure.resourcemanager.appcontainers.models.LogLevel; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.appcontainers.models.PatchingMode; +import com.azure.resourcemanager.appcontainers.models.QueueScaleRule; +import com.azure.resourcemanager.appcontainers.models.Runtime; +import com.azure.resourcemanager.appcontainers.models.RuntimeDotnet; +import com.azure.resourcemanager.appcontainers.models.RuntimeJava; +import com.azure.resourcemanager.appcontainers.models.RuntimeJavaAgent; +import com.azure.resourcemanager.appcontainers.models.RuntimeJavaAgentLogging; import com.azure.resourcemanager.appcontainers.models.Scale; import com.azure.resourcemanager.appcontainers.models.ScaleRule; import com.azure.resourcemanager.appcontainers.models.Service; import com.azure.resourcemanager.appcontainers.models.ServiceBind; +import com.azure.resourcemanager.appcontainers.models.StorageType; import com.azure.resourcemanager.appcontainers.models.TcpScaleRule; import com.azure.resourcemanager.appcontainers.models.Template; import com.azure.resourcemanager.appcontainers.models.TrafficWeight; import com.azure.resourcemanager.appcontainers.models.Type; +import com.azure.resourcemanager.appcontainers.models.UserAssignedIdentity; +import com.azure.resourcemanager.appcontainers.models.Volume; +import com.azure.resourcemanager.appcontainers.models.VolumeMount; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -44,29 +67,31 @@ */ public final class ContainerAppsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerApps_SourceToCloudApp_CreateOrUpdate.json */ /** - * Sample code: Create or Update Container App. + * Sample code: Create or Update SourceToCloud App. * * @param manager Entry point to ContainerAppsApiManager. */ public static void - createOrUpdateContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + createOrUpdateSourceToCloudApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager.containerApps() - .define("testcontainerapp0") + .define("testcontainerApp0") .withRegion("East US") .withExistingResourceGroup("rg") .withEnvironmentId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") .withWorkloadProfileName("My-GP-01") + .withPatchingConfiguration( + new ContainerAppPropertiesPatchingConfiguration().withPatchingMode(PatchingMode.AUTOMATIC)) .withConfiguration( new Configuration() .withIngress(new Ingress().withExternal(true) .withTargetPort(3000) .withTraffic(Arrays.asList(new TrafficWeight() - .withRevisionName("testcontainerapp0-ab1234") + .withRevisionName("testcontainerApp0-ab1234") .withWeight(100) .withLabel("production"))) .withCustomDomains(Arrays.asList(new CustomDomain() @@ -113,14 +138,24 @@ public final class ContainerAppsCreateOrUpdateSamples { .withMaxInactiveRevisions(10) .withService(new Service().withType("redis"))) .withTemplate(new Template() - .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerapp0:v4") + .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerApp0:v4") .withName("testinitcontainerApp0") .withCommand(Arrays.asList("/bin/sh")) .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) - .withResources(new ContainerResources().withCpu(0.5D).withMemory("1Gi")))) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) .withContainers(Arrays.asList(new Container() - .withImage("repo/testcontainerapp0:v1") - .withName("testcontainerapp0") + .withImage("") + .withImageType(ImageType.CLOUD_BUILD) + .withName("testcontainerApp0") + .withVolumeMounts( + Arrays.asList( + new VolumeMount().withVolumeName("azurefile") + .withMountPath("/mnt/path1") + .withSubPath("subPath1"), + new VolumeMount() + .withVolumeName("nfsazurefile") + .withMountPath("/mnt/path2") + .withSubPath("subPath2"))) .withProbes( Arrays.asList(new ContainerAppProbe().withHttpGet(new ContainerAppProbeHttpGet() .withHttpHeaders( @@ -131,20 +166,279 @@ public final class ContainerAppsCreateOrUpdateSamples { .withScale( new Scale().withMinReplicas(1) .withMaxReplicas(5) - .withRules( - Arrays.asList(new ScaleRule().withName("httpscalingrule") - .withCustom(new CustomScaleRule().withType("http") - .withMetadata(mapOf("concurrentRequests", "50")))))) + .withCooldownPeriod(350) + .withPollingInterval(35) + .withRules(Arrays.asList(new ScaleRule().withName("httpscalingrule") + .withCustom(new CustomScaleRule().withType("http") + .withMetadata(mapOf("concurrentRequests", "50")))))) + .withVolumes(Arrays.asList( + new Volume().withName("azurefile") + .withStorageType(StorageType.AZURE_FILE) + .withStorageName("storage"), + new Volume().withName("nfsazurefile") + .withStorageType(StorageType.NFS_AZURE_FILE) + .withStorageName("nfsStorage"))) .withServiceBinds(Arrays.asList(new ServiceBind().withServiceId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/redisService") - .withName("redisService")))) + .withName("redisService") + .withClientType("dotnet") + .withCustomizedKeys(mapOf("DesiredKey", "fakeTokenPlaceholder"))))) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerApps_CreateOrUpdate_ConnectedEnvironment.json + */ + /** + * Sample code: Create or Update App On A Connected Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateAppOnAConnectedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerApps() + .define("testcontainerApp0") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube") + .withConfiguration( + new Configuration() + .withIngress(new Ingress().withExternal(true) + .withTargetPort(3000) + .withTraffic(Arrays.asList(new TrafficWeight() + .withRevisionName("testcontainerApp0-ab1234") + .withWeight(100) + .withLabel("production"))) + .withCustomDomains(Arrays.asList(new CustomDomain() + .withName("www.my-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), + new CustomDomain().withName("www.my-other-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"))) + .withIpSecurityRestrictions( + Arrays + .asList( + new IpSecurityRestrictionRule().withName("Allow work IP A subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/32") + .withAction(Action.ALLOW), + new IpSecurityRestrictionRule().withName("Allow work IP B subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/8") + .withAction(Action.ALLOW))) + .withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY)) + .withClientCertificateMode(IngressClientCertificateMode.ACCEPT) + .withCorsPolicy(new CorsPolicy() + .withAllowedOrigins(Arrays.asList("https://a.test.com", "https://b.test.com")) + .withAllowedMethods(Arrays.asList("GET", "POST")) + .withAllowedHeaders(Arrays.asList("HEADER1", "HEADER2")) + .withExposeHeaders(Arrays.asList("HEADER3", "HEADER4")) + .withMaxAge(1234) + .withAllowCredentials(true)) + .withAdditionalPortMappings(Arrays.asList( + new IngressPortMapping().withExternal(true).withTargetPort(1234), + new IngressPortMapping().withExternal(false).withTargetPort(2345).withExposedPort(3456)))) + .withDapr(new Dapr() + .withEnabled(true) + .withAppProtocol(AppProtocol.HTTP) + .withAppPort(3000) + .withHttpReadBufferSize(30) + .withHttpMaxRequestSize(10) + .withLogLevel(LogLevel.DEBUG) + .withEnableApiLogging(true)) + .withRuntime(new Runtime().withJava(new RuntimeJava().withEnableMetrics(true) + .withJavaAgent(new RuntimeJavaAgent().withEnabled(true) + .withLogging(new RuntimeJavaAgentLogging().withLoggerSettings(Arrays.asList( + new LoggerSetting().withLogger("org.springframework.boot").withLevel(Level.DEBUG)))))) + .withDotnet(new RuntimeDotnet().withAutoConfigureDataProtection(true))) + .withMaxInactiveRevisions(10)) + .withTemplate(new Template() + .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerApp0:v4") + .withName("testinitcontainerApp0") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers(Arrays.asList(new Container() + .withImage("repo/testcontainerApp0:v1") + .withName("testcontainerApp0") + .withProbes( + Arrays.asList(new ContainerAppProbe().withHttpGet(new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)).withInitialDelaySeconds(3).withPeriodSeconds(3).withType(Type.LIVENESS))))) + .withScale( + new Scale().withMinReplicas(1) + .withMaxReplicas(5) + .withCooldownPeriod(350) + .withPollingInterval(35) + .withRules(Arrays.asList(new ScaleRule().withName("httpscalingrule") + .withCustom(new CustomScaleRule().withType("http") + .withMetadata(mapOf("concurrentRequests", "50"))))))) .create(); } /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_TcpApp_CreateOrUpdate. - * json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_CreateOrUpdate + * .json + */ + /** + * Sample code: Create or Update Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + createOrUpdateContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerApps() + .define("testcontainerApp0") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withIdentity(new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity", + new UserAssignedIdentity()))) + .withEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") + .withWorkloadProfileName("My-GP-01") + .withConfiguration( + new Configuration() + .withIngress(new Ingress().withExternal(true) + .withTargetPort(3000) + .withTraffic(Arrays.asList(new TrafficWeight() + .withRevisionName("testcontainerApp0-ab1234") + .withWeight(100) + .withLabel("production"))) + .withCustomDomains(Arrays.asList(new CustomDomain() + .withName("www.my-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), + new CustomDomain().withName("www.my-other-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"))) + .withIpSecurityRestrictions( + Arrays + .asList( + new IpSecurityRestrictionRule().withName("Allow work IP A subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/32") + .withAction(Action.ALLOW), + new IpSecurityRestrictionRule().withName("Allow work IP B subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/8") + .withAction(Action.ALLOW))) + .withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY)) + .withClientCertificateMode(IngressClientCertificateMode.ACCEPT) + .withCorsPolicy(new CorsPolicy() + .withAllowedOrigins(Arrays.asList("https://a.test.com", "https://b.test.com")) + .withAllowedMethods(Arrays.asList("GET", "POST")) + .withAllowedHeaders(Arrays.asList("HEADER1", "HEADER2")) + .withExposeHeaders(Arrays.asList("HEADER3", "HEADER4")) + .withMaxAge(1234) + .withAllowCredentials(true)) + .withAdditionalPortMappings(Arrays.asList( + new IngressPortMapping().withExternal(true).withTargetPort(1234), + new IngressPortMapping().withExternal(false).withTargetPort(2345).withExposedPort(3456)))) + .withDapr(new Dapr() + .withEnabled(true) + .withAppProtocol(AppProtocol.HTTP) + .withAppPort(3000) + .withHttpReadBufferSize(30) + .withHttpMaxRequestSize(10) + .withLogLevel(LogLevel.DEBUG) + .withEnableApiLogging(true)) + .withRuntime(new Runtime().withJava(new RuntimeJava() + .withEnableMetrics(true) + .withJavaAgent(new RuntimeJavaAgent() + .withEnabled(true) + .withLogging(new RuntimeJavaAgentLogging().withLoggerSettings( + Arrays.asList(new LoggerSetting().withLogger("org.springframework.boot") + .withLevel(Level.DEBUG)))))) + .withDotnet(new RuntimeDotnet().withAutoConfigureDataProtection(true))) + .withMaxInactiveRevisions(10) + .withService(new Service().withType("redis")) + .withIdentitySettings(Arrays.asList(new IdentitySettings().withIdentity( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity") + .withLifecycle(IdentitySettingsLifeCycle.ALL), + new IdentitySettings().withIdentity("system").withLifecycle(IdentitySettingsLifeCycle.INIT)))) + .withTemplate(new Template() + .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerApp0:v4") + .withName("testinitcontainerApp0") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers(Arrays.asList(new Container() + .withImage("repo/testcontainerApp0:v1") + .withName("testcontainerApp0") + .withVolumeMounts( + Arrays.asList( + new VolumeMount().withVolumeName("azurefile") + .withMountPath("/mnt/path1") + .withSubPath("subPath1"), + new VolumeMount() + .withVolumeName("nfsazurefile") + .withMountPath("/mnt/path2") + .withSubPath("subPath2"))) + .withProbes( + Arrays.asList(new ContainerAppProbe().withHttpGet(new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)).withInitialDelaySeconds(3).withPeriodSeconds(3).withType(Type.LIVENESS))))) + .withScale(new Scale().withMinReplicas(1) + .withMaxReplicas(5) + .withCooldownPeriod(350) + .withPollingInterval(35) + .withRules(Arrays.asList( + new ScaleRule().withName("httpscalingrule") + .withCustom( + new CustomScaleRule().withType("http").withMetadata(mapOf("concurrentRequests", "50"))), + new ScaleRule().withName("servicebus") + .withCustom(new CustomScaleRule().withType("azure-servicebus") + .withMetadata( + mapOf("messageCount", "5", "namespace", "mynamespace", "queueName", "myqueue")) + .withIdentity( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity")), + new ScaleRule().withName("azure-queue") + .withAzureQueue(new QueueScaleRule().withAccountName("account1") + .withQueueName("queue1") + .withQueueLength(1) + .withIdentity("system"))))) + .withVolumes(Arrays.asList( + new Volume().withName("azurefile") + .withStorageType(StorageType.AZURE_FILE) + .withStorageName("storage"), + new Volume().withName("nfsazurefile") + .withStorageType(StorageType.NFS_AZURE_FILE) + .withStorageName("nfsStorage"))) + .withServiceBinds(Arrays.asList(new ServiceBind().withServiceId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/redisService") + .withName("redisService") + .withClientType("dotnet") + .withCustomizedKeys(mapOf("DesiredKey", "fakeTokenPlaceholder"))))) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerApps_TcpApp_CreateOrUpdate.json */ /** * Sample code: Create or Update Tcp App. @@ -153,7 +447,7 @@ public final class ContainerAppsCreateOrUpdateSamples { */ public static void createOrUpdateTcpApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager.containerApps() - .define("testcontainerapptcp") + .define("testcontainerAppTcp") .withRegion("East US") .withExistingResourceGroup("rg") .withEnvironmentId( @@ -164,23 +458,55 @@ public static void createOrUpdateTcpApp(com.azure.resourcemanager.appcontainers. .withExposedPort(4000) .withTransport(IngressTransportMethod.TCP) .withTraffic(Arrays - .asList(new TrafficWeight().withRevisionName("testcontainerapptcp-ab1234").withWeight(100))))) + .asList(new TrafficWeight().withRevisionName("testcontainerAppTcp-ab1234").withWeight(100))))) .withTemplate(new Template() - .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerapptcp:v1") - .withName("testcontainerapptcp") + .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerAppTcp:v1") + .withName("testcontainerAppTcp") .withProbes(Arrays.asList(new ContainerAppProbe().withInitialDelaySeconds(3) .withPeriodSeconds(3) .withTcpSocket(new ContainerAppProbeTcpSocket().withPort(8080)) .withType(Type.LIVENESS))))) .withScale(new Scale().withMinReplicas(1) .withMaxReplicas(5) + .withCooldownPeriod(350) + .withPollingInterval(35) .withRules(Arrays.asList(new ScaleRule().withName("tcpscalingrule") .withTcp(new TcpScaleRule().withMetadata(mapOf("concurrentConnections", "50"))))))) .create(); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerApps_Kind_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update App Kind. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateAppKind(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerApps() + .define("testcontainerAppKind") + .withRegion("East Us") + .withExistingResourceGroup("rg") + .withManagedBy( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppKind") + .withKind(Kind.WORKFLOWAPP) + .withManagedEnvironmentId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3") + .withConfiguration(new Configuration().withActiveRevisionsMode(ActiveRevisionsMode.SINGLE) + .withIngress(new Ingress().withExternal(true).withTargetPort(80).withAllowInsecure(true))) + .withTemplate(new Template() + .withContainers(Arrays.asList(new Container().withImage("default/logicapps-base:latest") + .withName("logicapps-container") + .withResources(new ContainerResources().withCpu(1.0D).withMemory("2.0Gi")))) + .withScale( + new Scale().withMinReplicas(1).withMaxReplicas(30).withCooldownPeriod(350).withPollingInterval(35))) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ContainerApps_ManagedBy_CreateOrUpdate.json */ /** @@ -191,7 +517,7 @@ public static void createOrUpdateTcpApp(com.azure.resourcemanager.appcontainers. public static void createOrUpdateManagedByApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager.containerApps() - .define("testcontainerappmanagedby") + .define("testcontainerAppManagedBy") .withRegion("East US") .withExistingResourceGroup("rg") .withManagedBy( @@ -203,16 +529,18 @@ public static void createOrUpdateTcpApp(com.azure.resourcemanager.appcontainers. .withExposedPort(4000) .withTransport(IngressTransportMethod.TCP) .withTraffic(Arrays - .asList(new TrafficWeight().withRevisionName("testcontainerappmanagedby-ab1234").withWeight(100))))) + .asList(new TrafficWeight().withRevisionName("testcontainerAppManagedBy-ab1234").withWeight(100))))) .withTemplate(new Template() - .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerappmanagedby:v1") - .withName("testcontainerappmanagedby") + .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerAppManagedBy:v1") + .withName("testcontainerAppManagedBy") .withProbes(Arrays.asList(new ContainerAppProbe().withInitialDelaySeconds(3) .withPeriodSeconds(3) .withTcpSocket(new ContainerAppProbeTcpSocket().withPort(8080)) .withType(Type.LIVENESS))))) .withScale(new Scale().withMinReplicas(1) .withMaxReplicas(5) + .withCooldownPeriod(350) + .withPollingInterval(35) .withRules(Arrays.asList(new ScaleRule().withName("tcpscalingrule") .withTcp(new TcpScaleRule().withMetadata(mapOf("concurrentConnections", "50"))))))) .create(); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDeleteSamples.java index 15027eb32b536..5f50dd46a3234 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDeleteSamples.java @@ -10,7 +10,7 @@ public final class ContainerAppsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Delete.json */ /** * Sample code: Delete Container App. @@ -18,6 +18,6 @@ public final class ContainerAppsDeleteSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void deleteContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().delete("rg", "testworkerapp0", com.azure.core.util.Context.NONE); + manager.containerApps().delete("rg", "testWorkerApp0", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetDetectorSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetDetectorSamples.java index dc11f15cedda3..fc000bd6d75a9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetDetectorSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetDetectorSamples.java @@ -10,7 +10,8 @@ public final class ContainerAppsDiagnosticsGetDetectorSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerAppsDiagnostics_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsDiagnostics_Get + * .json */ /** * Sample code: Get Container App's diagnostics info. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetRevisionSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetRevisionSamples.java index f13ca10760071..ffd1f44ea7c28 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetRevisionSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetRevisionSamples.java @@ -10,7 +10,7 @@ public final class ContainerAppsDiagnosticsGetRevisionSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_Get.json */ /** * Sample code: Get Container App's revision. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetRootSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetRootSamples.java index 499e362181038..342aa2656f01e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetRootSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetRootSamples.java @@ -10,7 +10,7 @@ public final class ContainerAppsDiagnosticsGetRootSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Get.json */ /** * Sample code: Get Container App. @@ -19,6 +19,6 @@ public final class ContainerAppsDiagnosticsGetRootSamples { */ public static void getContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager.containerAppsDiagnostics() - .getRootWithResponse("rg", "testcontainerapp0", com.azure.core.util.Context.NONE); + .getRootWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListDetectorsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListDetectorsSamples.java index ef064e02b4eef..21aada039a252 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListDetectorsSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListDetectorsSamples.java @@ -9,8 +9,8 @@ */ public final class ContainerAppsDiagnosticsListDetectorsSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerAppsDiagnostics_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerAppsDiagnostics_List.json */ /** * Sample code: Get the list of available diagnostics for a given Container App. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListRevisionsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListRevisionsSamples.java index b7a0d104f6280..aa49ec68ee764 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListRevisionsSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListRevisionsSamples.java @@ -10,7 +10,7 @@ public final class ContainerAppsDiagnosticsListRevisionsSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_List.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_List.json */ /** * Sample code: List Container App's revisions. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsGetAuthTokenSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsGetAuthTokenSamples.java index cf919a08fa57c..d94b7d7833196 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsGetAuthTokenSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsGetAuthTokenSamples.java @@ -10,7 +10,8 @@ public final class ContainerAppsGetAuthTokenSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_GetAuthToken.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_GetAuthToken. + * json */ /** * Sample code: Get Container App Auth Token. @@ -19,6 +20,6 @@ public final class ContainerAppsGetAuthTokenSamples { */ public static void getContainerAppAuthToken(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().getAuthTokenWithResponse("rg", "testcontainerapp0", com.azure.core.util.Context.NONE); + manager.containerApps().getAuthTokenWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsGetByResourceGroupSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsGetByResourceGroupSamples.java index b9fc3151b2f7f..6fb147906e9f8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsGetByResourceGroupSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsGetByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class ContainerAppsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Get.json */ /** * Sample code: Get Container App. @@ -19,6 +19,6 @@ public final class ContainerAppsGetByResourceGroupSamples { */ public static void getContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager.containerApps() - .getByResourceGroupWithResponse("rg", "testcontainerapp0", com.azure.core.util.Context.NONE); + .getByResourceGroupWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListByResourceGroupSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListByResourceGroupSamples.java index 71f186419cf4e..7a69c21389d24 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListByResourceGroupSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListByResourceGroupSamples.java @@ -9,9 +9,8 @@ */ public final class ContainerAppsListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_ListByResourceGroup. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerApps_ListByResourceGroup.json */ /** * Sample code: List Container Apps by resource group. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListCustomHostnameAnalysisSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListCustomHostnameAnalysisSamples.java index 4e7ce77e4fbee..b47fb8cf7ebe0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListCustomHostnameAnalysisSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListCustomHostnameAnalysisSamples.java @@ -9,7 +9,7 @@ */ public final class ContainerAppsListCustomHostnameAnalysisSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ContainerApps_ListCustomHostNameAnalysis.json */ /** @@ -19,7 +19,7 @@ public final class ContainerAppsListCustomHostnameAnalysisSamples { */ public static void analyzeCustomHostname(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager.containerApps() - .listCustomHostnameAnalysisWithResponse("rg", "testcontainerapp0", "my.name.corp", + .listCustomHostnameAnalysisWithResponse("rg", "testcontainerApp0", "my.name.corp", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListSamples.java index 31e470b1b6d8b..30c03a3b94d8e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListSamples.java @@ -9,8 +9,8 @@ */ public final class ContainerAppsListSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_ListBySubscription.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerApps_ListBySubscription.json */ /** * Sample code: List Container Apps by subscription. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListSecretsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListSecretsSamples.java index e38073e32ae6e..7808b22c206f8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListSecretsSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListSecretsSamples.java @@ -10,7 +10,8 @@ public final class ContainerAppsListSecretsSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_ListSecrets.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_ListSecrets. + * json */ /** * Sample code: List Container Apps Secrets. @@ -19,6 +20,6 @@ public final class ContainerAppsListSecretsSamples { */ public static void listContainerAppsSecrets(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().listSecretsWithResponse("rg", "testcontainerapp0", com.azure.core.util.Context.NONE); + manager.containerApps().listSecretsWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsPatchesApplySamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsPatchesApplySamples.java new file mode 100644 index 0000000000000..37a65cb09de86 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsPatchesApplySamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for ContainerAppsPatches Apply. + */ +public final class ContainerAppsPatchesApplySamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsPatches_Apply. + * json + */ + /** + * Sample code: ContainerAppsPatches_Apply_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + containerAppsPatchesApply0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsPatches().apply("rg", "test-app", "testPatch-25fe4b", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsPatchesDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsPatchesDeleteSamples.java new file mode 100644 index 0000000000000..23aaaa9b06639 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsPatchesDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for ContainerAppsPatches Delete. + */ +public final class ContainerAppsPatchesDeleteSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsPatches_Delete. + * json + */ + /** + * Sample code: ContainerAppsPatches_Delete_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + containerAppsPatchesDelete0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsPatches().delete("rg", "test-app", "testPatch-25fe4b", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsPatchesGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsPatchesGetSamples.java new file mode 100644 index 0000000000000..f0bf661305554 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsPatchesGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for ContainerAppsPatches Get. + */ +public final class ContainerAppsPatchesGetSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsPatches_Get. + * json + */ + /** + * Sample code: ContainerAppsPatches_Get_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + containerAppsPatchesGet0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsPatches() + .getWithResponse("rg", "test-app", "testPatch-25fe4b", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsPatchesListByContainerAppSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsPatchesListByContainerAppSamples.java new file mode 100644 index 0000000000000..89b38226f4315 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsPatchesListByContainerAppSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for ContainerAppsPatches ListByContainerApp. + */ +public final class ContainerAppsPatchesListByContainerAppSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerAppsPatches_ListByContainerApp.json + */ + /** + * Sample code: ContainerAppsPatches_ListByContainerApp_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void containerAppsPatchesListByContainerApp0( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsPatches().listByContainerApp("rg", "test-app", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsPatchesSkipConfigureSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsPatchesSkipConfigureSamples.java new file mode 100644 index 0000000000000..2ea4c1b7b00b5 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsPatchesSkipConfigureSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.PatchSkipConfig; + +/** + * Samples for ContainerAppsPatches SkipConfigure. + */ +public final class ContainerAppsPatchesSkipConfigureSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerAppsPatches_Skip_Configure.json + */ + /** + * Sample code: ContainerAppsPatches_Skip_Configure_0. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + containerAppsPatchesSkipConfigure0(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsPatches() + .skipConfigure("rg", "test-app", "testPatch-25fe4b", new PatchSkipConfig().withSkip(true), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasGetReplicaSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasGetReplicaSamples.java index 87a99a4b81483..be0a59dc733c7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasGetReplicaSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasGetReplicaSamples.java @@ -9,7 +9,8 @@ */ public final class ContainerAppsRevisionReplicasGetReplicaSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Replicas_Get.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Replicas_Get.json */ /** * Sample code: Get Container App's revision replica. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasListReplicasSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasListReplicasSamples.java index 6791eb85be9aa..32236a3fd1449 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasListReplicasSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasListReplicasSamples.java @@ -10,7 +10,7 @@ public final class ContainerAppsRevisionReplicasListReplicasSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Replicas_List.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Replicas_List.json */ /** * Sample code: List Container App's replicas. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsActivateRevisionSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsActivateRevisionSamples.java index faa60eb475f3d..fa1b1328e52ea 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsActivateRevisionSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsActivateRevisionSamples.java @@ -10,7 +10,7 @@ public final class ContainerAppsRevisionsActivateRevisionSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_Activate.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_Activate.json */ /** * Sample code: Activate Container App's revision. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsDeactivateRevisionSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsDeactivateRevisionSamples.java index 12e1f1c96e257..18268907227c5 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsDeactivateRevisionSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsDeactivateRevisionSamples.java @@ -10,7 +10,7 @@ public final class ContainerAppsRevisionsDeactivateRevisionSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_Deactivate.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_Deactivate.json */ /** * Sample code: Deactivate Container App's revision. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsGetRevisionSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsGetRevisionSamples.java index a3b91b7819969..66a0df2e7322c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsGetRevisionSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsGetRevisionSamples.java @@ -10,7 +10,7 @@ public final class ContainerAppsRevisionsGetRevisionSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_Get.json */ /** * Sample code: Get Container App's revision. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsListRevisionsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsListRevisionsSamples.java index 282d811469b0a..86254c2f2c3b9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsListRevisionsSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsListRevisionsSamples.java @@ -10,7 +10,7 @@ public final class ContainerAppsRevisionsListRevisionsSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_List.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_List.json */ /** * Sample code: List Container App's revisions. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsRestartRevisionSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsRestartRevisionSamples.java index 921bdf645ff52..4ccaba04c1cd3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsRestartRevisionSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsRestartRevisionSamples.java @@ -10,7 +10,7 @@ public final class ContainerAppsRevisionsRestartRevisionSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_Restart.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_Restart.json */ /** * Sample code: Restart Container App's revision. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSessionPoolsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSessionPoolsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..af9314a905208 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSessionPoolsCreateOrUpdateSamples.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.ContainerType; +import com.azure.resourcemanager.appcontainers.models.CustomContainerTemplate; +import com.azure.resourcemanager.appcontainers.models.DynamicPoolConfiguration; +import com.azure.resourcemanager.appcontainers.models.ExecutionType; +import com.azure.resourcemanager.appcontainers.models.PoolManagementType; +import com.azure.resourcemanager.appcontainers.models.ScaleConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionContainer; +import com.azure.resourcemanager.appcontainers.models.SessionContainerResources; +import com.azure.resourcemanager.appcontainers.models.SessionIngress; +import com.azure.resourcemanager.appcontainers.models.SessionNetworkConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionNetworkStatus; +import java.util.Arrays; + +/** + * Samples for ContainerAppsSessionPools CreateOrUpdate. + */ +public final class ContainerAppsSessionPoolsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_CreateOrUpdate. + * json + */ + /** + * Sample code: Create or Update Session Pool. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + createOrUpdateSessionPool(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsSessionPools() + .define("testsessionpool") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") + .withContainerType(ContainerType.CUSTOM_CONTAINER) + .withPoolManagementType(PoolManagementType.DYNAMIC) + .withScaleConfiguration( + new ScaleConfiguration().withMaxConcurrentSessions(500).withReadySessionInstances(100)) + .withDynamicPoolConfiguration( + new DynamicPoolConfiguration().withExecutionType(ExecutionType.TIMED).withCooldownPeriodInSeconds(600)) + .withCustomContainerTemplate(new CustomContainerTemplate() + .withContainers(Arrays.asList(new SessionContainer().withImage("repo/testcontainer:v4") + .withName("testinitcontainer") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new SessionContainerResources().withCpu(0.25D).withMemory("0.5Gi")))) + .withIngress(new SessionIngress().withTargetPort(80))) + .withSessionNetworkConfiguration( + new SessionNetworkConfiguration().withStatus(SessionNetworkStatus.EGRESS_ENABLED)) + .create(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSessionPoolsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSessionPoolsDeleteSamples.java new file mode 100644 index 0000000000000..7b9bd5de12ea4 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSessionPoolsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for ContainerAppsSessionPools Delete. + */ +public final class ContainerAppsSessionPoolsDeleteSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_Delete.json + */ + /** + * Sample code: Delete Session Pool. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteSessionPool(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsSessionPools().delete("rg", "testsessionpool", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSessionPoolsGetByResourceGroupSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSessionPoolsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..c136e056fa441 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSessionPoolsGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for ContainerAppsSessionPools GetByResourceGroup. + */ +public final class ContainerAppsSessionPoolsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_Get.json + */ + /** + * Sample code: Get Session Pool. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getSessionPool(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsSessionPools() + .getByResourceGroupWithResponse("rg", "testsessionpool", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSessionPoolsListByResourceGroupSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSessionPoolsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..1677fc7d7798d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSessionPoolsListByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for ContainerAppsSessionPools ListByResourceGroup. + */ +public final class ContainerAppsSessionPoolsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * SessionPools_ListByResourceGroup.json + */ + /** + * Sample code: List Session Pools by resource group. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listSessionPoolsByResourceGroup(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsSessionPools().listByResourceGroup("rg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSessionPoolsListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSessionPoolsListSamples.java new file mode 100644 index 0000000000000..37ddb684416e8 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSessionPoolsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for ContainerAppsSessionPools List. + */ +public final class ContainerAppsSessionPoolsListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * SessionPools_ListBySubscription.json + */ + /** + * Sample code: List Session Pools by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listSessionPoolsBySubscription(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsSessionPools().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSessionPoolsUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSessionPoolsUpdateSamples.java new file mode 100644 index 0000000000000..0fabb3c3e25b2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSessionPoolsUpdateSamples.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.CustomContainerTemplate; +import com.azure.resourcemanager.appcontainers.models.DynamicPoolConfiguration; +import com.azure.resourcemanager.appcontainers.models.ExecutionType; +import com.azure.resourcemanager.appcontainers.models.ScaleConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionContainer; +import com.azure.resourcemanager.appcontainers.models.SessionContainerResources; +import com.azure.resourcemanager.appcontainers.models.SessionIngress; +import com.azure.resourcemanager.appcontainers.models.SessionNetworkConfiguration; +import com.azure.resourcemanager.appcontainers.models.SessionNetworkStatus; +import com.azure.resourcemanager.appcontainers.models.SessionPool; +import java.util.Arrays; + +/** + * Samples for ContainerAppsSessionPools Update. + */ +public final class ContainerAppsSessionPoolsUpdateSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_Patch.json + */ + /** + * Sample code: Update Session Pool. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void updateSessionPool(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + SessionPool resource = manager.containerAppsSessionPools() + .getByResourceGroupWithResponse("rg", "testsessionpool", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withScaleConfiguration( + new ScaleConfiguration().withMaxConcurrentSessions(500).withReadySessionInstances(100)) + .withDynamicPoolConfiguration( + new DynamicPoolConfiguration().withExecutionType(ExecutionType.TIMED).withCooldownPeriodInSeconds(600)) + .withCustomContainerTemplate(new CustomContainerTemplate() + .withContainers(Arrays.asList(new SessionContainer().withImage("repo/testcontainer:v4") + .withName("testinitcontainer") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new SessionContainerResources().withCpu(0.25D).withMemory("0.5Gi")))) + .withIngress(new SessionIngress().withTargetPort(80))) + .withSessionNetworkConfiguration( + new SessionNetworkConfiguration().withStatus(SessionNetworkStatus.EGRESS_ENABLED)) + .apply(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsCreateOrUpdateSamples.java index 6a2d9e08a1e4d..6fb517b9f8e3b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsCreateOrUpdateSamples.java @@ -5,16 +5,18 @@ package com.azure.resourcemanager.appcontainers.generated; import com.azure.resourcemanager.appcontainers.models.AzureCredentials; +import com.azure.resourcemanager.appcontainers.models.EnvironmentVariable; import com.azure.resourcemanager.appcontainers.models.GithubActionConfiguration; import com.azure.resourcemanager.appcontainers.models.RegistryInfo; +import java.util.Arrays; /** * Samples for ContainerAppsSourceControls CreateOrUpdate. */ public final class ContainerAppsSourceControlsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/SourceControls_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * SourceControls_CreateOrUpdate.json */ /** * Sample code: Create or Update Container App SourceControl. @@ -37,8 +39,13 @@ public static void createOrUpdateContainerAppSourceControl( .withTenantId("") .withKind("feaderated")) .withContextPath("./") + .withDockerfilePath("./Dockerfile") .withGithubPersonalAccessToken("fakeTokenPlaceholder") - .withImage("image/tag")) + .withImage("image/tag") + .withBuildEnvironmentVariables( + Arrays.asList(new EnvironmentVariable().withName("foo1").withValue("bar1"), + new EnvironmentVariable().withName("foo2").withValue("bar2")))) + .withXMsGithubAuxiliary("githubaccesstoken") .create(); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsDeleteSamples.java index bb71a7c0b99d9..9f430abc6070d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsDeleteSamples.java @@ -10,7 +10,7 @@ public final class ContainerAppsSourceControlsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/SourceControls_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SourceControls_Delete.json */ /** * Sample code: Delete Container App SourceControl. @@ -20,6 +20,7 @@ public final class ContainerAppsSourceControlsDeleteSamples { public static void deleteContainerAppSourceControl(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager.containerAppsSourceControls() - .delete("workerapps-rg-xj", "testcanadacentral", "current", com.azure.core.util.Context.NONE); + .delete("workerapps-rg-xj", "testcanadacentral", "current", "githubaccesstoken", false, false, + com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsGetSamples.java index 6426272c98c48..c64fd5555ada0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsGetSamples.java @@ -10,7 +10,7 @@ public final class ContainerAppsSourceControlsGetSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/SourceControls_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SourceControls_Get.json */ /** * Sample code: Get Container App's SourceControl. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsListByContainerAppSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsListByContainerAppSamples.java index 6ec794e3d28d1..d83a9a11534f4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsListByContainerAppSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsListByContainerAppSamples.java @@ -9,8 +9,8 @@ */ public final class ContainerAppsSourceControlsListByContainerAppSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/SourceControls_ListByContainer.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * SourceControls_ListByContainer.json */ /** * Sample code: List App's Source Controls. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsStartSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsStartSamples.java index f6abc27fc7cda..86025c2535209 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsStartSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsStartSamples.java @@ -10,7 +10,7 @@ public final class ContainerAppsStartSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Start.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Start.json */ /** * Sample code: Start Container App. @@ -18,6 +18,6 @@ public final class ContainerAppsStartSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void startContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().start("rg", "testworkerapp0", com.azure.core.util.Context.NONE); + manager.containerApps().start("rg", "testWorkerApp0", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsStopSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsStopSamples.java index 34f9620b48dc1..48f53c7c49060 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsStopSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsStopSamples.java @@ -10,7 +10,7 @@ public final class ContainerAppsStopSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Stop.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Stop.json */ /** * Sample code: Stop Container App. @@ -18,6 +18,6 @@ public final class ContainerAppsStopSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void stopContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().stop("rg", "testworkerApp0", com.azure.core.util.Context.NONE); + manager.containerApps().stop("rg", "testWorkerApp0", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsUpdateSamples.java index 15a1c1ef47723..88a3b04f21bd5 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsUpdateSamples.java @@ -22,7 +22,14 @@ import com.azure.resourcemanager.appcontainers.models.IngressStickySessions; import com.azure.resourcemanager.appcontainers.models.InitContainer; import com.azure.resourcemanager.appcontainers.models.IpSecurityRestrictionRule; +import com.azure.resourcemanager.appcontainers.models.Level; +import com.azure.resourcemanager.appcontainers.models.LoggerSetting; import com.azure.resourcemanager.appcontainers.models.LogLevel; +import com.azure.resourcemanager.appcontainers.models.Runtime; +import com.azure.resourcemanager.appcontainers.models.RuntimeDotnet; +import com.azure.resourcemanager.appcontainers.models.RuntimeJava; +import com.azure.resourcemanager.appcontainers.models.RuntimeJavaAgent; +import com.azure.resourcemanager.appcontainers.models.RuntimeJavaAgentLogging; import com.azure.resourcemanager.appcontainers.models.Scale; import com.azure.resourcemanager.appcontainers.models.ScaleRule; import com.azure.resourcemanager.appcontainers.models.Service; @@ -40,7 +47,7 @@ public final class ContainerAppsUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Patch.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Patch.json */ /** * Sample code: Patch Container App. @@ -49,7 +56,7 @@ public final class ContainerAppsUpdateSamples { */ public static void patchContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { ContainerApp resource = manager.containerApps() - .getByResourceGroupWithResponse("rg", "testcontainerapp0", com.azure.core.util.Context.NONE) + .getByResourceGroupWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE) .getValue(); resource.update() .withTags(mapOf("tag1", "value1", "tag2", "value2")) @@ -58,7 +65,7 @@ public static void patchContainerApp(com.azure.resourcemanager.appcontainers.Con .withIngress(new Ingress().withExternal(true) .withTargetPort(3000) .withTraffic(Arrays.asList(new TrafficWeight() - .withRevisionName("testcontainerapp0-ab1234") + .withRevisionName("testcontainerApp0-ab1234") .withWeight(100) .withLabel("production"))) .withCustomDomains(Arrays.asList(new CustomDomain() @@ -84,22 +91,28 @@ public static void patchContainerApp(com.azure.resourcemanager.appcontainers.Con .withIpAddressRange("192.168.1.1/8") .withAction(Action.ALLOW))) .withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY))) - .withDapr(new Dapr().withEnabled(true) + .withDapr(new Dapr() + .withEnabled(true) .withAppProtocol(AppProtocol.HTTP) .withAppPort(3000) .withHttpReadBufferSize(30) .withHttpMaxRequestSize(10) .withLogLevel(LogLevel.DEBUG) .withEnableApiLogging(true)) + .withRuntime(new Runtime().withJava(new RuntimeJava().withEnableMetrics(true) + .withJavaAgent(new RuntimeJavaAgent().withEnabled(true) + .withLogging(new RuntimeJavaAgentLogging().withLoggerSettings(Arrays.asList( + new LoggerSetting().withLogger("org.springframework.boot").withLevel(Level.DEBUG)))))) + .withDotnet(new RuntimeDotnet().withAutoConfigureDataProtection(true))) .withMaxInactiveRevisions(10) .withService(new Service().withType("redis"))) .withTemplate(new Template() - .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerapp0:v4") + .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerApp0:v4") .withName("testinitcontainerApp0") - .withResources(new ContainerResources().withCpu(0.5D).withMemory("1Gi")))) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) .withContainers(Arrays.asList(new Container() - .withImage("repo/testcontainerapp0:v1") - .withName("testcontainerapp0") + .withImage("repo/testcontainerApp0:v1") + .withName("testcontainerApp0") .withProbes( Arrays.asList(new ContainerAppProbe().withHttpGet(new ContainerAppProbeHttpGet() .withHttpHeaders( @@ -110,13 +123,17 @@ public static void patchContainerApp(com.azure.resourcemanager.appcontainers.Con .withScale( new Scale().withMinReplicas(1) .withMaxReplicas(5) + .withCooldownPeriod(350) + .withPollingInterval(35) .withRules( Arrays.asList(new ScaleRule().withName("httpscalingrule") .withCustom(new CustomScaleRule().withType("http") .withMetadata(mapOf("concurrentRequests", "50")))))) .withServiceBinds(Arrays.asList(new ServiceBind().withServiceId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/service") - .withName("service")))) + .withName("service") + .withClientType("dotnet") + .withCustomizedKeys(mapOf("DesiredKey", "fakeTokenPlaceholder"))))) .apply(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..d4b9a794ffc7c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesCreateOrUpdateSamples.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicyConfiguration; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration; + +/** + * Samples for DaprComponentResiliencyPolicies CreateOrUpdate. + */ +public final class DaprComponentResiliencyPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprComponentResiliencyPolicy_CreateOrUpdate_OutboundOnly.json + */ + /** + * Sample code: Create or update dapr component resiliency policy with outbound policy only. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateDaprComponentResiliencyPolicyWithOutboundPolicyOnly( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprComponentResiliencyPolicies() + .define("myresiliencypolicy") + .withExistingDaprComponent("examplerg", "myenvironment", "mydaprcomponent") + .withOutboundPolicy(new DaprComponentResiliencyPolicyConfiguration() + .withHttpRetryPolicy(new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration().withMaxRetries(5) + .withRetryBackOff(new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() + .withInitialDelayInMilliseconds(100) + .withMaxIntervalInMilliseconds(30000))) + .withTimeoutPolicy( + new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration().withResponseTimeoutInSeconds(12)) + .withCircuitBreakerPolicy( + new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration().withConsecutiveErrors(3) + .withTimeoutInSeconds(20) + .withIntervalInSeconds(60))) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprComponentResiliencyPolicy_CreateOrUpdate_AllOptions.json + */ + /** + * Sample code: Create or update dapr component resiliency policy with all options. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateDaprComponentResiliencyPolicyWithAllOptions( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprComponentResiliencyPolicies() + .define("myresiliencypolicy") + .withExistingDaprComponent("examplerg", "myenvironment", "mydaprcomponent") + .withInboundPolicy(new DaprComponentResiliencyPolicyConfiguration() + .withHttpRetryPolicy(new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration().withMaxRetries(15) + .withRetryBackOff(new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() + .withInitialDelayInMilliseconds(2000) + .withMaxIntervalInMilliseconds(5500))) + .withTimeoutPolicy( + new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration().withResponseTimeoutInSeconds(30)) + .withCircuitBreakerPolicy( + new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration().withConsecutiveErrors(5) + .withTimeoutInSeconds(10) + .withIntervalInSeconds(4))) + .withOutboundPolicy(new DaprComponentResiliencyPolicyConfiguration() + .withHttpRetryPolicy(new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration().withMaxRetries(5) + .withRetryBackOff(new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() + .withInitialDelayInMilliseconds(100) + .withMaxIntervalInMilliseconds(30000))) + .withTimeoutPolicy( + new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration().withResponseTimeoutInSeconds(12)) + .withCircuitBreakerPolicy( + new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration().withConsecutiveErrors(3) + .withTimeoutInSeconds(20) + .withIntervalInSeconds(60))) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprComponentResiliencyPolicy_CreateOrUpdate_SparseOptions.json + */ + /** + * Sample code: Create or update dapr component resiliency policy with sparse options. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateDaprComponentResiliencyPolicyWithSparseOptions( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprComponentResiliencyPolicies() + .define("myresiliencypolicy") + .withExistingDaprComponent("examplerg", "myenvironment", "mydaprcomponent") + .withInboundPolicy(new DaprComponentResiliencyPolicyConfiguration() + .withHttpRetryPolicy(new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration().withMaxRetries(5) + .withRetryBackOff(new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() + .withInitialDelayInMilliseconds(2000) + .withMaxIntervalInMilliseconds(5500))) + .withCircuitBreakerPolicy( + new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration().withConsecutiveErrors(3) + .withTimeoutInSeconds(20))) + .withOutboundPolicy(new DaprComponentResiliencyPolicyConfiguration().withTimeoutPolicy( + new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration().withResponseTimeoutInSeconds(12))) + .create(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesDeleteSamples.java new file mode 100644 index 0000000000000..c3c9cc5c58684 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for DaprComponentResiliencyPolicies Delete. + */ +public final class DaprComponentResiliencyPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprComponentResiliencyPolicies_Delete.json + */ + /** + * Sample code: Delete dapr component resiliency policy. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + deleteDaprComponentResiliencyPolicy(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprComponentResiliencyPolicies() + .deleteWithResponse("examplerg", "myenvironment", "mydaprcomponent", "myresiliencypolicy", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesGetSamples.java new file mode 100644 index 0000000000000..f45ee6c3a9eb3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for DaprComponentResiliencyPolicies Get. + */ +public final class DaprComponentResiliencyPoliciesGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprComponentResiliencyPolicies_Get.json + */ + /** + * Sample code: Get Dapr component resiliency policy. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + getDaprComponentResiliencyPolicy(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprComponentResiliencyPolicies() + .getWithResponse("examplerg", "myenvironment", "mydaprcomponent", "myresiliencypolicy", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesListSamples.java new file mode 100644 index 0000000000000..550d0ccdd3154 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for DaprComponentResiliencyPolicies List. + */ +public final class DaprComponentResiliencyPoliciesListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprComponentResiliencyPolicies_List.json + */ + /** + * Sample code: List Dapr component resiliency policies. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listDaprComponentResiliencyPolicies(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprComponentResiliencyPolicies() + .list("examplerg", "myenvironment", "mydaprcomponent", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsCreateOrUpdateSamples.java index 4f1f76136883c..362037bead0a4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsCreateOrUpdateSamples.java @@ -5,7 +5,9 @@ package com.azure.resourcemanager.appcontainers.generated; import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentInner; +import com.azure.resourcemanager.appcontainers.models.DaprComponentServiceBinding; import com.azure.resourcemanager.appcontainers.models.DaprMetadata; +import com.azure.resourcemanager.appcontainers.models.DaprServiceBindMetadata; import com.azure.resourcemanager.appcontainers.models.Secret; import java.util.Arrays; @@ -14,9 +16,8 @@ */ public final class DaprComponentsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_CreateOrUpdate_Secrets - * .json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprComponents_CreateOrUpdate_Secrets.json */ /** * Sample code: Create or update dapr component with secrets. @@ -36,12 +37,17 @@ public static void createOrUpdateDaprComponentWithSecrets( new DaprMetadata().withName("database").withValue("itemsDB"), new DaprMetadata().withName("collection").withValue("items"), new DaprMetadata().withName("masterkey").withSecretRef("fakeTokenPlaceholder"))) - .withScopes(Arrays.asList("container-app-1", "container-app-2")), + .withScopes(Arrays.asList("container-app-1", "container-app-2")) + .withServiceComponentBind(Arrays.asList(new DaprComponentServiceBinding().withName("statestore") + .withServiceId( + "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis") + .withMetadata( + new DaprServiceBindMetadata().withName("daprcomponentBind").withValue("redis-bind")))), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * DaprComponents_CreateOrUpdate_SecretStoreComponent.json */ /** @@ -62,7 +68,12 @@ public static void createOrUpdateDaprComponentWithSecretStoreComponent( new DaprMetadata().withName("database").withValue("itemsDB"), new DaprMetadata().withName("collection").withValue("items"), new DaprMetadata().withName("masterkey").withSecretRef("fakeTokenPlaceholder"))) - .withScopes(Arrays.asList("container-app-1", "container-app-2")), + .withScopes(Arrays.asList("container-app-1", "container-app-2")) + .withServiceComponentBind(Arrays.asList(new DaprComponentServiceBinding().withName("statestore") + .withServiceId( + "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis") + .withMetadata( + new DaprServiceBindMetadata().withName("daprcomponentBind").withValue("redis-bind")))), com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsDeleteSamples.java index 8aa9093cad082..6a0bd40611f55 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsDeleteSamples.java @@ -10,7 +10,7 @@ public final class DaprComponentsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_Delete.json */ /** * Sample code: Delete dapr component. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsGetSamples.java index 60d4e8214cc38..e1931e12e6834 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsGetSamples.java @@ -9,7 +9,7 @@ */ public final class DaprComponentsGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * DaprComponents_Get_SecretStoreComponent.json */ /** @@ -25,7 +25,8 @@ public static void getDaprComponentWithSecretStoreComponent( /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_Get_Secrets.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_Get_Secrets. + * json */ /** * Sample code: Get Dapr Component with secrets. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListSamples.java index 560c16a5ffd99..ce2805bc3cd4b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListSamples.java @@ -10,7 +10,7 @@ public final class DaprComponentsListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_List.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_List.json */ /** * Sample code: List Dapr Components. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListSecretsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListSecretsSamples.java index 1f8c96ec01bdc..747f433036c56 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListSecretsSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListSecretsSamples.java @@ -10,7 +10,8 @@ public final class DaprComponentsListSecretsSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_ListSecrets.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_ListSecrets. + * json */ /** * Sample code: List Container Apps Secrets. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprSubscriptionsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprSubscriptionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..e9752162c8944 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprSubscriptionsCreateOrUpdateSamples.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.DaprSubscriptionBulkSubscribeOptions; +import com.azure.resourcemanager.appcontainers.models.DaprSubscriptionRouteRule; +import com.azure.resourcemanager.appcontainers.models.DaprSubscriptionRoutes; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DaprSubscriptions CreateOrUpdate. + */ +public final class DaprSubscriptionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprSubscriptions_CreateOrUpdate_RouteRulesAndMetadata.json + */ + /** + * Sample code: Create or update dapr subscription with route rules and metadata. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateDaprSubscriptionWithRouteRulesAndMetadata( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprSubscriptions() + .define("mysubscription") + .withExistingManagedEnvironment("examplerg", "myenvironment") + .withPubsubName("mypubsubcomponent") + .withTopic("inventory") + .withRoutes(new DaprSubscriptionRoutes() + .withRules(Arrays.asList( + new DaprSubscriptionRouteRule().withMatch("event.type == 'widget'").withPath("/widgets"), + new DaprSubscriptionRouteRule().withMatch("event.type == 'gadget'").withPath("/gadgets"))) + .withDefaultProperty("/products")) + .withMetadata(mapOf("foo", "bar", "hello", "world")) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprSubscriptions_CreateOrUpdate_DefaultRoute.json + */ + /** + * Sample code: Create or update dapr subscription with default route only. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateDaprSubscriptionWithDefaultRouteOnly( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprSubscriptions() + .define("mysubscription") + .withExistingManagedEnvironment("examplerg", "myenvironment") + .withPubsubName("mypubsubcomponent") + .withTopic("inventory") + .withRoutes(new DaprSubscriptionRoutes().withDefaultProperty("/products")) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprSubscriptions_CreateOrUpdate_BulkSubscribeAndScopes.json + */ + /** + * Sample code: Create or update dapr subscription with bulk subscribe configuration and scopes. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateDaprSubscriptionWithBulkSubscribeConfigurationAndScopes( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprSubscriptions() + .define("mysubscription") + .withExistingManagedEnvironment("examplerg", "myenvironment") + .withPubsubName("mypubsubcomponent") + .withTopic("inventory") + .withRoutes(new DaprSubscriptionRoutes().withDefaultProperty("/products")) + .withScopes(Arrays.asList("warehouseapp", "customersupportapp")) + .withBulkSubscribe(new DaprSubscriptionBulkSubscribeOptions().withEnabled(true) + .withMaxMessagesCount(123) + .withMaxAwaitDurationMs(500)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprSubscriptionsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprSubscriptionsDeleteSamples.java new file mode 100644 index 0000000000000..b02f4a6eeb4a7 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprSubscriptionsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for DaprSubscriptions Delete. + */ +public final class DaprSubscriptionsDeleteSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprSubscriptions_Delete. + * json + */ + /** + * Sample code: Delete dapr subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteDaprSubscription(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprSubscriptions() + .deleteWithResponse("examplerg", "myenvironment", "mysubscription", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprSubscriptionsGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprSubscriptionsGetSamples.java new file mode 100644 index 0000000000000..f1a79e7b214e6 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprSubscriptionsGetSamples.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for DaprSubscriptions Get. + */ +public final class DaprSubscriptionsGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprSubscriptions_Get_DefaultRoute.json + */ + /** + * Sample code: Get Dapr subscription with bulk subscribe configuration and scopes. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getDaprSubscriptionWithBulkSubscribeConfigurationAndScopes( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprSubscriptions() + .getWithResponse("examplerg", "myenvironment", "mypubsubcomponent", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprSubscriptions_Get_BulkSubscribeAndScopes.json + */ + /** + * Sample code: Get Dapr subscription with default route only. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getDaprSubscriptionWithDefaultRouteOnly( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprSubscriptions() + .getWithResponse("examplerg", "myenvironment", "mypubsubcomponent", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DaprSubscriptions_Get_RouteRulesAndMetadata.json + */ + /** + * Sample code: GetDapr subscription with route rules and metadata. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getDaprSubscriptionWithRouteRulesAndMetadata( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprSubscriptions() + .getWithResponse("examplerg", "myenvironment", "mypubsubcomponent", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprSubscriptionsListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprSubscriptionsListSamples.java new file mode 100644 index 0000000000000..faa20c8c5279c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprSubscriptionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for DaprSubscriptions List. + */ +public final class DaprSubscriptionsListSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprSubscriptions_List.json + */ + /** + * Sample code: List Dapr subscriptions. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listDaprSubscriptions(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.daprSubscriptions().list("examplerg", "myenvironment", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..7095a1aa2bc56 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsCreateOrUpdateSamples.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.DotNetComponentConfigurationProperty; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentServiceBind; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentType; +import java.util.Arrays; + +/** + * Samples for DotNetComponents CreateOrUpdate. + */ +public final class DotNetComponentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DotNetComponents_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update .NET Component. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + createOrUpdateNETComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.dotNetComponents() + .define("mydotnetcomponent") + .withExistingManagedEnvironment("examplerg", "myenvironment") + .withComponentType(DotNetComponentType.ASPIRE_DASHBOARD) + .withConfigurations(Arrays.asList( + new DotNetComponentConfigurationProperty().withPropertyName("dashboard-theme").withValue("dark"))) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DotNetComponents_CreateOrUpdate_ServiceBind.json + */ + /** + * Sample code: Create or Update .NET Component with ServiceBinds. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateNETComponentWithServiceBinds( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.dotNetComponents() + .define("mydotnetcomponent") + .withExistingManagedEnvironment("examplerg", "myenvironment") + .withComponentType(DotNetComponentType.ASPIRE_DASHBOARD) + .withConfigurations(Arrays.asList( + new DotNetComponentConfigurationProperty().withPropertyName("dashboard-theme").withValue("dark"))) + .withServiceBinds(Arrays.asList(new DotNetComponentServiceBind().withName("yellowcat") + .withServiceId( + "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat"))) + .create(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsDeleteSamples.java new file mode 100644 index 0000000000000..72fecd9809257 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for DotNetComponents Delete. + */ +public final class DotNetComponentsDeleteSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_Delete.json + */ + /** + * Sample code: Delete .NET Component. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteNETComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.dotNetComponents() + .delete("examplerg", "myenvironment", "mydotnetcomponent", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsGetSamples.java new file mode 100644 index 0000000000000..3d3fe0a9f2e4a --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsGetSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for DotNetComponents Get. + */ +public final class DotNetComponentsGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DotNetComponents_Get_ServiceBind.json + */ + /** + * Sample code: Get .NET Component with ServiceBinds. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + getNETComponentWithServiceBinds(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.dotNetComponents() + .getWithResponse("examplerg", "myenvironment", "mydotnetcomponent", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_Get.json + */ + /** + * Sample code: Get .NET Component. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getNETComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.dotNetComponents() + .getWithResponse("examplerg", "myenvironment", "mydotnetcomponent", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsListSamples.java new file mode 100644 index 0000000000000..9e2ec3d64fb1a --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsListSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for DotNetComponents List. + */ +public final class DotNetComponentsListSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_List.json + */ + /** + * Sample code: List .NET Components. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listNETComponents(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.dotNetComponents().list("examplerg", "myenvironment", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DotNetComponents_List_ServiceBind.json + */ + /** + * Sample code: List .NET Components with ServiceBinds. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listNETComponentsWithServiceBinds(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.dotNetComponents().list("examplerg", "myenvironment", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsUpdateSamples.java new file mode 100644 index 0000000000000..7a8a7b9861903 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsUpdateSamples.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.DotNetComponent; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentConfigurationProperty; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentServiceBind; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentType; +import java.util.Arrays; + +/** + * Samples for DotNetComponents Update. + */ +public final class DotNetComponentsUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * DotNetComponents_Patch_ServiceBind.json + */ + /** + * Sample code: Patch .NET Component with ServiceBinds. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + patchNETComponentWithServiceBinds(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + DotNetComponent resource = manager.dotNetComponents() + .getWithResponse("examplerg", "myenvironment", "mydotnetcomponent", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withComponentType(DotNetComponentType.ASPIRE_DASHBOARD) + .withConfigurations(Arrays.asList( + new DotNetComponentConfigurationProperty().withPropertyName("dashboard-theme").withValue("dark"))) + .withServiceBinds(Arrays.asList(new DotNetComponentServiceBind().withName("yellowcat") + .withServiceId( + "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat"))) + .apply(); + } + + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_Patch.json + */ + /** + * Sample code: Patch .NET Component. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void patchNETComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + DotNetComponent resource = manager.dotNetComponents() + .getWithResponse("examplerg", "myenvironment", "mydotnetcomponent", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withComponentType(DotNetComponentType.ASPIRE_DASHBOARD) + .withConfigurations(Arrays.asList( + new DotNetComponentConfigurationProperty().withPropertyName("dashboard-theme").withValue("dark"))) + .apply(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/FunctionsExtensionInvokeFunctionsHostSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/FunctionsExtensionInvokeFunctionsHostSamples.java new file mode 100644 index 0000000000000..d2d152bd84293 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/FunctionsExtensionInvokeFunctionsHostSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for FunctionsExtension InvokeFunctionsHost. + */ +public final class FunctionsExtensionInvokeFunctionsHostSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/FunctionsExtension_Post.json + */ + /** + * Sample code: Invoke Functions host using Functions Extension API. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void invokeFunctionsHostUsingFunctionsExtensionAPI( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.functionsExtensions() + .invokeFunctionsHostWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", + "testcontainerApp0", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..db9afd651540f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsCreateOrUpdateSamples.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.JavaComponentConfigurationProperty; +import com.azure.resourcemanager.appcontainers.models.JavaComponentPropertiesScale; +import com.azure.resourcemanager.appcontainers.models.JavaComponentServiceBind; +import com.azure.resourcemanager.appcontainers.models.SpringBootAdminComponent; +import java.util.Arrays; + +/** + * Samples for JavaComponents CreateOrUpdate. + */ +public final class JavaComponentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * JavaComponents_CreateOrUpdate_ServiceBind.json + */ + /** + * Sample code: Create or Update Java Component with ServiceBinds. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateJavaComponentWithServiceBinds( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.javaComponents() + .define("myjavacomponent") + .withExistingManagedEnvironment("examplerg", "myenvironment") + .withProperties(new SpringBootAdminComponent().withConfigurations(Arrays.asList( + new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.ui.enable-toasts") + .withValue("true"), + new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.monitor.status-interval") + .withValue("10000ms"))) + .withScale(new JavaComponentPropertiesScale().withMinReplicas(1).withMaxReplicas(1)) + .withServiceBinds(Arrays.asList(new JavaComponentServiceBind().withName("yellowcat") + .withServiceId( + "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/yellowcat")))) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * JavaComponents_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Java Component. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + createOrUpdateJavaComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.javaComponents() + .define("myjavacomponent") + .withExistingManagedEnvironment("examplerg", "myenvironment") + .withProperties(new SpringBootAdminComponent().withConfigurations(Arrays.asList( + new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.ui.enable-toasts") + .withValue("true"), + new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.monitor.status-interval") + .withValue("10000ms"))) + .withScale(new JavaComponentPropertiesScale().withMinReplicas(1).withMaxReplicas(1))) + .create(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsDeleteSamples.java new file mode 100644 index 0000000000000..9f58ca0275774 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for JavaComponents Delete. + */ +public final class JavaComponentsDeleteSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_Delete.json + */ + /** + * Sample code: Delete Java Component. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteJavaComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.javaComponents() + .delete("examplerg", "myenvironment", "myjavacomponent", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsGetSamples.java new file mode 100644 index 0000000000000..9b84692a24aaa --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsGetSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for JavaComponents Get. + */ +public final class JavaComponentsGetSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_Get.json + */ + /** + * Sample code: Get Java Component. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getJavaComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.javaComponents() + .getWithResponse("examplerg", "myenvironment", "myjavacomponent", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * JavaComponents_Get_ServiceBind.json + */ + /** + * Sample code: Get Java Component with ServiceBinds. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + getJavaComponentWithServiceBinds(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.javaComponents() + .getWithResponse("examplerg", "myenvironment", "myjavacomponent", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsListSamples.java new file mode 100644 index 0000000000000..c44efbdb793f4 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsListSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for JavaComponents List. + */ +public final class JavaComponentsListSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_List.json + */ + /** + * Sample code: List Java Components. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listJavaComponents(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.javaComponents().list("examplerg", "myenvironment", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * JavaComponents_List_ServiceBind.json + */ + /** + * Sample code: List Java Components with ServiceBinds. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listJavaComponentsWithServiceBinds(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.javaComponents().list("examplerg", "myenvironment", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsUpdateSamples.java new file mode 100644 index 0000000000000..6150658c966de --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsUpdateSamples.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.JavaComponent; +import com.azure.resourcemanager.appcontainers.models.JavaComponentConfigurationProperty; +import com.azure.resourcemanager.appcontainers.models.JavaComponentPropertiesScale; +import com.azure.resourcemanager.appcontainers.models.JavaComponentServiceBind; +import com.azure.resourcemanager.appcontainers.models.SpringBootAdminComponent; +import java.util.Arrays; + +/** + * Samples for JavaComponents Update. + */ +public final class JavaComponentsUpdateSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_Patch.json + */ + /** + * Sample code: Patch Java Component. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void patchJavaComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + JavaComponent resource = manager.javaComponents() + .getWithResponse("examplerg", "myenvironment", "myjavacomponent", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new SpringBootAdminComponent().withConfigurations(Arrays.asList( + new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.ui.enable-toasts") + .withValue("true"), + new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.monitor.status-interval") + .withValue("10000ms"))) + .withScale(new JavaComponentPropertiesScale().withMinReplicas(1).withMaxReplicas(1))) + .apply(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * JavaComponents_Patch_ServiceBind.json + */ + /** + * Sample code: Patch Java Component with ServiceBinds. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + patchJavaComponentWithServiceBinds(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + JavaComponent resource = manager.javaComponents() + .getWithResponse("examplerg", "myenvironment", "myjavacomponent", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new SpringBootAdminComponent().withConfigurations(Arrays.asList( + new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.ui.enable-toasts") + .withValue("true"), + new JavaComponentConfigurationProperty().withPropertyName("spring.boot.admin.monitor.status-interval") + .withValue("10000ms"))) + .withScale(new JavaComponentPropertiesScale().withMinReplicas(1).withMaxReplicas(1)) + .withServiceBinds(Arrays.asList(new JavaComponentServiceBind().withName("yellowcat") + .withServiceId( + "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/yellowcat")))) + .apply(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsCreateOrUpdateSamples.java index 6e3ef1d7c8bdb..973b63251022a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsCreateOrUpdateSamples.java @@ -11,6 +11,10 @@ import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; import com.azure.resourcemanager.appcontainers.models.ContainerResources; +import com.azure.resourcemanager.appcontainers.models.ExtendedLocation; +import com.azure.resourcemanager.appcontainers.models.ExtendedLocationTypes; +import com.azure.resourcemanager.appcontainers.models.IdentitySettings; +import com.azure.resourcemanager.appcontainers.models.IdentitySettingsLifeCycle; import com.azure.resourcemanager.appcontainers.models.InitContainer; import com.azure.resourcemanager.appcontainers.models.JobConfiguration; import com.azure.resourcemanager.appcontainers.models.JobConfigurationEventTriggerConfig; @@ -18,18 +22,70 @@ import com.azure.resourcemanager.appcontainers.models.JobScale; import com.azure.resourcemanager.appcontainers.models.JobScaleRule; import com.azure.resourcemanager.appcontainers.models.JobTemplate; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentityType; import com.azure.resourcemanager.appcontainers.models.TriggerType; import com.azure.resourcemanager.appcontainers.models.Type; +import com.azure.resourcemanager.appcontainers.models.UserAssignedIdentity; +import com.azure.resourcemanager.appcontainers.models.VolumeMount; import java.io.IOException; import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; /** * Samples for Jobs CreateOrUpdate. */ public final class JobsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_CreateorUpdate_EventTrigger.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * Job_CreateorUpdate_ConnectedEnvironment.json + */ + /** + * Sample code: Create or Update Container Apps Job On A Connected Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateContainerAppsJobOnAConnectedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs() + .define("testcontainerAppsJob0") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withExtendedLocation(new ExtendedLocation().withName( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube") + .withConfiguration(new JobConfiguration().withTriggerType(TriggerType.MANUAL) + .withReplicaTimeout(10) + .withReplicaRetryLimit(10) + .withManualTriggerConfig( + new JobConfigurationManualTriggerConfig().withReplicaCompletionCount(1).withParallelism(4))) + .withTemplate(new JobTemplate() + .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerAppsJob0:v4") + .withName("testinitcontainerAppsJob0") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerAppsJob0:v1") + .withName("testcontainerAppsJob0") + .withProbes(Arrays.asList(new ContainerAppProbe() + .withHttpGet(new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)) + .withInitialDelaySeconds(5) + .withPeriodSeconds(3) + .withType(Type.LIVENESS)))))) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * Job_CreateorUpdate_EventTrigger.json */ /** * Sample code: Create or Update Container Apps Job With Event Driven Trigger. @@ -39,9 +95,13 @@ public final class JobsCreateOrUpdateSamples { public static void createOrUpdateContainerAppsJobWithEventDrivenTrigger( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) throws IOException { manager.jobs() - .define("testcontainerappsjob0") + .define("testcontainerAppsJob0") .withRegion("East US") .withExistingResourceGroup("rg") + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity", + new UserAssignedIdentity()))) .withEnvironmentId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") .withConfiguration(new JobConfiguration().withTriggerType(TriggerType.EVENT) @@ -55,22 +115,23 @@ public static void createOrUpdateContainerAppsJobWithEventDrivenTrigger( .withRules(Arrays.asList(new JobScaleRule().withName("servicebuscalingrule") .withType("azure-servicebus") .withMetadata(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize("{\"topicName\":\"my-topic\"}", Object.class, - SerializerEncoding.JSON))))))) + .deserialize("{\"topicName\":\"my-topic\"}", Object.class, SerializerEncoding.JSON)) + .withIdentity( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity")))))) .withTemplate(new JobTemplate() - .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerappsjob0:v4") + .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerAppsJob0:v4") .withName("testinitcontainerAppsJob0") .withCommand(Arrays.asList("/bin/sh")) .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) - .withResources(new ContainerResources().withCpu(0.5D).withMemory("1Gi")))) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) .withContainers(Arrays.asList( - new Container().withImage("repo/testcontainerappsjob0:v1").withName("testcontainerappsjob0")))) + new Container().withImage("repo/testcontainerAppsJob0:v1").withName("testcontainerAppsJob0")))) .create(); } /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_CreateorUpdate.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_CreateorUpdate.json */ /** * Sample code: Create or Update Container Apps Job. @@ -80,24 +141,40 @@ public static void createOrUpdateContainerAppsJobWithEventDrivenTrigger( public static void createOrUpdateContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager.jobs() - .define("testcontainerappsjob0") + .define("testcontainerAppsJob0") .withRegion("East US") .withExistingResourceGroup("rg") + .withIdentity(new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity", + new UserAssignedIdentity()))) .withEnvironmentId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") .withConfiguration(new JobConfiguration().withTriggerType(TriggerType.MANUAL) .withReplicaTimeout(10) .withReplicaRetryLimit(10) .withManualTriggerConfig( - new JobConfigurationManualTriggerConfig().withReplicaCompletionCount(1).withParallelism(4))) + new JobConfigurationManualTriggerConfig().withReplicaCompletionCount(1).withParallelism(4)) + .withIdentitySettings(Arrays.asList(new IdentitySettings().withIdentity( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity") + .withLifecycle(IdentitySettingsLifeCycle.ALL), + new IdentitySettings().withIdentity("system").withLifecycle(IdentitySettingsLifeCycle.INIT)))) .withTemplate(new JobTemplate() - .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerappsjob0:v4") + .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerAppsJob0:v4") .withName("testinitcontainerAppsJob0") .withCommand(Arrays.asList("/bin/sh")) .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) - .withResources(new ContainerResources().withCpu(0.5D).withMemory("1Gi")))) - .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerappsjob0:v1") - .withName("testcontainerappsjob0") + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerAppsJob0:v1") + .withName("testcontainerAppsJob0") + .withVolumeMounts(Arrays.asList( + new VolumeMount().withVolumeName("azurefile") + .withMountPath("/mnt/path1") + .withSubPath("subPath1"), + new VolumeMount().withVolumeName("nfsazurefile") + .withMountPath("/mnt/path2") + .withSubPath("subPath2"))) .withProbes(Arrays.asList(new ContainerAppProbe() .withHttpGet(new ContainerAppProbeHttpGet() .withHttpHeaders( @@ -110,4 +187,16 @@ public static void createOrUpdateContainerAppsJobWithEventDrivenTrigger( .withType(Type.LIVENESS)))))) .create(); } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsDeleteSamples.java index c16590d5704c9..b76e448833723 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsDeleteSamples.java @@ -9,7 +9,8 @@ */ public final class JobsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Delete.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Delete.json */ /** * Sample code: Delete Container Apps Job. @@ -17,6 +18,6 @@ public final class JobsDeleteSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void deleteContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs().delete("rg", "testworkercontainerappsjob0", com.azure.core.util.Context.NONE); + manager.jobs().delete("rg", "testWorkerContainerAppsJob0", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsExecutionsListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsExecutionsListSamples.java index 6cffe37fdc77b..94a4e76b70442 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsExecutionsListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsExecutionsListSamples.java @@ -10,7 +10,7 @@ public final class JobsExecutionsListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Executions_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Executions_Get.json */ /** * Sample code: Get a Container Apps Job Executions. @@ -19,6 +19,6 @@ public final class JobsExecutionsListSamples { */ public static void getAContainerAppsJobExecutions(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobsExecutions().list("rg", "testcontainerappsjob0", null, com.azure.core.util.Context.NONE); + manager.jobsExecutions().list("rg", "testcontainerAppsJob0", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsGetByResourceGroupSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsGetByResourceGroupSamples.java index 4f132bd4ed2a1..a309e5dde176d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsGetByResourceGroupSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsGetByResourceGroupSamples.java @@ -9,7 +9,8 @@ */ public final class JobsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Get.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Get.json */ /** * Sample code: Get Container Apps Job. @@ -17,6 +18,6 @@ public final class JobsGetByResourceGroupSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs().getByResourceGroupWithResponse("rg", "testcontainerappsjob0", com.azure.core.util.Context.NONE); + manager.jobs().getByResourceGroupWithResponse("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsGetDetectorSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsGetDetectorSamples.java index 46f0c8dc1a2cf..cca0b1cf282af 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsGetDetectorSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsGetDetectorSamples.java @@ -10,7 +10,7 @@ public final class JobsGetDetectorSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_GetDetector.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_GetDetector.json */ /** * Sample code: Get diagnostic data for a Container App Job. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListByResourceGroupSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListByResourceGroupSamples.java index 5b3fc061147c6..117f74e5aa9c9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListByResourceGroupSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListByResourceGroupSamples.java @@ -10,7 +10,8 @@ public final class JobsListByResourceGroupSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Jobs_ListByResourceGroup.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Jobs_ListByResourceGroup. + * json */ /** * Sample code: List Container Apps Jobs by resource group. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListDetectorsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListDetectorsSamples.java index d133559de722f..c68aecf2608c4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListDetectorsSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListDetectorsSamples.java @@ -10,7 +10,7 @@ public final class JobsListDetectorsSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_ListDetectors.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_ListDetectors.json */ /** * Sample code: Get the list of available diagnostic data for a Container App Job. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListSamples.java index 17958d0994bab..67d518d641aca 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListSamples.java @@ -10,7 +10,7 @@ public final class JobsListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Jobs_ListBySubscription.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Jobs_ListBySubscription.json */ /** * Sample code: List Container Apps Jobs by subscription. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListSecretsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListSecretsSamples.java index 70431726dd3c0..f19d121d71fae 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListSecretsSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListSecretsSamples.java @@ -10,7 +10,7 @@ public final class JobsListSecretsSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_ListSecrets.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_ListSecrets.json */ /** * Sample code: List Container Apps Job Secrets. @@ -19,6 +19,6 @@ public final class JobsListSecretsSamples { */ public static void listContainerAppsJobSecrets(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs().listSecretsWithResponse("rg", "testcontainerappsjob0", com.azure.core.util.Context.NONE); + manager.jobs().listSecretsWithResponse("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsProxyGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsProxyGetSamples.java index 83cf3b0e5e368..45938210e83a1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsProxyGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsProxyGetSamples.java @@ -9,7 +9,8 @@ */ public final class JobsProxyGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_ProxyGet.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_ProxyGet.json */ /** * Sample code: Get Container App Job by name. @@ -18,6 +19,6 @@ public final class JobsProxyGetSamples { */ public static void getContainerAppJobByName(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs().proxyGetWithResponse("rg", "testcontainerappsjob0", "rootApi", com.azure.core.util.Context.NONE); + manager.jobs().proxyGetWithResponse("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsResumeSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsResumeSamples.java new file mode 100644 index 0000000000000..a0d1a9a3d2b74 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsResumeSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for Jobs Resume. + */ +public final class JobsResumeSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Jobs_Resume.json + */ + /** + * Sample code: Resume Job. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void resumeJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().resume("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsStartSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsStartSamples.java index 55500dbc8fc57..93c5a0146c92b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsStartSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsStartSamples.java @@ -14,7 +14,8 @@ */ public final class JobsStartSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Start.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Start.json */ /** * Sample code: Run a Container Apps Job. @@ -23,15 +24,15 @@ public final class JobsStartSamples { */ public static void runAContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager.jobs() - .start("rg", "testcontainerappsjob0", new JobExecutionTemplate() - .withContainers(Arrays.asList(new JobExecutionContainer().withImage("repo/testcontainerappsjob0:v4") - .withName("testcontainerappsjob0") - .withResources(new ContainerResources().withCpu(0.5D).withMemory("1Gi")))) - .withInitContainers(Arrays.asList(new JobExecutionContainer().withImage("repo/testcontainerappsjob0:v4") + .start("rg", "testcontainerAppsJob0", new JobExecutionTemplate() + .withContainers(Arrays.asList(new JobExecutionContainer().withImage("repo/testcontainerAppsJob0:v4") + .withName("testcontainerAppsJob0") + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withInitContainers(Arrays.asList(new JobExecutionContainer().withImage("repo/testcontainerAppsJob0:v4") .withName("testinitcontainerAppsJob0") .withCommand(Arrays.asList("/bin/sh")) .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) - .withResources(new ContainerResources().withCpu(0.5D).withMemory("1Gi")))), + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))), com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsStopExecutionSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsStopExecutionSamples.java index 8bdb5304a6dd0..415fe63c30514 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsStopExecutionSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsStopExecutionSamples.java @@ -10,7 +10,7 @@ public final class JobsStopExecutionSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Stop_Execution.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Stop_Execution.json */ /** * Sample code: Terminate a Container Apps Job. @@ -19,6 +19,6 @@ public final class JobsStopExecutionSamples { */ public static void terminateAContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs().stopExecution("rg", "testcontainerappsjob0", "jobExecution1", com.azure.core.util.Context.NONE); + manager.jobs().stopExecution("rg", "testcontainerAppsJob0", "jobExecution1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsStopMultipleExecutionsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsStopMultipleExecutionsSamples.java index 46025eed5539c..276f8a8ab0b4c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsStopMultipleExecutionsSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsStopMultipleExecutionsSamples.java @@ -10,7 +10,7 @@ public final class JobsStopMultipleExecutionsSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Stop_Multiple.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Stop_Multiple.json */ /** * Sample code: Terminate Multiple Container Apps Job. @@ -19,6 +19,6 @@ public final class JobsStopMultipleExecutionsSamples { */ public static void terminateMultipleContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.jobs().stopMultipleExecutions("rg", "testcontainerappsjob0", com.azure.core.util.Context.NONE); + manager.jobs().stopMultipleExecutions("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsSuspendSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsSuspendSamples.java new file mode 100644 index 0000000000000..ade74a6c222b1 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsSuspendSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for Jobs Suspend. + */ +public final class JobsSuspendSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Jobs_Suspend.json + */ + /** + * Sample code: Suspend Job. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void suspendJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().suspend("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsUpdateSamples.java index bca686a7a560d..ee301ddb73d9d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsUpdateSamples.java @@ -24,7 +24,8 @@ */ public final class JobsUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Patch.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Patch.json */ /** * Sample code: Patch Container Apps Job. @@ -33,7 +34,7 @@ public final class JobsUpdateSamples { */ public static void patchContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { Job resource = manager.jobs() - .getByResourceGroupWithResponse("rg", "testcontainerappsjob0", com.azure.core.util.Context.NONE) + .getByResourceGroupWithResponse("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE) .getValue(); resource.update() .withProperties(new JobPatchPropertiesProperties() @@ -43,13 +44,13 @@ public static void patchContainerAppsJob(com.azure.resourcemanager.appcontainers .withManualTriggerConfig( new JobConfigurationManualTriggerConfig().withReplicaCompletionCount(1).withParallelism(4))) .withTemplate(new JobTemplate() - .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerappsjob0:v4") + .withInitContainers(Arrays.asList(new InitContainer().withImage("repo/testcontainerAppsJob0:v4") .withName("testinitcontainerAppsJob0") .withCommand(Arrays.asList("/bin/sh")) .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) - .withResources(new ContainerResources().withCpu(0.5D).withMemory("1Gi")))) - .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerappsjob0:v1") - .withName("testcontainerappsjob0") + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers(Arrays.asList(new Container().withImage("repo/testcontainerAppsJob0:v1") + .withName("testcontainerAppsJob0") .withProbes(Arrays.asList(new ContainerAppProbe() .withHttpGet(new ContainerAppProbeHttpGet() .withHttpHeaders(Arrays diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..7059bea17e9dc --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsCreateOrUpdateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** + * Samples for LogicApps CreateOrUpdate. + */ +public final class LogicAppsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_Create.json + */ + /** + * Sample code: Create logic app extension. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createLogicAppExtension(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) + throws IOException { + manager.logicApps() + .define("testcontainerApp0") + .withExistingContainerApp("examplerg", "testcontainerApp0") + .withProperties(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .create(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsDeleteSamples.java new file mode 100644 index 0000000000000..8a6c4e072c793 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for LogicApps Delete. + */ +public final class LogicAppsDeleteSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_Delete.json + */ + /** + * Sample code: Create logic app extension. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + createLogicAppExtension(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.logicApps() + .deleteWithResponse("examplerg", "testcontainerApp0", "testcontainerApp0", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsDeployWorkflowArtifactsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsDeployWorkflowArtifactsSamples.java new file mode 100644 index 0000000000000..db0a080601c71 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsDeployWorkflowArtifactsSamples.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.appcontainers.models.WorkflowArtifacts; +import java.io.IOException; +import java.util.Arrays; + +/** + * Samples for LogicApps DeployWorkflowArtifacts. + */ +public final class LogicAppsDeployWorkflowArtifactsSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * LogicApps_PostDeployWorkflowArtifacts.json + */ + /** + * Sample code: Deploys workflow artifacts. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deploysWorkflowArtifacts(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) + throws IOException { + manager.logicApps() + .deployWorkflowArtifactsWithResponse("testrg123", "testapp2", "testapp2", new WorkflowArtifacts() + .withAppSettings(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"eventHub_connectionString\":\"Endpoint=sb://example.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=EXAMPLE1a2b3c4d5e6fEXAMPLE=\"}", + Object.class, SerializerEncoding.JSON)) + .withFiles(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"connections.json\":{\"managedApiConnections\":{},\"serviceProviderConnections\":{\"eventHub\":{\"displayName\":\"example1\",\"parameterValues\":{\"connectionString\":\"@appsetting('eventHub_connectionString')\"},\"serviceProvider\":{\"id\":\"/serviceProviders/eventHub\"}}}},\"test1/workflow.json\":{\"definition\":{\"$schema\":\"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#\",\"actions\":{},\"contentVersion\":\"1.0.0.0\",\"outputs\":{},\"triggers\":{\"When_events_are_available_in_Event_hub\":{\"type\":\"ServiceProvider\",\"inputs\":{\"parameters\":{\"eventHubName\":\"test123\"},\"serviceProviderConfiguration\":{\"operationId\":\"receiveEvents\",\"connectionName\":\"eventHub\",\"serviceProviderId\":\"/serviceProviders/eventHub\"}},\"splitOn\":\"@triggerOutputs()?['body']\"}}},\"kind\":\"Stateful\"}}", + Object.class, SerializerEncoding.JSON)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * LogicApps_DeleteDeployWorkflowArtifacts.json + */ + /** + * Sample code: Delete workflow artifacts. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + deleteWorkflowArtifacts(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.logicApps() + .deployWorkflowArtifactsWithResponse("testrg123", "testapp2", "testapp2", + new WorkflowArtifacts().withFilesToDelete(Arrays.asList("test/workflow.json", "test/")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsGetSamples.java new file mode 100644 index 0000000000000..a15c4877b3b8d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for LogicApps Get. + */ +public final class LogicAppsGetSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_Get.json + */ + /** + * Sample code: Get logic app extension by name. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + getLogicAppExtensionByName(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.logicApps() + .getWithResponse("examplerg", "testcontainerApp0", "testcontainerApp0", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsGetWorkflowSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsGetWorkflowSamples.java new file mode 100644 index 0000000000000..b00e986a48707 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsGetWorkflowSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for LogicApps GetWorkflow. + */ +public final class LogicAppsGetWorkflowSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_GetWorkflow.json + */ + /** + * Sample code: GET a workflow. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void gETAWorkflow(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.logicApps() + .getWorkflowWithResponse("examplerg", "testcontainerApp0", "testcontainerApp0", "stateful1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsInvokeSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsInvokeSamples.java new file mode 100644 index 0000000000000..21d6cbf7adbc0 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsInvokeSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.LogicAppsProxyMethod; + +/** + * Samples for LogicApps Invoke. + */ +public final class LogicAppsInvokeSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_ListCallbackURL. + * json + */ + /** + * Sample code: Get workflow list call back URL. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + getWorkflowListCallBackURL(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.logicApps() + .invokeWithResponse("testrg123", "testapp2", "testapp2", + "/runtime/webhooks/workflow/api/management/workflows/Stateful1/triggers/When_a_HTTP_request_is_received/listCallbackUrl", + LogicAppsProxyMethod.POST, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsListWorkflowsConnectionsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsListWorkflowsConnectionsSamples.java new file mode 100644 index 0000000000000..966165fb33cc0 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsListWorkflowsConnectionsSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for LogicApps ListWorkflowsConnections. + */ +public final class LogicAppsListWorkflowsConnectionsSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_ListConnections. + * json + */ + /** + * Sample code: List the Workflows Configuration Connections. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listTheWorkflowsConfigurationConnections( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.logicApps() + .listWorkflowsConnectionsWithResponse("testrg123", "testapp2", "testapp2", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsListWorkflowsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsListWorkflowsSamples.java new file mode 100644 index 0000000000000..e89f741ad8f15 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsListWorkflowsSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for LogicApps ListWorkflows. + */ +public final class LogicAppsListWorkflowsSamples { + /* + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_ListWorkflows.json + */ + /** + * Sample code: List the workflows. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listTheWorkflows(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.logicApps() + .listWorkflows("examplerg", "testcontainerApp0", "testcontainerApp0", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesCreateOrUpdateSamples.java index 3aa6b33a16416..48aa7b073730b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesCreateOrUpdateSamples.java @@ -12,9 +12,8 @@ */ public final class ManagedCertificatesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedCertificate_CreateOrUpdate. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedCertificate_CreateOrUpdate.json */ /** * Sample code: Create or Update Certificate. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesDeleteSamples.java index 30c66d5896f5b..41fbb11fe73a9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesDeleteSamples.java @@ -10,7 +10,8 @@ public final class ManagedCertificatesDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedCertificate_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedCertificate_Delete. + * json */ /** * Sample code: Delete Certificate. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesGetSamples.java index fd1ca7b17c2e5..f7f72aed6b2d8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesGetSamples.java @@ -10,7 +10,7 @@ public final class ManagedCertificatesGetSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedCertificate_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedCertificate_Get.json */ /** * Sample code: Get Certificate. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesListSamples.java index 6854c1af6b582..31bcebb6e29c2 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesListSamples.java @@ -9,7 +9,7 @@ */ public final class ManagedCertificatesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ManagedCertificates_ListByManagedEnvironment.json */ /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesUpdateSamples.java index 3511449c4147c..895c3e3e8511f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesUpdateSamples.java @@ -14,7 +14,8 @@ public final class ManagedCertificatesUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedCertificates_Patch.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedCertificates_Patch. + * json */ /** * Sample code: Patch Managed Certificate. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsGetDetectorSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsGetDetectorSamples.java index a0a1497327c9e..a0c94afac2b8f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsGetDetectorSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsGetDetectorSamples.java @@ -9,9 +9,8 @@ */ public final class ManagedEnvironmentDiagnosticsGetDetectorSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironmentDiagnostics_Get. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentDiagnostics_Get.json */ /** * Sample code: Get diagnostic data for a managed environments. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsListDetectorsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsListDetectorsSamples.java index cfbf87cd9c64d..c9a294291bc9c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsListDetectorsSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsListDetectorsSamples.java @@ -9,9 +9,8 @@ */ public final class ManagedEnvironmentDiagnosticsListDetectorsSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironmentDiagnostics_List. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentDiagnostics_List.json */ /** * Sample code: Get the list of available diagnostic data for a managed environments. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..87843e4e62a1f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointConnection; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.appcontainers.models.PrivateLinkServiceConnectionState; + +/** + * Samples for ManagedEnvironmentPrivateEndpointConnections CreateOrUpdate. + */ +public final class ManagedEnvironmentPrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentPrivateEndpointConnections_CreateOrUpdate.json + */ + /** + * Sample code: Update a Private Endpoint Connection by Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void updateAPrivateEndpointConnectionByManagedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + PrivateEndpointConnection resource = manager.managedEnvironmentPrivateEndpointConnections() + .getWithResponse("examplerg", "managedEnv", "jlaw-demo1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withActionsRequired("None")) + .apply(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..b5d38a2e8e0a3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for ManagedEnvironmentPrivateEndpointConnections Delete. + */ +public final class ManagedEnvironmentPrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentPrivateEndpointConnections_Delete.json + */ + /** + * Sample code: Delete a Private Endpoint Connection by Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteAPrivateEndpointConnectionByManagedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.managedEnvironmentPrivateEndpointConnections() + .delete("examplerg", "managedEnv", "jlaw-demo1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsGetSamples.java new file mode 100644 index 0000000000000..721ed9d779f36 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for ManagedEnvironmentPrivateEndpointConnections Get. + */ +public final class ManagedEnvironmentPrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentPrivateEndpointConnections_Get.json + */ + /** + * Sample code: Get a Private Endpoint Connection by Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getAPrivateEndpointConnectionByManagedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.managedEnvironmentPrivateEndpointConnections() + .getWithResponse("examplerg", "managedEnv", "jlaw-demo1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsListSamples.java new file mode 100644 index 0000000000000..a3aae49c0f53e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for ManagedEnvironmentPrivateEndpointConnections List. + */ +public final class ManagedEnvironmentPrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentPrivateEndpointConnections_List.json + */ + /** + * Sample code: List Private Endpoint Connections by Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listPrivateEndpointConnectionsByManagedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.managedEnvironmentPrivateEndpointConnections() + .list("examplerg", "managedEnv", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateLinkResourcesListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateLinkResourcesListSamples.java new file mode 100644 index 0000000000000..3ff930306954c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateLinkResourcesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for ManagedEnvironmentPrivateLinkResources List. + */ +public final class ManagedEnvironmentPrivateLinkResourcesListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentPrivateLinkResources_List.json + */ + /** + * Sample code: List Private Link Resources by Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listPrivateLinkResourcesByManagedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.managedEnvironmentPrivateLinkResources() + .list("examplerg", "managedEnv", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentUsagesListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentUsagesListSamples.java index 02591fe31f8ad..85e1ddcd9fb80 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentUsagesListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentUsagesListSamples.java @@ -9,8 +9,8 @@ */ public final class ManagedEnvironmentUsagesListSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironmentUsages_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentUsages_List.json */ /** * Sample code: List managed environment usages. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsCreateOrUpdateSamples.java index 5e83f7a3f1277..0313fc040349e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsCreateOrUpdateSamples.java @@ -4,23 +4,37 @@ package com.azure.resourcemanager.appcontainers.generated; +import com.azure.resourcemanager.appcontainers.models.AppInsightsConfiguration; import com.azure.resourcemanager.appcontainers.models.AppLogsConfiguration; import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; +import com.azure.resourcemanager.appcontainers.models.DataDogConfiguration; +import com.azure.resourcemanager.appcontainers.models.DestinationsConfiguration; +import com.azure.resourcemanager.appcontainers.models.Header; import com.azure.resourcemanager.appcontainers.models.LogAnalyticsConfiguration; +import com.azure.resourcemanager.appcontainers.models.LogsConfiguration; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerAuthentication; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfiguration; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.appcontainers.models.MetricsConfiguration; import com.azure.resourcemanager.appcontainers.models.Mtls; +import com.azure.resourcemanager.appcontainers.models.OpenTelemetryConfiguration; +import com.azure.resourcemanager.appcontainers.models.OtlpConfiguration; +import com.azure.resourcemanager.appcontainers.models.TracesConfiguration; +import com.azure.resourcemanager.appcontainers.models.UserAssignedIdentity; import com.azure.resourcemanager.appcontainers.models.VnetConfiguration; import com.azure.resourcemanager.appcontainers.models.WorkloadProfile; import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; /** * Samples for ManagedEnvironments CreateOrUpdate. */ public final class ManagedEnvironmentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ManagedEnvironments_CustomInfrastructureResourceGroup_Create.json */ /** @@ -46,6 +60,7 @@ public static void createEnvironmentWithCustomInfrastructureResourceGroup( .withCertificatePassword("fakeTokenPlaceholder")) .withWorkloadProfiles(Arrays.asList( new WorkloadProfile().withName("My-GP-01") + .withEnableFips(true) .withWorkloadProfileType("GeneralPurpose") .withMinimumCount(3) .withMaximumCount(12), @@ -63,9 +78,8 @@ public static void createEnvironmentWithCustomInfrastructureResourceGroup( } /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironments_CreateOrUpdate. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironments_CreateOrUpdate.json */ /** * Sample code: Create environments. @@ -77,18 +91,44 @@ public static void createEnvironments(com.azure.resourcemanager.appcontainers.Co .define("testcontainerenv") .withRegion("East US") .withExistingResourceGroup("examplerg") + .withIdentity(new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.fromString("SystemAssigned, UserAssigned")) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity", + new UserAssignedIdentity()))) .withDaprAIConnectionString( "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/") .withVnetConfiguration(new VnetConfiguration().withInfrastructureSubnetId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1")) - .withAppLogsConfiguration(new AppLogsConfiguration().withLogAnalyticsConfiguration( - new LogAnalyticsConfiguration().withCustomerId("string").withSharedKey("fakeTokenPlaceholder"))) + .withAppLogsConfiguration(new AppLogsConfiguration() + .withLogAnalyticsConfiguration(new LogAnalyticsConfiguration().withCustomerId("string") + .withSharedKey("fakeTokenPlaceholder") + .withDynamicJsonColumns(true))) + .withAppInsightsConfiguration(new AppInsightsConfiguration().withConnectionString( + "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://eastus-8.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/")) + .withOpenTelemetryConfiguration( + new OpenTelemetryConfiguration() + .withDestinationsConfiguration( + new DestinationsConfiguration() + .withDataDogConfiguration( + new DataDogConfiguration().withSite("string").withKey("fakeTokenPlaceholder")) + .withOtlpConfigurations(Arrays.asList(new OtlpConfiguration().withName("dashboard") + .withEndpoint("dashboard.k8s.region.azurecontainerapps.io:80") + .withInsecure(true) + .withHeaders(Arrays + .asList(new Header().withKey("fakeTokenPlaceholder").withValue("xxxxxxxxxxx")))))) + .withTracesConfiguration( + new TracesConfiguration().withIncludeDapr(true).withDestinations(Arrays.asList("appInsights"))) + .withLogsConfiguration(new LogsConfiguration().withDestinations(Arrays.asList("appInsights"))) + .withMetricsConfiguration( + new MetricsConfiguration().withIncludeKeda(true).withDestinations(Arrays.asList("dataDog")))) .withZoneRedundant(true) .withCustomDomainConfiguration(new CustomDomainConfiguration().withDnsSuffix("www.my-name.com") .withCertificateValue("Y2VydA==".getBytes()) .withCertificatePassword("fakeTokenPlaceholder")) .withWorkloadProfiles(Arrays.asList( new WorkloadProfile().withName("My-GP-01") + .withEnableFips(true) .withWorkloadProfileType("GeneralPurpose") .withMinimumCount(3) .withMaximumCount(12), @@ -107,4 +147,16 @@ public static void createEnvironments(com.azure.resourcemanager.appcontainers.Co .withEncryption(new ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption().withEnabled(true))) .create(); } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDeleteSamples.java index e934f21bbad47..29090f9ae4205 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDeleteSamples.java @@ -10,7 +10,8 @@ public final class ManagedEnvironmentsDeleteSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironments_Delete.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_Delete. + * json */ /** * Sample code: Delete environment by name. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDiagnosticsGetRootSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDiagnosticsGetRootSamples.java index db644951f9311..8e2a2d466ebcc 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDiagnosticsGetRootSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDiagnosticsGetRootSamples.java @@ -10,7 +10,7 @@ public final class ManagedEnvironmentsDiagnosticsGetRootSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironments_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_Get.json */ /** * Sample code: Get environments by name. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsGetAuthTokenSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsGetAuthTokenSamples.java index 75157d868a8d9..da417c5c2e480 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsGetAuthTokenSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsGetAuthTokenSamples.java @@ -9,8 +9,8 @@ */ public final class ManagedEnvironmentsGetAuthTokenSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironments_GetAuthToken.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironments_GetAuthToken.json */ /** * Sample code: Get Managed Environment Auth Token. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsGetByResourceGroupSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsGetByResourceGroupSamples.java index b70ec50aec030..58263b19bcf3f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsGetByResourceGroupSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsGetByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class ManagedEnvironmentsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironments_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_Get.json */ /** * Sample code: Get environments by name. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListByResourceGroupSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListByResourceGroupSamples.java index 46f3eb29325e2..bd2c8466caa94 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListByResourceGroupSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class ManagedEnvironmentsListByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ManagedEnvironments_ListByResourceGroup.json */ /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListSamples.java index 6850c663a5227..24c471f995548 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListSamples.java @@ -9,7 +9,7 @@ */ public final class ManagedEnvironmentsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ManagedEnvironments_ListBySubscription.json */ /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListWorkloadProfileStatesSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListWorkloadProfileStatesSamples.java index 59e7432de71e5..dc3b8052e876b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListWorkloadProfileStatesSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListWorkloadProfileStatesSamples.java @@ -9,7 +9,7 @@ */ public final class ManagedEnvironmentsListWorkloadProfileStatesSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ManagedEnvironments_ListWorkloadProfileStates.json */ /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesCreateOrUpdateSamples.java index e553d1d932ac0..57c64dc2e168a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesCreateOrUpdateSamples.java @@ -7,13 +7,35 @@ import com.azure.resourcemanager.appcontainers.models.AccessMode; import com.azure.resourcemanager.appcontainers.models.AzureFileProperties; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentStorageProperties; +import com.azure.resourcemanager.appcontainers.models.NfsAzureFileProperties; /** * Samples for ManagedEnvironmentsStorages CreateOrUpdate. */ public final class ManagedEnvironmentsStoragesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentsStorages_CreateOrUpdate_NfsAzureFile.json + */ + /** + * Sample code: Create or update environments storage for NFS Azure file. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateEnvironmentsStorageForNFSAzureFile( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.managedEnvironmentsStorages() + .define("jlaw-demo1") + .withExistingManagedEnvironment("examplerg", "managedEnv") + .withProperties(new ManagedEnvironmentStorageProperties() + .withNfsAzureFile(new NfsAzureFileProperties().withServer("server1") + .withAccessMode(AccessMode.READ_ONLY) + .withShareName("share1"))) + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * ManagedEnvironmentsStorages_CreateOrUpdate.json */ /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesDeleteSamples.java index 947a543af0bc2..96aa482aec40c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesDeleteSamples.java @@ -9,9 +9,8 @@ */ public final class ManagedEnvironmentsStoragesDeleteSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironmentsStorages_Delete. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentsStorages_Delete.json */ /** * Sample code: List environments storages by subscription. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesGetSamples.java index c5bbaedfa623d..514d0805333ee 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesGetSamples.java @@ -9,15 +9,30 @@ */ public final class ManagedEnvironmentsStoragesGetSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironmentsStorages_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentsStorages_Get.json */ /** - * Sample code: get a environments storage properties by subscription. + * Sample code: get a environments storage. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void getAEnvironmentsStoragePropertiesBySubscription( + public static void + getAEnvironmentsStorage(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.managedEnvironmentsStorages() + .getWithResponse("examplerg", "managedEnv", "jlaw-demo1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentsStorages_Get_NfsAzureFile.json + */ + /** + * Sample code: get a environments storage for NFS Azure file. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getAEnvironmentsStorageForNFSAzureFile( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager.managedEnvironmentsStorages() .getWithResponse("examplerg", "managedEnv", "jlaw-demo1", com.azure.core.util.Context.NONE); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesListSamples.java index b99e26839932b..bbe5f49947ded 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesListSamples.java @@ -9,8 +9,8 @@ */ public final class ManagedEnvironmentsStoragesListSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironmentsStorages_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ManagedEnvironmentsStorages_List.json */ /** * Sample code: List environments storages by subscription. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsUpdateSamples.java index f7fcbe575759c..562aefc9b79ad 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsUpdateSamples.java @@ -14,7 +14,8 @@ public final class ManagedEnvironmentsUpdateSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironments_Patch.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_Patch. + * json */ /** * Sample code: Patch Managed Environment. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/NamespacesCheckNameAvailabilitySamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/NamespacesCheckNameAvailabilitySamples.java index a148016e8eea5..7d2e2239211fb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/NamespacesCheckNameAvailabilitySamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/NamespacesCheckNameAvailabilitySamples.java @@ -11,9 +11,8 @@ */ public final class NamespacesCheckNameAvailabilitySamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificates_CheckNameAvailability. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * Certificates_CheckNameAvailability.json */ /** * Sample code: Certificates_CheckNameAvailability. @@ -30,9 +29,8 @@ public final class NamespacesCheckNameAvailabilitySamples { } /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_CheckNameAvailability. - * json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ + * ContainerApps_CheckNameAvailability.json */ /** * Sample code: ContainerApps_CheckNameAvailability. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/OperationsListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/OperationsListSamples.java index b8e134de4c30c..8ad710ecba765 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/OperationsListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/OperationsListSamples.java @@ -10,7 +10,7 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Operations_List.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Operations_List.json */ /** * Sample code: List all operations. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ResourceProviderGetCustomDomainVerificationIdSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ResourceProviderGetCustomDomainVerificationIdSamples.java index e7470736e6433..5f2c8a16dacc0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ResourceProviderGetCustomDomainVerificationIdSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ResourceProviderGetCustomDomainVerificationIdSamples.java @@ -9,7 +9,7 @@ */ public final class ResourceProviderGetCustomDomainVerificationIdSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ * Subscriptions_GetCustomDomainVerificationId.json */ /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ResourceProviderJobExecutionSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ResourceProviderJobExecutionSamples.java index 40e9ae5b66d77..179edce84f52c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ResourceProviderJobExecutionSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ResourceProviderJobExecutionSamples.java @@ -10,7 +10,7 @@ public final class ResourceProviderJobExecutionSamples { /* * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Execution_Get.json + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Execution_Get.json */ /** * Sample code: Get a single Job Execution. @@ -19,6 +19,6 @@ public final class ResourceProviderJobExecutionSamples { */ public static void getASingleJobExecution(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager.resourceProviders() - .jobExecutionWithResponse("rg", "testcontainerappsjob0", "jobExecution1", com.azure.core.util.Context.NONE); + .jobExecutionWithResponse("rg", "testcontainerAppsJob0", "jobExecution1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/UsagesListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/UsagesListSamples.java index 354da049cd687..69264fa45fa26 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/UsagesListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/UsagesListSamples.java @@ -9,7 +9,8 @@ */ public final class UsagesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Usages_List.json + * x-ms-original-file: + * specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Usages_List.json */ /** * Sample code: List usages. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AllowedAudiencesValidationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AllowedAudiencesValidationTests.java deleted file mode 100644 index 7ffd9a706ccb3..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AllowedAudiencesValidationTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AllowedAudiencesValidation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AllowedAudiencesValidationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AllowedAudiencesValidation model - = BinaryData.fromString("{\"allowedAudiences\":[\"zqqedq\",\"tbciqfouflmm\",\"kzsmodm\",\"lougpbkw\"]}") - .toObject(AllowedAudiencesValidation.class); - Assertions.assertEquals("zqqedq", model.allowedAudiences().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AllowedAudiencesValidation model = new AllowedAudiencesValidation() - .withAllowedAudiences(Arrays.asList("zqqedq", "tbciqfouflmm", "kzsmodm", "lougpbkw")); - model = BinaryData.fromObject(model).toObject(AllowedAudiencesValidation.class); - Assertions.assertEquals("zqqedq", model.allowedAudiences().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AllowedPrincipalsTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AllowedPrincipalsTests.java deleted file mode 100644 index 6ee3a901abf21..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AllowedPrincipalsTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AllowedPrincipals; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AllowedPrincipalsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AllowedPrincipals model = BinaryData.fromString( - "{\"groups\":[\"cqvkocrcjdkwtn\",\"xbnjbiksq\",\"gls\"],\"identities\":[\"nqpjwnzlljfmpp\",\"ebvmgxsabkyqd\",\"ujitcjcz\"]}") - .toObject(AllowedPrincipals.class); - Assertions.assertEquals("cqvkocrcjdkwtn", model.groups().get(0)); - Assertions.assertEquals("nqpjwnzlljfmpp", model.identities().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AllowedPrincipals model - = new AllowedPrincipals().withGroups(Arrays.asList("cqvkocrcjdkwtn", "xbnjbiksq", "gls")) - .withIdentities(Arrays.asList("nqpjwnzlljfmpp", "ebvmgxsabkyqd", "ujitcjcz")); - model = BinaryData.fromObject(model).toObject(AllowedPrincipals.class); - Assertions.assertEquals("cqvkocrcjdkwtn", model.groups().get(0)); - Assertions.assertEquals("nqpjwnzlljfmpp", model.identities().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AuthPlatformTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AuthPlatformTests.java deleted file mode 100644 index 67ddb7fad0b80..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AuthPlatformTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AuthPlatform; -import org.junit.jupiter.api.Assertions; - -public final class AuthPlatformTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AuthPlatform model - = BinaryData.fromString("{\"enabled\":true,\"runtimeVersion\":\"bpzvgn\"}").toObject(AuthPlatform.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("bpzvgn", model.runtimeVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AuthPlatform model = new AuthPlatform().withEnabled(true).withRuntimeVersion("bpzvgn"); - model = BinaryData.fromObject(model).toObject(AuthPlatform.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("bpzvgn", model.runtimeVersion()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableOperationsTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableOperationsTests.java deleted file mode 100644 index c19eb9a11efaf..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableOperationsTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.OperationDetailInner; -import com.azure.resourcemanager.appcontainers.models.AvailableOperations; -import com.azure.resourcemanager.appcontainers.models.OperationDisplay; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AvailableOperationsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailableOperations model = BinaryData.fromString( - "{\"value\":[{\"name\":\"hujswtwkozzwcul\",\"isDataAction\":true,\"display\":{\"provider\":\"fajnjwltlwtjjguk\",\"resource\":\"lhsnvkcdmx\",\"operation\":\"poaimlnwiaaomyl\",\"description\":\"azul\"},\"origin\":\"ethwwnpjhlfz\"}],\"nextLink\":\"pchwa\"}") - .toObject(AvailableOperations.class); - Assertions.assertEquals("hujswtwkozzwcul", model.value().get(0).name()); - Assertions.assertEquals(true, model.value().get(0).isDataAction()); - Assertions.assertEquals("fajnjwltlwtjjguk", model.value().get(0).display().provider()); - Assertions.assertEquals("lhsnvkcdmx", model.value().get(0).display().resource()); - Assertions.assertEquals("poaimlnwiaaomyl", model.value().get(0).display().operation()); - Assertions.assertEquals("azul", model.value().get(0).display().description()); - Assertions.assertEquals("ethwwnpjhlfz", model.value().get(0).origin()); - Assertions.assertEquals("pchwa", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailableOperations model - = new AvailableOperations().withValue(Arrays.asList(new OperationDetailInner().withName("hujswtwkozzwcul") - .withIsDataAction(true) - .withDisplay(new OperationDisplay().withProvider("fajnjwltlwtjjguk") - .withResource("lhsnvkcdmx") - .withOperation("poaimlnwiaaomyl") - .withDescription("azul")) - .withOrigin("ethwwnpjhlfz"))).withNextLink("pchwa"); - model = BinaryData.fromObject(model).toObject(AvailableOperations.class); - Assertions.assertEquals("hujswtwkozzwcul", model.value().get(0).name()); - Assertions.assertEquals(true, model.value().get(0).isDataAction()); - Assertions.assertEquals("fajnjwltlwtjjguk", model.value().get(0).display().provider()); - Assertions.assertEquals("lhsnvkcdmx", model.value().get(0).display().resource()); - Assertions.assertEquals("poaimlnwiaaomyl", model.value().get(0).display().operation()); - Assertions.assertEquals("azul", model.value().get(0).display().description()); - Assertions.assertEquals("ethwwnpjhlfz", model.value().get(0).origin()); - Assertions.assertEquals("pchwa", model.nextLink()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfileInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfileInnerTests.java deleted file mode 100644 index c2139c0d8a046..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfileInnerTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.AvailableWorkloadProfileInner; -import com.azure.resourcemanager.appcontainers.models.Applicability; -import com.azure.resourcemanager.appcontainers.models.AvailableWorkloadProfileProperties; -import org.junit.jupiter.api.Assertions; - -public final class AvailableWorkloadProfileInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailableWorkloadProfileInner model = BinaryData.fromString( - "{\"location\":\"aoqvuh\",\"properties\":{\"category\":\"f\",\"applicability\":\"LocationDefault\",\"cores\":848102718,\"memoryGiB\":1726993489,\"gpus\":661873212,\"displayName\":\"hjq\"},\"id\":\"pyeicxm\",\"name\":\"ciwqvhk\",\"type\":\"ixuigdtopbobj\"}") - .toObject(AvailableWorkloadProfileInner.class); - Assertions.assertEquals("aoqvuh", model.location()); - Assertions.assertEquals("f", model.properties().category()); - Assertions.assertEquals(Applicability.LOCATION_DEFAULT, model.properties().applicability()); - Assertions.assertEquals(848102718, model.properties().cores()); - Assertions.assertEquals(1726993489, model.properties().memoryGiB()); - Assertions.assertEquals(661873212, model.properties().gpus()); - Assertions.assertEquals("hjq", model.properties().displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailableWorkloadProfileInner model = new AvailableWorkloadProfileInner().withLocation("aoqvuh") - .withProperties(new AvailableWorkloadProfileProperties().withCategory("f") - .withApplicability(Applicability.LOCATION_DEFAULT) - .withCores(848102718) - .withMemoryGiB(1726993489) - .withGpus(661873212) - .withDisplayName("hjq")); - model = BinaryData.fromObject(model).toObject(AvailableWorkloadProfileInner.class); - Assertions.assertEquals("aoqvuh", model.location()); - Assertions.assertEquals("f", model.properties().category()); - Assertions.assertEquals(Applicability.LOCATION_DEFAULT, model.properties().applicability()); - Assertions.assertEquals(848102718, model.properties().cores()); - Assertions.assertEquals(1726993489, model.properties().memoryGiB()); - Assertions.assertEquals(661873212, model.properties().gpus()); - Assertions.assertEquals("hjq", model.properties().displayName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilePropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilePropertiesTests.java deleted file mode 100644 index 68c35f030b8b6..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilePropertiesTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.Applicability; -import com.azure.resourcemanager.appcontainers.models.AvailableWorkloadProfileProperties; -import org.junit.jupiter.api.Assertions; - -public final class AvailableWorkloadProfilePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailableWorkloadProfileProperties model = BinaryData.fromString( - "{\"category\":\"hm\",\"applicability\":\"LocationDefault\",\"cores\":54099605,\"memoryGiB\":46444609,\"gpus\":1338226566,\"displayName\":\"ayvvtpgvdf\"}") - .toObject(AvailableWorkloadProfileProperties.class); - Assertions.assertEquals("hm", model.category()); - Assertions.assertEquals(Applicability.LOCATION_DEFAULT, model.applicability()); - Assertions.assertEquals(54099605, model.cores()); - Assertions.assertEquals(46444609, model.memoryGiB()); - Assertions.assertEquals(1338226566, model.gpus()); - Assertions.assertEquals("ayvvtpgvdf", model.displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailableWorkloadProfileProperties model = new AvailableWorkloadProfileProperties().withCategory("hm") - .withApplicability(Applicability.LOCATION_DEFAULT) - .withCores(54099605) - .withMemoryGiB(46444609) - .withGpus(1338226566) - .withDisplayName("ayvvtpgvdf"); - model = BinaryData.fromObject(model).toObject(AvailableWorkloadProfileProperties.class); - Assertions.assertEquals("hm", model.category()); - Assertions.assertEquals(Applicability.LOCATION_DEFAULT, model.applicability()); - Assertions.assertEquals(54099605, model.cores()); - Assertions.assertEquals(46444609, model.memoryGiB()); - Assertions.assertEquals(1338226566, model.gpus()); - Assertions.assertEquals("ayvvtpgvdf", model.displayName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilesCollectionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilesCollectionTests.java deleted file mode 100644 index 5797523a5cf6e..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilesCollectionTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.AvailableWorkloadProfileInner; -import com.azure.resourcemanager.appcontainers.models.Applicability; -import com.azure.resourcemanager.appcontainers.models.AvailableWorkloadProfileProperties; -import com.azure.resourcemanager.appcontainers.models.AvailableWorkloadProfilesCollection; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AvailableWorkloadProfilesCollectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailableWorkloadProfilesCollection model = BinaryData.fromString( - "{\"value\":[{\"location\":\"vbqid\",\"properties\":{\"category\":\"jzyulpk\",\"applicability\":\"Custom\",\"cores\":1505424073,\"memoryGiB\":623997191,\"gpus\":1234306466,\"displayName\":\"hfepgzgqex\"},\"id\":\"ocxscpaierhhbcs\",\"name\":\"l\",\"type\":\"mmajtjaodx\"},{\"location\":\"nbdxk\",\"properties\":{\"category\":\"okaj\",\"applicability\":\"LocationDefault\",\"cores\":1893451619,\"memoryGiB\":529728185,\"gpus\":1675088890,\"displayName\":\"txgcpodgmaajr\"},\"id\":\"djwzrlov\",\"name\":\"clwhijcoejctbz\",\"type\":\"qsqsy\"},{\"location\":\"kbfkg\",\"properties\":{\"category\":\"kexxppof\",\"applicability\":\"Custom\",\"cores\":54654595,\"memoryGiB\":825369958,\"gpus\":1635783635,\"displayName\":\"dtocj\"},\"id\":\"hvpmoue\",\"name\":\"hd\",\"type\":\"xibqeojnx\"}],\"nextLink\":\"zvddntwndeicbtwn\"}") - .toObject(AvailableWorkloadProfilesCollection.class); - Assertions.assertEquals("vbqid", model.value().get(0).location()); - Assertions.assertEquals("jzyulpk", model.value().get(0).properties().category()); - Assertions.assertEquals(Applicability.CUSTOM, model.value().get(0).properties().applicability()); - Assertions.assertEquals(1505424073, model.value().get(0).properties().cores()); - Assertions.assertEquals(623997191, model.value().get(0).properties().memoryGiB()); - Assertions.assertEquals(1234306466, model.value().get(0).properties().gpus()); - Assertions.assertEquals("hfepgzgqex", model.value().get(0).properties().displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailableWorkloadProfilesCollection model = new AvailableWorkloadProfilesCollection().withValue(Arrays.asList( - new AvailableWorkloadProfileInner().withLocation("vbqid") - .withProperties(new AvailableWorkloadProfileProperties().withCategory("jzyulpk") - .withApplicability(Applicability.CUSTOM) - .withCores(1505424073) - .withMemoryGiB(623997191) - .withGpus(1234306466) - .withDisplayName("hfepgzgqex")), - new AvailableWorkloadProfileInner().withLocation("nbdxk") - .withProperties(new AvailableWorkloadProfileProperties().withCategory("okaj") - .withApplicability(Applicability.LOCATION_DEFAULT) - .withCores(1893451619) - .withMemoryGiB(529728185) - .withGpus(1675088890) - .withDisplayName("txgcpodgmaajr")), - new AvailableWorkloadProfileInner().withLocation("kbfkg") - .withProperties(new AvailableWorkloadProfileProperties().withCategory("kexxppof") - .withApplicability(Applicability.CUSTOM) - .withCores(54654595) - .withMemoryGiB(825369958) - .withGpus(1635783635) - .withDisplayName("dtocj")))); - model = BinaryData.fromObject(model).toObject(AvailableWorkloadProfilesCollection.class); - Assertions.assertEquals("vbqid", model.value().get(0).location()); - Assertions.assertEquals("jzyulpk", model.value().get(0).properties().category()); - Assertions.assertEquals(Applicability.CUSTOM, model.value().get(0).properties().applicability()); - Assertions.assertEquals(1505424073, model.value().get(0).properties().cores()); - Assertions.assertEquals(623997191, model.value().get(0).properties().memoryGiB()); - Assertions.assertEquals(1234306466, model.value().get(0).properties().gpus()); - Assertions.assertEquals("hfepgzgqex", model.value().get(0).properties().displayName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilesGetMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilesGetMockTests.java deleted file mode 100644 index 63a407e988a7d..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilesGetMockTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.Applicability; -import com.azure.resourcemanager.appcontainers.models.AvailableWorkloadProfile; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class AvailableWorkloadProfilesGetMockTests { - @Test - public void testGet() throws Exception { - String responseStr - = "{\"value\":[{\"location\":\"pxl\",\"properties\":{\"category\":\"nelxieixynll\",\"applicability\":\"Custom\",\"cores\":1222388745,\"memoryGiB\":2008141079,\"gpus\":1839785994,\"displayName\":\"slhcawjutifd\"},\"id\":\"mvi\",\"name\":\"orq\",\"type\":\"bttzhraglkafhonq\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.availableWorkloadProfiles().get("zob", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("pxl", response.iterator().next().location()); - Assertions.assertEquals("nelxieixynll", response.iterator().next().properties().category()); - Assertions.assertEquals(Applicability.CUSTOM, response.iterator().next().properties().applicability()); - Assertions.assertEquals(1222388745, response.iterator().next().properties().cores()); - Assertions.assertEquals(2008141079, response.iterator().next().properties().memoryGiB()); - Assertions.assertEquals(1839785994, response.iterator().next().properties().gpus()); - Assertions.assertEquals("slhcawjutifd", response.iterator().next().properties().displayName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureActiveDirectoryLoginTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureActiveDirectoryLoginTests.java deleted file mode 100644 index b075c5c5bcdd5..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureActiveDirectoryLoginTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AzureActiveDirectoryLogin; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AzureActiveDirectoryLoginTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureActiveDirectoryLogin model = BinaryData.fromString( - "{\"loginParameters\":[\"yejhk\",\"yhtnapczwlokjye\",\"kkvnipjox\",\"jnchgej\"],\"disableWWWAuthenticate\":true}") - .toObject(AzureActiveDirectoryLogin.class); - Assertions.assertEquals("yejhk", model.loginParameters().get(0)); - Assertions.assertEquals(true, model.disableWwwAuthenticate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureActiveDirectoryLogin model = new AzureActiveDirectoryLogin() - .withLoginParameters(Arrays.asList("yejhk", "yhtnapczwlokjye", "kkvnipjox", "jnchgej")) - .withDisableWwwAuthenticate(true); - model = BinaryData.fromObject(model).toObject(AzureActiveDirectoryLogin.class); - Assertions.assertEquals("yejhk", model.loginParameters().get(0)); - Assertions.assertEquals(true, model.disableWwwAuthenticate()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureStaticWebAppsRegistrationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureStaticWebAppsRegistrationTests.java deleted file mode 100644 index d4c22d34bb454..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureStaticWebAppsRegistrationTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AzureStaticWebAppsRegistration; -import org.junit.jupiter.api.Assertions; - -public final class AzureStaticWebAppsRegistrationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureStaticWebAppsRegistration model = BinaryData.fromString("{\"clientId\":\"gzjaoyfhrtxilne\"}") - .toObject(AzureStaticWebAppsRegistration.class); - Assertions.assertEquals("gzjaoyfhrtxilne", model.clientId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureStaticWebAppsRegistration model = new AzureStaticWebAppsRegistration().withClientId("gzjaoyfhrtxilne"); - model = BinaryData.fromObject(model).toObject(AzureStaticWebAppsRegistration.class); - Assertions.assertEquals("gzjaoyfhrtxilne", model.clientId()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureStaticWebAppsTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureStaticWebAppsTests.java deleted file mode 100644 index 6dca97009e470..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureStaticWebAppsTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AzureStaticWebApps; -import com.azure.resourcemanager.appcontainers.models.AzureStaticWebAppsRegistration; -import org.junit.jupiter.api.Assertions; - -public final class AzureStaticWebAppsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureStaticWebApps model - = BinaryData.fromString("{\"enabled\":false,\"registration\":{\"clientId\":\"gbquxigj\"}}") - .toObject(AzureStaticWebApps.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("gbquxigj", model.registration().clientId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureStaticWebApps model = new AzureStaticWebApps().withEnabled(false) - .withRegistration(new AzureStaticWebAppsRegistration().withClientId("gbquxigj")); - model = BinaryData.fromObject(model).toObject(AzureStaticWebApps.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("gbquxigj", model.registration().clientId()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BillingMeterCollectionInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BillingMeterCollectionInnerTests.java deleted file mode 100644 index c844e41491e1a..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BillingMeterCollectionInnerTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.BillingMeterCollectionInner; -import com.azure.resourcemanager.appcontainers.models.BillingMeter; -import com.azure.resourcemanager.appcontainers.models.BillingMeterProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class BillingMeterCollectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingMeterCollectionInner model = BinaryData.fromString( - "{\"value\":[{\"location\":\"tkftutqxlngx\",\"properties\":{\"category\":\"gug\",\"meterType\":\"krxd\",\"displayName\":\"i\"},\"id\":\"thz\",\"name\":\"vqdra\",\"type\":\"hjybigehoqfbo\"},{\"location\":\"kanyktzlcuiywg\",\"properties\":{\"category\":\"gndrvynh\",\"meterType\":\"pphrcgynco\",\"displayName\":\"ecfvmm\"},\"id\":\"ofsx\",\"name\":\"zevgb\",\"type\":\"qjqabcypmivkwl\"},{\"location\":\"vccfw\",\"properties\":{\"category\":\"bacfionlebxetq\",\"meterType\":\"zxdpnqbqqw\",\"displayName\":\"jfeallnwsub\"},\"id\":\"njampm\",\"name\":\"gnzscxaqwo\",\"type\":\"chcbonqvpkvlrxnj\"}]}") - .toObject(BillingMeterCollectionInner.class); - Assertions.assertEquals("tkftutqxlngx", model.value().get(0).location()); - Assertions.assertEquals("gug", model.value().get(0).properties().category()); - Assertions.assertEquals("krxd", model.value().get(0).properties().meterType()); - Assertions.assertEquals("i", model.value().get(0).properties().displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingMeterCollectionInner model = new BillingMeterCollectionInner().withValue(Arrays.asList( - new BillingMeter().withLocation("tkftutqxlngx") - .withProperties( - new BillingMeterProperties().withCategory("gug").withMeterType("krxd").withDisplayName("i")), - new BillingMeter().withLocation("kanyktzlcuiywg") - .withProperties(new BillingMeterProperties().withCategory("gndrvynh") - .withMeterType("pphrcgynco") - .withDisplayName("ecfvmm")), - new BillingMeter().withLocation("vccfw") - .withProperties(new BillingMeterProperties().withCategory("bacfionlebxetq") - .withMeterType("zxdpnqbqqw") - .withDisplayName("jfeallnwsub")))); - model = BinaryData.fromObject(model).toObject(BillingMeterCollectionInner.class); - Assertions.assertEquals("tkftutqxlngx", model.value().get(0).location()); - Assertions.assertEquals("gug", model.value().get(0).properties().category()); - Assertions.assertEquals("krxd", model.value().get(0).properties().meterType()); - Assertions.assertEquals("i", model.value().get(0).properties().displayName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BillingMeterPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BillingMeterPropertiesTests.java deleted file mode 100644 index d6db5d248904c..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BillingMeterPropertiesTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.BillingMeterProperties; -import org.junit.jupiter.api.Assertions; - -public final class BillingMeterPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingMeterProperties model = BinaryData - .fromString( - "{\"category\":\"dslfhotwmcy\",\"meterType\":\"wlbjnpgacftade\",\"displayName\":\"nltyfsoppusuesnz\"}") - .toObject(BillingMeterProperties.class); - Assertions.assertEquals("dslfhotwmcy", model.category()); - Assertions.assertEquals("wlbjnpgacftade", model.meterType()); - Assertions.assertEquals("nltyfsoppusuesnz", model.displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingMeterProperties model = new BillingMeterProperties().withCategory("dslfhotwmcy") - .withMeterType("wlbjnpgacftade") - .withDisplayName("nltyfsoppusuesnz"); - model = BinaryData.fromObject(model).toObject(BillingMeterProperties.class); - Assertions.assertEquals("dslfhotwmcy", model.category()); - Assertions.assertEquals("wlbjnpgacftade", model.meterType()); - Assertions.assertEquals("nltyfsoppusuesnz", model.displayName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BillingMeterTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BillingMeterTests.java deleted file mode 100644 index 9792f4c8f9b4a..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BillingMeterTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.BillingMeter; -import com.azure.resourcemanager.appcontainers.models.BillingMeterProperties; -import org.junit.jupiter.api.Assertions; - -public final class BillingMeterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingMeter model = BinaryData.fromString( - "{\"location\":\"seiphe\",\"properties\":{\"category\":\"okeyyienj\",\"meterType\":\"lwtgrhpdj\",\"displayName\":\"umasxazjpq\"},\"id\":\"gual\",\"name\":\"b\",\"type\":\"xhejjzzvdud\"}") - .toObject(BillingMeter.class); - Assertions.assertEquals("seiphe", model.location()); - Assertions.assertEquals("okeyyienj", model.properties().category()); - Assertions.assertEquals("lwtgrhpdj", model.properties().meterType()); - Assertions.assertEquals("umasxazjpq", model.properties().displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingMeter model = new BillingMeter().withLocation("seiphe") - .withProperties(new BillingMeterProperties().withCategory("okeyyienj") - .withMeterType("lwtgrhpdj") - .withDisplayName("umasxazjpq")); - model = BinaryData.fromObject(model).toObject(BillingMeter.class); - Assertions.assertEquals("seiphe", model.location()); - Assertions.assertEquals("okeyyienj", model.properties().category()); - Assertions.assertEquals("lwtgrhpdj", model.properties().meterType()); - Assertions.assertEquals("umasxazjpq", model.properties().displayName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BillingMetersGetWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BillingMetersGetWithResponseMockTests.java deleted file mode 100644 index 17346b47338d6..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BillingMetersGetWithResponseMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.BillingMeterCollection; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class BillingMetersGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"location\":\"p\",\"properties\":{\"category\":\"xelnwc\",\"meterType\":\"yjede\",\"displayName\":\"mlfmkqs\"},\"id\":\"zuawxtzxpuamwa\",\"name\":\"zxrvxcus\",\"type\":\"sphaivmxyasflvg\"},{\"location\":\"zwywako\",\"properties\":{\"category\":\"nsmjbl\",\"meterType\":\"jhlnymzotqyryu\",\"displayName\":\"bmqqvxmvw\"},\"id\":\"tayx\",\"name\":\"nsup\",\"type\":\"ujlzqnhcvsqltn\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingMeterCollection response - = manager.billingMeters().getWithResponse("ujeickp", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("p", response.value().get(0).location()); - Assertions.assertEquals("xelnwc", response.value().get(0).properties().category()); - Assertions.assertEquals("yjede", response.value().get(0).properties().meterType()); - Assertions.assertEquals("mlfmkqs", response.value().get(0).properties().displayName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BlobStorageTokenStoreTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BlobStorageTokenStoreTests.java deleted file mode 100644 index 671289aaaeaae..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BlobStorageTokenStoreTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.BlobStorageTokenStore; -import org.junit.jupiter.api.Assertions; - -public final class BlobStorageTokenStoreTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BlobStorageTokenStore model - = BinaryData.fromString("{\"sasUrlSettingName\":\"mijcmmxdcufufs\"}").toObject(BlobStorageTokenStore.class); - Assertions.assertEquals("mijcmmxdcufufs", model.sasUrlSettingName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BlobStorageTokenStore model = new BlobStorageTokenStore().withSasUrlSettingName("mijcmmxdcufufs"); - model = BinaryData.fromObject(model).toObject(BlobStorageTokenStore.class); - Assertions.assertEquals("mijcmmxdcufufs", model.sasUrlSettingName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CertificatePatchTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CertificatePatchTests.java deleted file mode 100644 index eb3024df17c73..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CertificatePatchTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.CertificatePatch; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CertificatePatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CertificatePatch model - = BinaryData.fromString("{\"tags\":{\"duugidyjr\":\"mvxi\",\"y\":\"f\"}}").toObject(CertificatePatch.class); - Assertions.assertEquals("mvxi", model.tags().get("duugidyjr")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CertificatePatch model = new CertificatePatch().withTags(mapOf("duugidyjr", "mvxi", "y", "f")); - model = BinaryData.fromObject(model).toObject(CertificatePatch.class); - Assertions.assertEquals("mvxi", model.tags().get("duugidyjr")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CertificatesDeleteWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CertificatesDeleteWithResponseMockTests.java deleted file mode 100644 index 2ed7158c58b35..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CertificatesDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CertificatesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.certificates() - .deleteWithResponse("ulhmzyq", "hdvafjrqpjiyrqjc", "gaxwmzwdfkbnrzo", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CheckNameAvailabilityRequestTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CheckNameAvailabilityRequestTests.java deleted file mode 100644 index b703e87de99ff..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CheckNameAvailabilityRequestTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityRequest; -import org.junit.jupiter.api.Assertions; - -public final class CheckNameAvailabilityRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckNameAvailabilityRequest model = BinaryData.fromString("{\"name\":\"qzbqjvsov\",\"type\":\"okacspk\"}") - .toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("qzbqjvsov", model.name()); - Assertions.assertEquals("okacspk", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityRequest model - = new CheckNameAvailabilityRequest().withName("qzbqjvsov").withType("okacspk"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("qzbqjvsov", model.name()); - Assertions.assertEquals("okacspk", model.type()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CheckNameAvailabilityResponseInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CheckNameAvailabilityResponseInnerTests.java deleted file mode 100644 index 4615f04867ede..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CheckNameAvailabilityResponseInnerTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.CheckNameAvailabilityResponseInner; -import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityReason; -import org.junit.jupiter.api.Assertions; - -public final class CheckNameAvailabilityResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckNameAvailabilityResponseInner model - = BinaryData.fromString("{\"nameAvailable\":true,\"reason\":\"AlreadyExists\",\"message\":\"bpxjmfl\"}") - .toObject(CheckNameAvailabilityResponseInner.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("bpxjmfl", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityResponseInner model = new CheckNameAvailabilityResponseInner().withNameAvailable(true) - .withReason(CheckNameAvailabilityReason.ALREADY_EXISTS) - .withMessage("bpxjmfl"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityResponseInner.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("bpxjmfl", model.message()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesDeleteWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesDeleteWithResponseMockTests.java deleted file mode 100644 index ce10a1b4927c6..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConnectedEnvironmentsCertificatesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.connectedEnvironmentsCertificates() - .deleteWithResponse("os", "gbzahgxqdlyr", "ltlaprltzkatbhj", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCheckNameAvailabilityWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCheckNameAvailabilityWithResponseMockTests.java deleted file mode 100644 index 4143f1b9d1554..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCheckNameAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityReason; -import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityRequest; -import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConnectedEnvironmentsCheckNameAvailabilityWithResponseMockTests { - @Test - public void testCheckNameAvailabilityWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":true,\"reason\":\"Invalid\",\"message\":\"ziqgfuh\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CheckNameAvailabilityResponse response = manager.connectedEnvironments() - .checkNameAvailabilityWithResponse("gshejjtbxqmulux", "xqzv", - new CheckNameAvailabilityRequest().withName("rsbycucrwn").withType("ikzebr"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(true, response.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, response.reason()); - Assertions.assertEquals("ziqgfuh", response.message()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsDeleteWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsDeleteWithResponseMockTests.java deleted file mode 100644 index df04e88e1142e..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConnectedEnvironmentsDaprComponentsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.connectedEnvironmentsDaprComponents() - .deleteWithResponse("hkwfbkgozxwop", "bydpizqaclnapxb", "yg", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListSecretsWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListSecretsWithResponseMockTests.java deleted file mode 100644 index b8db75e8c3752..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListSecretsWithResponseMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.DaprSecretsCollection; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConnectedEnvironmentsDaprComponentsListSecretsWithResponseMockTests { - @Test - public void testListSecretsWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"hvsujztc\",\"value\":\"tqjtwhauu\"},{\"name\":\"prnjletlxsmr\",\"value\":\"do\"},{\"name\":\"fa\",\"value\":\"waziy\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DaprSecretsCollection response = manager.connectedEnvironmentsDaprComponents() - .listSecretsWithResponse("ugjknf", "mfcttux", "uyilflqoiquvrehm", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDeleteMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDeleteMockTests.java deleted file mode 100644 index 84331613d87fd..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConnectedEnvironmentsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.connectedEnvironments().delete("mxzjrgywwpgjx", "nptfujgi", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesDeleteWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesDeleteWithResponseMockTests.java deleted file mode 100644 index 6d10f8b121a03..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConnectedEnvironmentsStoragesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.connectedEnvironmentsStorages() - .deleteWithResponse("okmvkhlggd", "bemzqkzszuwi", "tglxx", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppJobExecutionsInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppJobExecutionsInnerTests.java deleted file mode 100644 index 97be7db3c70e8..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppJobExecutionsInnerTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppJobExecutionsInner; -import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionInner; -import com.azure.resourcemanager.appcontainers.models.JobExecutionContainer; -import com.azure.resourcemanager.appcontainers.models.JobExecutionTemplate; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ContainerAppJobExecutionsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ContainerAppJobExecutionsInner model = BinaryData.fromString( - "{\"value\":[{\"name\":\"erteeammxqiekk\",\"id\":\"ddrtkgdojb\",\"type\":\"vavrefdees\",\"properties\":{\"status\":\"Succeeded\",\"startTime\":\"2021-07-23T13:42:28Z\",\"endTime\":\"2021-08-23T12:07:03Z\",\"template\":{\"containers\":[{}],\"initContainers\":[{},{}]}}},{\"name\":\"rtujwsawddjibab\",\"id\":\"ititvtzeexavoxt\",\"type\":\"lecdmdqbw\",\"properties\":{\"status\":\"Running\",\"startTime\":\"2021-11-30T11:49:15Z\",\"endTime\":\"2021-06-26T00:13:12Z\",\"template\":{\"containers\":[{},{}],\"initContainers\":[{},{},{}]}}},{\"name\":\"hhxud\",\"id\":\"vodhtn\",\"type\":\"rudhzmmesckdl\",\"properties\":{\"status\":\"Degraded\",\"startTime\":\"2021-07-08T07:35:07Z\",\"endTime\":\"2021-09-27T03:23:27Z\",\"template\":{\"containers\":[{}],\"initContainers\":[{}]}}}],\"nextLink\":\"wmdboxdfgsftuf\"}") - .toObject(ContainerAppJobExecutionsInner.class); - Assertions.assertEquals("erteeammxqiekk", model.value().get(0).name()); - Assertions.assertEquals("ddrtkgdojb", model.value().get(0).id()); - Assertions.assertEquals("vavrefdees", model.value().get(0).type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-23T13:42:28Z"), model.value().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-23T12:07:03Z"), model.value().get(0).endTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ContainerAppJobExecutionsInner model = new ContainerAppJobExecutionsInner().withValue(Arrays.asList( - new JobExecutionInner().withName("erteeammxqiekk") - .withId("ddrtkgdojb") - .withType("vavrefdees") - .withStartTime(OffsetDateTime.parse("2021-07-23T13:42:28Z")) - .withEndTime(OffsetDateTime.parse("2021-08-23T12:07:03Z")) - .withTemplate(new JobExecutionTemplate().withContainers(Arrays.asList(new JobExecutionContainer())) - .withInitContainers(Arrays.asList(new JobExecutionContainer(), new JobExecutionContainer()))), - new JobExecutionInner().withName("rtujwsawddjibab") - .withId("ititvtzeexavoxt") - .withType("lecdmdqbw") - .withStartTime(OffsetDateTime.parse("2021-11-30T11:49:15Z")) - .withEndTime(OffsetDateTime.parse("2021-06-26T00:13:12Z")) - .withTemplate(new JobExecutionTemplate() - .withContainers(Arrays.asList(new JobExecutionContainer(), new JobExecutionContainer())) - .withInitContainers(Arrays.asList(new JobExecutionContainer(), new JobExecutionContainer(), - new JobExecutionContainer()))), - new JobExecutionInner().withName("hhxud") - .withId("vodhtn") - .withType("rudhzmmesckdl") - .withStartTime(OffsetDateTime.parse("2021-07-08T07:35:07Z")) - .withEndTime(OffsetDateTime.parse("2021-09-27T03:23:27Z")) - .withTemplate(new JobExecutionTemplate().withContainers(Arrays.asList(new JobExecutionContainer())) - .withInitContainers(Arrays.asList(new JobExecutionContainer()))))); - model = BinaryData.fromObject(model).toObject(ContainerAppJobExecutionsInner.class); - Assertions.assertEquals("erteeammxqiekk", model.value().get(0).name()); - Assertions.assertEquals("ddrtkgdojb", model.value().get(0).id()); - Assertions.assertEquals("vavrefdees", model.value().get(0).type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-23T13:42:28Z"), model.value().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-23T12:07:03Z"), model.value().get(0).endTime()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeHttpGetHttpHeadersItemTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeHttpGetHttpHeadersItemTests.java deleted file mode 100644 index fb2fa7a20558c..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeHttpGetHttpHeadersItemTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; -import org.junit.jupiter.api.Assertions; - -public final class ContainerAppProbeHttpGetHttpHeadersItemTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ContainerAppProbeHttpGetHttpHeadersItem model - = BinaryData.fromString("{\"name\":\"dopcjwvnh\",\"value\":\"ld\"}") - .toObject(ContainerAppProbeHttpGetHttpHeadersItem.class); - Assertions.assertEquals("dopcjwvnh", model.name()); - Assertions.assertEquals("ld", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ContainerAppProbeHttpGetHttpHeadersItem model - = new ContainerAppProbeHttpGetHttpHeadersItem().withName("dopcjwvnh").withValue("ld"); - model = BinaryData.fromObject(model).toObject(ContainerAppProbeHttpGetHttpHeadersItem.class); - Assertions.assertEquals("dopcjwvnh", model.name()); - Assertions.assertEquals("ld", model.value()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeHttpGetTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeHttpGetTests.java deleted file mode 100644 index 7d2bd83bf3c72..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeHttpGetTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; -import com.azure.resourcemanager.appcontainers.models.Scheme; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ContainerAppProbeHttpGetTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ContainerAppProbeHttpGet model = BinaryData.fromString( - "{\"host\":\"lvpnpp\",\"httpHeaders\":[{\"name\":\"lrwdmhdlxyj\",\"value\":\"xsaga\"},{\"name\":\"cnihgwqapnedgfbc\",\"value\":\"kcvqvpke\"}],\"path\":\"cvdrhvoodsot\",\"port\":1582782062,\"scheme\":\"HTTPS\"}") - .toObject(ContainerAppProbeHttpGet.class); - Assertions.assertEquals("lvpnpp", model.host()); - Assertions.assertEquals("lrwdmhdlxyj", model.httpHeaders().get(0).name()); - Assertions.assertEquals("xsaga", model.httpHeaders().get(0).value()); - Assertions.assertEquals("cvdrhvoodsot", model.path()); - Assertions.assertEquals(1582782062, model.port()); - Assertions.assertEquals(Scheme.HTTPS, model.scheme()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ContainerAppProbeHttpGet model - = new ContainerAppProbeHttpGet().withHost("lvpnpp") - .withHttpHeaders(Arrays.asList( - new ContainerAppProbeHttpGetHttpHeadersItem().withName("lrwdmhdlxyj").withValue("xsaga"), - new ContainerAppProbeHttpGetHttpHeadersItem().withName("cnihgwqapnedgfbc").withValue("kcvqvpke"))) - .withPath("cvdrhvoodsot") - .withPort(1582782062) - .withScheme(Scheme.HTTPS); - model = BinaryData.fromObject(model).toObject(ContainerAppProbeHttpGet.class); - Assertions.assertEquals("lvpnpp", model.host()); - Assertions.assertEquals("lrwdmhdlxyj", model.httpHeaders().get(0).name()); - Assertions.assertEquals("xsaga", model.httpHeaders().get(0).value()); - Assertions.assertEquals("cvdrhvoodsot", model.path()); - Assertions.assertEquals(1582782062, model.port()); - Assertions.assertEquals(Scheme.HTTPS, model.scheme()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeTcpSocketTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeTcpSocketTests.java deleted file mode 100644 index 65d66ae21823b..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeTcpSocketTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeTcpSocket; -import org.junit.jupiter.api.Assertions; - -public final class ContainerAppProbeTcpSocketTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ContainerAppProbeTcpSocket model - = BinaryData.fromString("{\"host\":\"gx\",\"port\":1488418313}").toObject(ContainerAppProbeTcpSocket.class); - Assertions.assertEquals("gx", model.host()); - Assertions.assertEquals(1488418313, model.port()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ContainerAppProbeTcpSocket model = new ContainerAppProbeTcpSocket().withHost("gx").withPort(1488418313); - model = BinaryData.fromObject(model).toObject(ContainerAppProbeTcpSocket.class); - Assertions.assertEquals("gx", model.host()); - Assertions.assertEquals(1488418313, model.port()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeTests.java deleted file mode 100644 index 1ba2ae5193f4e..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeTcpSocket; -import com.azure.resourcemanager.appcontainers.models.Scheme; -import com.azure.resourcemanager.appcontainers.models.Type; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ContainerAppProbeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ContainerAppProbe model = BinaryData.fromString( - "{\"failureThreshold\":914301244,\"httpGet\":{\"host\":\"gohdneuelfphsd\",\"httpHeaders\":[{\"name\":\"ozfikdowwq\",\"value\":\"uvxzxclvi\"}],\"path\":\"hqzonosggbhcoh\",\"port\":481884715,\"scheme\":\"HTTP\"},\"initialDelaySeconds\":201409851,\"periodSeconds\":677812040,\"successThreshold\":713967590,\"tcpSocket\":{\"host\":\"iiswacffgdkzze\",\"port\":1258640156},\"terminationGracePeriodSeconds\":9180032066247712595,\"timeoutSeconds\":2075677013,\"type\":\"Readiness\"}") - .toObject(ContainerAppProbe.class); - Assertions.assertEquals(914301244, model.failureThreshold()); - Assertions.assertEquals("gohdneuelfphsd", model.httpGet().host()); - Assertions.assertEquals("ozfikdowwq", model.httpGet().httpHeaders().get(0).name()); - Assertions.assertEquals("uvxzxclvi", model.httpGet().httpHeaders().get(0).value()); - Assertions.assertEquals("hqzonosggbhcoh", model.httpGet().path()); - Assertions.assertEquals(481884715, model.httpGet().port()); - Assertions.assertEquals(Scheme.HTTP, model.httpGet().scheme()); - Assertions.assertEquals(201409851, model.initialDelaySeconds()); - Assertions.assertEquals(677812040, model.periodSeconds()); - Assertions.assertEquals(713967590, model.successThreshold()); - Assertions.assertEquals("iiswacffgdkzze", model.tcpSocket().host()); - Assertions.assertEquals(1258640156, model.tcpSocket().port()); - Assertions.assertEquals(9180032066247712595L, model.terminationGracePeriodSeconds()); - Assertions.assertEquals(2075677013, model.timeoutSeconds()); - Assertions.assertEquals(Type.READINESS, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ContainerAppProbe model = new ContainerAppProbe().withFailureThreshold(914301244) - .withHttpGet(new ContainerAppProbeHttpGet().withHost("gohdneuelfphsd") - .withHttpHeaders(Arrays.asList( - new ContainerAppProbeHttpGetHttpHeadersItem().withName("ozfikdowwq").withValue("uvxzxclvi"))) - .withPath("hqzonosggbhcoh") - .withPort(481884715) - .withScheme(Scheme.HTTP)) - .withInitialDelaySeconds(201409851) - .withPeriodSeconds(677812040) - .withSuccessThreshold(713967590) - .withTcpSocket(new ContainerAppProbeTcpSocket().withHost("iiswacffgdkzze").withPort(1258640156)) - .withTerminationGracePeriodSeconds(9180032066247712595L) - .withTimeoutSeconds(2075677013) - .withType(Type.READINESS); - model = BinaryData.fromObject(model).toObject(ContainerAppProbe.class); - Assertions.assertEquals(914301244, model.failureThreshold()); - Assertions.assertEquals("gohdneuelfphsd", model.httpGet().host()); - Assertions.assertEquals("ozfikdowwq", model.httpGet().httpHeaders().get(0).name()); - Assertions.assertEquals("uvxzxclvi", model.httpGet().httpHeaders().get(0).value()); - Assertions.assertEquals("hqzonosggbhcoh", model.httpGet().path()); - Assertions.assertEquals(481884715, model.httpGet().port()); - Assertions.assertEquals(Scheme.HTTP, model.httpGet().scheme()); - Assertions.assertEquals(201409851, model.initialDelaySeconds()); - Assertions.assertEquals(677812040, model.periodSeconds()); - Assertions.assertEquals(713967590, model.successThreshold()); - Assertions.assertEquals("iiswacffgdkzze", model.tcpSocket().host()); - Assertions.assertEquals(1258640156, model.tcpSocket().port()); - Assertions.assertEquals(9180032066247712595L, model.terminationGracePeriodSeconds()); - Assertions.assertEquals(2075677013, model.timeoutSeconds()); - Assertions.assertEquals(Type.READINESS, model.type()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsDeleteWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsDeleteWithResponseMockTests.java deleted file mode 100644 index 67e08f1d68884..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ContainerAppsAuthConfigsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.containerAppsAuthConfigs() - .deleteWithResponse("ault", "ijjumfq", "azlnqnmcjngzqdqx", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDeleteMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDeleteMockTests.java deleted file mode 100644 index 2ee08f34b9203..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ContainerAppsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.containerApps().delete("lvyjtcvuwkas", "zies", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetDetectorWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetDetectorWithResponseMockTests.java deleted file mode 100644 index 70fbd717b765c..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetDetectorWithResponseMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.Diagnostics; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ContainerAppsDiagnosticsGetDetectorWithResponseMockTests { - @Test - public void testGetDetectorWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"metadata\":{\"id\":\"urkihci\",\"name\":\"defxrdc\",\"description\":\"nbkkjanurnnq\",\"author\":\"q\",\"category\":\"izxqltgrd\",\"supportTopicList\":[{\"id\":\"xrxvbfi\",\"pesId\":\"u\"},{\"id\":\"ctafsrbxrblm\",\"pesId\":\"owxih\"}],\"analysisTypes\":[\"xwqagnepzw\"],\"type\":\"lsbs\",\"score\":41.009586},\"dataset\":[{\"table\":{\"tableName\":\"wrxaomzisg\",\"columns\":[{},{},{}],\"rows\":[\"dataezkhhltnjadhqo\",\"datawjqo\",\"dataueayfbpcmsplb\",\"datarrueqthwmg\"]},\"renderingProperties\":{\"type\":1620223491,\"title\":\"bbxi\",\"description\":\"hxiidlopedb\",\"isVisible\":false}},{\"table\":{\"tableName\":\"yybxubmdnafcbqw\",\"columns\":[{}],\"rows\":[\"datalaqacigele\"]},\"renderingProperties\":{\"type\":1602491470,\"title\":\"qvwzkjopwbeonrl\",\"description\":\"zdqyb\",\"isVisible\":true}},{\"table\":{\"tableName\":\"xcptsoqfyiaseqc\",\"columns\":[{},{},{},{}],\"rows\":[\"datazrazisgyk\",\"datauem\",\"dataanbwzohmnrxxbso\"]},\"renderingProperties\":{\"type\":164418955,\"title\":\"hmdp\",\"description\":\"sprqsgnzxojpslsv\",\"isVisible\":false}}],\"status\":{\"message\":\"ufiqwoyxqvapcohh\",\"statusId\":1419867036},\"dataProviderMetadata\":{\"providerName\":\"q\",\"propertyBag\":[{\"name\":\"x\",\"value\":\"zdcgdzbenr\"},{\"name\":\"cawetzqddt\",\"value\":\"fljhznamtua\"},{\"name\":\"zwcjjncqtj\",\"value\":\"izvg\"},{\"name\":\"atzuuv\",\"value\":\"ngrebwg\"}]}},\"id\":\"httzlswvajqfutlx\",\"name\":\"oqza\",\"type\":\"unwqr\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Diagnostics response = manager.containerAppsDiagnostics() - .getDetectorWithResponse("ypobkdqzr", "zsylollgt", "czzydmxzjij", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xwqagnepzw", response.properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("wrxaomzisg", response.properties().dataset().get(0).table().tableName()); - Assertions.assertEquals(1620223491, response.properties().dataset().get(0).renderingProperties().type()); - Assertions.assertEquals("bbxi", response.properties().dataset().get(0).renderingProperties().title()); - Assertions.assertEquals("hxiidlopedb", - response.properties().dataset().get(0).renderingProperties().description()); - Assertions.assertEquals(false, response.properties().dataset().get(0).renderingProperties().isVisible()); - Assertions.assertEquals("ufiqwoyxqvapcohh", response.properties().status().message()); - Assertions.assertEquals(1419867036, response.properties().status().statusId()); - Assertions.assertEquals("q", response.properties().dataProviderMetadata().providerName()); - Assertions.assertEquals("x", response.properties().dataProviderMetadata().propertyBag().get(0).name()); - Assertions.assertEquals("zdcgdzbenr", - response.properties().dataProviderMetadata().propertyBag().get(0).value()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListDetectorsMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListDetectorsMockTests.java deleted file mode 100644 index 57365370946d7..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListDetectorsMockTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.Diagnostics; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ContainerAppsDiagnosticsListDetectorsMockTests { - @Test - public void testListDetectors() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"metadata\":{\"id\":\"lrmymyincqlhri\",\"name\":\"sl\",\"description\":\"iiovgqcgxu\",\"author\":\"qkctotiowlxte\",\"category\":\"ptjgwdt\",\"supportTopicList\":[{\"id\":\"anblwphqlkccu\",\"pesId\":\"ygqwahoiu\"},{\"id\":\"gniiprglvaw\",\"pesId\":\"z\"},{\"id\":\"fypiv\",\"pesId\":\"bbjpmcubkmif\"},{\"id\":\"xkubvphavpmhbrbq\",\"pesId\":\"govpbbtte\"}],\"analysisTypes\":[\"knssqyzqed\",\"kdfrdbiqmrjgeihf\",\"lg\",\"wfiwzcxmj\"],\"type\":\"yephmgtvljvrcmyf\",\"score\":20.843273},\"dataset\":[{\"table\":{\"tableName\":\"pomyqwcabvnuile\",\"columns\":[{},{}],\"rows\":[\"datalpaugmrm\",\"datajlrxwtoaukhfk\",\"datacisiz\",\"dataoaedsxjwuivedwcg\"]},\"renderingProperties\":{\"type\":1195219828,\"title\":\"ei\",\"description\":\"psmgo\",\"isVisible\":false}},{\"table\":{\"tableName\":\"ljdlrgmspl\",\"columns\":[{}],\"rows\":[\"datacshhv\",\"dataewgnxkympqanxrj\"]},\"renderingProperties\":{\"type\":494382455,\"title\":\"bta\",\"description\":\"pnyghs\",\"isVisible\":false}}],\"status\":{\"message\":\"hkgmnsg\",\"statusId\":986820074},\"dataProviderMetadata\":{\"providerName\":\"phdrw\",\"propertyBag\":[{\"name\":\"vyom\",\"value\":\"luzvxnq\"}]}},\"id\":\"rpqpd\",\"name\":\"wmkoisq\",\"type\":\"ssffxuifmc\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.containerAppsDiagnostics().listDetectors("j", "emmucfxh", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("knssqyzqed", - response.iterator().next().properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("pomyqwcabvnuile", - response.iterator().next().properties().dataset().get(0).table().tableName()); - Assertions.assertEquals(1195219828, - response.iterator().next().properties().dataset().get(0).renderingProperties().type()); - Assertions.assertEquals("ei", - response.iterator().next().properties().dataset().get(0).renderingProperties().title()); - Assertions.assertEquals("psmgo", - response.iterator().next().properties().dataset().get(0).renderingProperties().description()); - Assertions.assertEquals(false, - response.iterator().next().properties().dataset().get(0).renderingProperties().isVisible()); - Assertions.assertEquals("hkgmnsg", response.iterator().next().properties().status().message()); - Assertions.assertEquals(986820074, response.iterator().next().properties().status().statusId()); - Assertions.assertEquals("phdrw", response.iterator().next().properties().dataProviderMetadata().providerName()); - Assertions.assertEquals("vyom", - response.iterator().next().properties().dataProviderMetadata().propertyBag().get(0).name()); - Assertions.assertEquals("luzvxnq", - response.iterator().next().properties().dataProviderMetadata().propertyBag().get(0).value()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasGetReplicaWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasGetReplicaWithResponseMockTests.java deleted file mode 100644 index fdc9fd0d1dc46..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasGetReplicaWithResponseMockTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.Replica; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ContainerAppsRevisionReplicasGetReplicaWithResponseMockTests { - @Test - public void testGetReplicaWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"createdTime\":\"2020-12-22T02:11:50Z\",\"runningState\":\"Running\",\"runningStateDetails\":\"z\",\"containers\":[{\"name\":\"spzhzmtksjc\",\"containerId\":\"digsxcdgl\",\"ready\":false,\"started\":true,\"restartCount\":1057429401,\"runningState\":\"Waiting\",\"runningStateDetails\":\"omflrytswfp\",\"logStreamEndpoint\":\"dgycxnmskwhqjjy\",\"execEndpoint\":\"urlpshh\"},{\"name\":\"pedwqsl\",\"containerId\":\"hmpqvw\",\"ready\":false,\"started\":false,\"restartCount\":1319536198,\"runningState\":\"Terminated\",\"runningStateDetails\":\"imuvqejosovyrrl\",\"logStreamEndpoint\":\"esi\",\"execEndpoint\":\"qtljqobbpihehc\"},{\"name\":\"ybmrqbrjbbmp\",\"containerId\":\"lvykfrex\",\"ready\":false,\"started\":true,\"restartCount\":2102121209,\"runningState\":\"Terminated\",\"runningStateDetails\":\"hud\",\"logStreamEndpoint\":\"hxogjggsvoujkxi\",\"execEndpoint\":\"afhrkmdyomk\"},{\"name\":\"bv\",\"containerId\":\"hd\",\"ready\":false,\"started\":false,\"restartCount\":434767133,\"runningState\":\"Running\",\"runningStateDetails\":\"eimawzovgkkumui\",\"logStreamEndpoint\":\"cjc\",\"execEndpoint\":\"tbw\"}],\"initContainers\":[{\"name\":\"owxwcomli\",\"containerId\":\"twvc\",\"ready\":false,\"started\":false,\"restartCount\":1849220753,\"runningState\":\"Terminated\",\"runningStateDetails\":\"yfdvlvhbwrnfxtgd\",\"logStreamEndpoint\":\"qthe\",\"execEndpoint\":\"mnaoy\"},{\"name\":\"kcoeqswank\",\"containerId\":\"ytmhdroznnhdrlkt\",\"ready\":true,\"started\":true,\"restartCount\":1720686436,\"runningState\":\"Running\",\"runningStateDetails\":\"mlwywaeeczg\",\"logStreamEndpoint\":\"ukklelss\",\"execEndpoint\":\"lycsxz\"}]},\"id\":\"ksrl\",\"name\":\"mdesqp\",\"type\":\"pvmjcdoewbid\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Replica response = manager.containerAppsRevisionReplicas() - .getReplicaWithResponse("afiqgeaarbgjekg", "klbyulidwcw", "mzegjon", "hj", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("spzhzmtksjc", response.containers().get(0).name()); - Assertions.assertEquals("digsxcdgl", response.containers().get(0).containerId()); - Assertions.assertEquals(false, response.containers().get(0).ready()); - Assertions.assertEquals(true, response.containers().get(0).started()); - Assertions.assertEquals(1057429401, response.containers().get(0).restartCount()); - Assertions.assertEquals("owxwcomli", response.initContainers().get(0).name()); - Assertions.assertEquals("twvc", response.initContainers().get(0).containerId()); - Assertions.assertEquals(false, response.initContainers().get(0).ready()); - Assertions.assertEquals(false, response.initContainers().get(0).started()); - Assertions.assertEquals(1849220753, response.initContainers().get(0).restartCount()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasListReplicasWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasListReplicasWithResponseMockTests.java deleted file mode 100644 index 8261b9571d384..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasListReplicasWithResponseMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.ReplicaCollection; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ContainerAppsRevisionReplicasListReplicasWithResponseMockTests { - @Test - public void testListReplicasWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"createdTime\":\"2021-09-15T19:47Z\",\"runningState\":\"Unknown\",\"runningStateDetails\":\"khvuhxepmrutz\",\"containers\":[{},{}],\"initContainers\":[{}]},\"id\":\"nslujd\",\"name\":\"ltymkmvguihywart\",\"type\":\"pphkixkykxds\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ReplicaCollection response = manager.containerAppsRevisionReplicas() - .listReplicasWithResponse("vteo", "xvgpiude", "gfsxzec", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsActivateRevisionWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsActivateRevisionWithResponseMockTests.java deleted file mode 100644 index f8cbe85161ce3..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsActivateRevisionWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ContainerAppsRevisionsActivateRevisionWithResponseMockTests { - @Test - public void testActivateRevisionWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.containerAppsRevisions() - .activateRevisionWithResponse("ejchcsrlz", "nmzlanru", "dwv", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsDeactivateRevisionWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsDeactivateRevisionWithResponseMockTests.java deleted file mode 100644 index a56739c773a76..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsDeactivateRevisionWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ContainerAppsRevisionsDeactivateRevisionWithResponseMockTests { - @Test - public void testDeactivateRevisionWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.containerAppsRevisions() - .deactivateRevisionWithResponse("phcnzqtpj", "mqrhvthl", "iwdcxsmlzzhzd", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsRestartRevisionWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsRestartRevisionWithResponseMockTests.java deleted file mode 100644 index 21ab48efcab25..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsRestartRevisionWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ContainerAppsRevisionsRestartRevisionWithResponseMockTests { - @Test - public void testRestartRevisionWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.containerAppsRevisions() - .restartRevisionWithResponse("xetlgydlhqv", "n", "pxy", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsDeleteMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsDeleteMockTests.java deleted file mode 100644 index 694a6da2161aa..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsDeleteMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ContainerAppsSourceControlsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.containerAppsSourceControls() - .delete("yifkdschlzvf", "ctnkjjwgcwnph", "kgf", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerResourcesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerResourcesTests.java deleted file mode 100644 index c1ea86f412609..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerResourcesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ContainerResources; -import org.junit.jupiter.api.Assertions; - -public final class ContainerResourcesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ContainerResources model - = BinaryData.fromString("{\"cpu\":45.36370614352274,\"memory\":\"q\",\"ephemeralStorage\":\"wpmqt\"}") - .toObject(ContainerResources.class); - Assertions.assertEquals(45.36370614352274D, model.cpu()); - Assertions.assertEquals("q", model.memory()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ContainerResources model = new ContainerResources().withCpu(45.36370614352274D).withMemory("q"); - model = BinaryData.fromObject(model).toObject(ContainerResources.class); - Assertions.assertEquals(45.36370614352274D, model.cpu()); - Assertions.assertEquals("q", model.memory()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CookieExpirationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CookieExpirationTests.java deleted file mode 100644 index 930ea0a0ad23a..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CookieExpirationTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.CookieExpiration; -import com.azure.resourcemanager.appcontainers.models.CookieExpirationConvention; -import org.junit.jupiter.api.Assertions; - -public final class CookieExpirationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CookieExpiration model - = BinaryData.fromString("{\"convention\":\"FixedTime\",\"timeToExpiration\":\"zidnsezcxtbzsgfy\"}") - .toObject(CookieExpiration.class); - Assertions.assertEquals(CookieExpirationConvention.FIXED_TIME, model.convention()); - Assertions.assertEquals("zidnsezcxtbzsgfy", model.timeToExpiration()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CookieExpiration model = new CookieExpiration().withConvention(CookieExpirationConvention.FIXED_TIME) - .withTimeToExpiration("zidnsezcxtbzsgfy"); - model = BinaryData.fromObject(model).toObject(CookieExpiration.class); - Assertions.assertEquals(CookieExpirationConvention.FIXED_TIME, model.convention()); - Assertions.assertEquals("zidnsezcxtbzsgfy", model.timeToExpiration()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CustomDomainTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CustomDomainTests.java deleted file mode 100644 index 9609db2bb7aae..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CustomDomainTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.BindingType; -import com.azure.resourcemanager.appcontainers.models.CustomDomain; -import org.junit.jupiter.api.Assertions; - -public final class CustomDomainTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomDomain model = BinaryData - .fromString("{\"name\":\"iebwwaloayqcgwrt\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"gwyzm\"}") - .toObject(CustomDomain.class); - Assertions.assertEquals("iebwwaloayqcgwrt", model.name()); - Assertions.assertEquals(BindingType.SNI_ENABLED, model.bindingType()); - Assertions.assertEquals("gwyzm", model.certificateId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomDomain model = new CustomDomain().withName("iebwwaloayqcgwrt") - .withBindingType(BindingType.SNI_ENABLED) - .withCertificateId("gwyzm"); - model = BinaryData.fromObject(model).toObject(CustomDomain.class); - Assertions.assertEquals("iebwwaloayqcgwrt", model.name()); - Assertions.assertEquals(BindingType.SNI_ENABLED, model.bindingType()); - Assertions.assertEquals("gwyzm", model.certificateId()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsDeleteWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsDeleteWithResponseMockTests.java deleted file mode 100644 index 85fcf14f84a00..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DaprComponentsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.daprComponents() - .deleteWithResponse("xlb", "xomeikjclwzacn", "wpfsuqtaaz", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListSecretsWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListSecretsWithResponseMockTests.java deleted file mode 100644 index ed2a86ad9637f..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListSecretsWithResponseMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.DaprSecretsCollection; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DaprComponentsListSecretsWithResponseMockTests { - @Test - public void testListSecretsWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"hjriyb\",\"value\":\"zo\"},{\"name\":\"nxwdvwnjkg\",\"value\":\"nmx\"},{\"name\":\"rsqftib\",\"value\":\"ibuyvpirf\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DaprSecretsCollection response = manager.daprComponents() - .listSecretsWithResponse("qbxyxoyfpuqqi", "ezxlhdjzqdca", "wvpsoz", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprConfigurationTests.java deleted file mode 100644 index 77ffcd04b48a2..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprConfigurationTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DaprConfiguration; - -public final class DaprConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DaprConfiguration model = BinaryData.fromString("{\"version\":\"qagt\"}").toObject(DaprConfiguration.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DaprConfiguration model = new DaprConfiguration(); - model = BinaryData.fromObject(model).toObject(DaprConfiguration.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprSecretTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprSecretTests.java deleted file mode 100644 index b46025b8af40b..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprSecretTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DaprSecret; - -public final class DaprSecretTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DaprSecret model - = BinaryData.fromString("{\"name\":\"tqhjfbebrjcx\",\"value\":\"fuwutttxf\"}").toObject(DaprSecret.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DaprSecret model = new DaprSecret(); - model = BinaryData.fromObject(model).toObject(DaprSecret.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprSecretsCollectionInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprSecretsCollectionInnerTests.java deleted file mode 100644 index 63f0b2b425c9c..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprSecretsCollectionInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.DaprSecretsCollectionInner; -import com.azure.resourcemanager.appcontainers.models.DaprSecret; -import java.util.Arrays; - -public final class DaprSecretsCollectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DaprSecretsCollectionInner model = BinaryData.fromString( - "{\"value\":[{\"name\":\"nhwlrsffrzpwvl\",\"value\":\"q\"},{\"name\":\"iqylihkaetck\",\"value\":\"fcivfsnkym\"}]}") - .toObject(DaprSecretsCollectionInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DaprSecretsCollectionInner model - = new DaprSecretsCollectionInner().withValue(Arrays.asList(new DaprSecret(), new DaprSecret())); - model = BinaryData.fromObject(model).toObject(DaprSecretsCollectionInner.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprTests.java deleted file mode 100644 index 47e3a140926cc..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AppProtocol; -import com.azure.resourcemanager.appcontainers.models.Dapr; -import com.azure.resourcemanager.appcontainers.models.LogLevel; -import org.junit.jupiter.api.Assertions; - -public final class DaprTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Dapr model = BinaryData.fromString( - "{\"enabled\":false,\"appId\":\"qvkelnsm\",\"appProtocol\":\"grpc\",\"appPort\":1393240700,\"httpReadBufferSize\":1739794958,\"httpMaxRequestSize\":534713047,\"logLevel\":\"warn\",\"enableApiLogging\":false}") - .toObject(Dapr.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("qvkelnsm", model.appId()); - Assertions.assertEquals(AppProtocol.GRPC, model.appProtocol()); - Assertions.assertEquals(1393240700, model.appPort()); - Assertions.assertEquals(1739794958, model.httpReadBufferSize()); - Assertions.assertEquals(534713047, model.httpMaxRequestSize()); - Assertions.assertEquals(LogLevel.WARN, model.logLevel()); - Assertions.assertEquals(false, model.enableApiLogging()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Dapr model = new Dapr().withEnabled(false) - .withAppId("qvkelnsm") - .withAppProtocol(AppProtocol.GRPC) - .withAppPort(1393240700) - .withHttpReadBufferSize(1739794958) - .withHttpMaxRequestSize(534713047) - .withLogLevel(LogLevel.WARN) - .withEnableApiLogging(false); - model = BinaryData.fromObject(model).toObject(Dapr.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("qvkelnsm", model.appId()); - Assertions.assertEquals(AppProtocol.GRPC, model.appProtocol()); - Assertions.assertEquals(1393240700, model.appPort()); - Assertions.assertEquals(1739794958, model.httpReadBufferSize()); - Assertions.assertEquals(534713047, model.httpMaxRequestSize()); - Assertions.assertEquals(LogLevel.WARN, model.logLevel()); - Assertions.assertEquals(false, model.enableApiLogging()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DefaultAuthorizationPolicyTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DefaultAuthorizationPolicyTests.java deleted file mode 100644 index 91cd0845fc0b6..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DefaultAuthorizationPolicyTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AllowedPrincipals; -import com.azure.resourcemanager.appcontainers.models.DefaultAuthorizationPolicy; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DefaultAuthorizationPolicyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefaultAuthorizationPolicy model = BinaryData.fromString( - "{\"allowedPrincipals\":{\"groups\":[\"rxzxtheo\",\"usivye\",\"cciqihnhungbwjz\"],\"identities\":[\"ygxgispemvtz\",\"kufubljo\",\"xqeofjaeqjhqjba\",\"v\"]},\"allowedApplications\":[\"jqul\",\"gsntnbybkzgcwr\",\"clxxwrljdo\"]}") - .toObject(DefaultAuthorizationPolicy.class); - Assertions.assertEquals("rxzxtheo", model.allowedPrincipals().groups().get(0)); - Assertions.assertEquals("ygxgispemvtz", model.allowedPrincipals().identities().get(0)); - Assertions.assertEquals("jqul", model.allowedApplications().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefaultAuthorizationPolicy model = new DefaultAuthorizationPolicy() - .withAllowedPrincipals( - new AllowedPrincipals().withGroups(Arrays.asList("rxzxtheo", "usivye", "cciqihnhungbwjz")) - .withIdentities(Arrays.asList("ygxgispemvtz", "kufubljo", "xqeofjaeqjhqjba", "v"))) - .withAllowedApplications(Arrays.asList("jqul", "gsntnbybkzgcwr", "clxxwrljdo")); - model = BinaryData.fromObject(model).toObject(DefaultAuthorizationPolicy.class); - Assertions.assertEquals("rxzxtheo", model.allowedPrincipals().groups().get(0)); - Assertions.assertEquals("ygxgispemvtz", model.allowedPrincipals().identities().get(0)); - Assertions.assertEquals("jqul", model.allowedApplications().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataProviderMetadataPropertyBagItemTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataProviderMetadataPropertyBagItemTests.java deleted file mode 100644 index 86052946bd9de..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataProviderMetadataPropertyBagItemTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataProviderMetadataPropertyBagItem; -import org.junit.jupiter.api.Assertions; - -public final class DiagnosticDataProviderMetadataPropertyBagItemTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiagnosticDataProviderMetadataPropertyBagItem model - = BinaryData.fromString("{\"name\":\"vjlboxqvk\",\"value\":\"mxho\"}") - .toObject(DiagnosticDataProviderMetadataPropertyBagItem.class); - Assertions.assertEquals("vjlboxqvk", model.name()); - Assertions.assertEquals("mxho", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticDataProviderMetadataPropertyBagItem model - = new DiagnosticDataProviderMetadataPropertyBagItem().withName("vjlboxqvk").withValue("mxho"); - model = BinaryData.fromObject(model).toObject(DiagnosticDataProviderMetadataPropertyBagItem.class); - Assertions.assertEquals("vjlboxqvk", model.name()); - Assertions.assertEquals("mxho", model.value()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataProviderMetadataTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataProviderMetadataTests.java deleted file mode 100644 index dedf56cb53120..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataProviderMetadataTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataProviderMetadata; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataProviderMetadataPropertyBagItem; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DiagnosticDataProviderMetadataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiagnosticDataProviderMetadata model = BinaryData.fromString( - "{\"providerName\":\"rvqeevtoepryutn\",\"propertyBag\":[{\"name\":\"zdmovzv\",\"value\":\"aawzqadfl\"},{\"name\":\"ur\",\"value\":\"laecxndticok\"},{\"name\":\"zmlqtmldgxo\",\"value\":\"irclnpk\"},{\"name\":\"ayzri\",\"value\":\"hya\"}]}") - .toObject(DiagnosticDataProviderMetadata.class); - Assertions.assertEquals("rvqeevtoepryutn", model.providerName()); - Assertions.assertEquals("zdmovzv", model.propertyBag().get(0).name()); - Assertions.assertEquals("aawzqadfl", model.propertyBag().get(0).value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticDataProviderMetadata model = new DiagnosticDataProviderMetadata().withProviderName("rvqeevtoepryutn") - .withPropertyBag(Arrays.asList( - new DiagnosticDataProviderMetadataPropertyBagItem().withName("zdmovzv").withValue("aawzqadfl"), - new DiagnosticDataProviderMetadataPropertyBagItem().withName("ur").withValue("laecxndticok"), - new DiagnosticDataProviderMetadataPropertyBagItem().withName("zmlqtmldgxo").withValue("irclnpk"), - new DiagnosticDataProviderMetadataPropertyBagItem().withName("ayzri").withValue("hya"))); - model = BinaryData.fromObject(model).toObject(DiagnosticDataProviderMetadata.class); - Assertions.assertEquals("rvqeevtoepryutn", model.providerName()); - Assertions.assertEquals("zdmovzv", model.propertyBag().get(0).name()); - Assertions.assertEquals("aawzqadfl", model.propertyBag().get(0).value()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataTableResponseColumnTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataTableResponseColumnTests.java deleted file mode 100644 index 4430f034f1fff..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataTableResponseColumnTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataTableResponseColumn; -import org.junit.jupiter.api.Assertions; - -public final class DiagnosticDataTableResponseColumnTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiagnosticDataTableResponseColumn model - = BinaryData.fromString("{\"columnName\":\"zapeewchpx\",\"dataType\":\"twkuziycs\",\"columnType\":\"vu\"}") - .toObject(DiagnosticDataTableResponseColumn.class); - Assertions.assertEquals("zapeewchpx", model.columnName()); - Assertions.assertEquals("twkuziycs", model.dataType()); - Assertions.assertEquals("vu", model.columnType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticDataTableResponseColumn model = new DiagnosticDataTableResponseColumn().withColumnName("zapeewchpx") - .withDataType("twkuziycs") - .withColumnType("vu"); - model = BinaryData.fromObject(model).toObject(DiagnosticDataTableResponseColumn.class); - Assertions.assertEquals("zapeewchpx", model.columnName()); - Assertions.assertEquals("twkuziycs", model.dataType()); - Assertions.assertEquals("vu", model.columnType()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataTableResponseObjectTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataTableResponseObjectTests.java deleted file mode 100644 index 854bdd1c5cd7a..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataTableResponseObjectTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataTableResponseColumn; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataTableResponseObject; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DiagnosticDataTableResponseObjectTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiagnosticDataTableResponseObject model = BinaryData.fromString( - "{\"tableName\":\"cib\",\"columns\":[{\"columnName\":\"wuxrkjpvdwxfzwi\",\"dataType\":\"wzjbh\",\"columnType\":\"sxjrk\"},{\"columnName\":\"btrnegvm\",\"dataType\":\"uqeqv\",\"columnType\":\"spastjbkkdmf\"}],\"rows\":[\"datastmjlxrri\"]}") - .toObject(DiagnosticDataTableResponseObject.class); - Assertions.assertEquals("cib", model.tableName()); - Assertions.assertEquals("wuxrkjpvdwxfzwi", model.columns().get(0).columnName()); - Assertions.assertEquals("wzjbh", model.columns().get(0).dataType()); - Assertions.assertEquals("sxjrk", model.columns().get(0).columnType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticDataTableResponseObject model = new DiagnosticDataTableResponseObject().withTableName("cib") - .withColumns(Arrays.asList( - new DiagnosticDataTableResponseColumn().withColumnName("wuxrkjpvdwxfzwi") - .withDataType("wzjbh") - .withColumnType("sxjrk"), - new DiagnosticDataTableResponseColumn().withColumnName("btrnegvm") - .withDataType("uqeqv") - .withColumnType("spastjbkkdmf"))) - .withRows(Arrays.asList("datastmjlxrri")); - model = BinaryData.fromObject(model).toObject(DiagnosticDataTableResponseObject.class); - Assertions.assertEquals("cib", model.tableName()); - Assertions.assertEquals("wuxrkjpvdwxfzwi", model.columns().get(0).columnName()); - Assertions.assertEquals("wzjbh", model.columns().get(0).dataType()); - Assertions.assertEquals("sxjrk", model.columns().get(0).columnType()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticRenderingTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticRenderingTests.java deleted file mode 100644 index e3d893705b762..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticRenderingTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DiagnosticRendering; -import org.junit.jupiter.api.Assertions; - -public final class DiagnosticRenderingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiagnosticRendering model = BinaryData - .fromString("{\"type\":1693563757,\"title\":\"cktyh\",\"description\":\"qedcgzulwm\",\"isVisible\":false}") - .toObject(DiagnosticRendering.class); - Assertions.assertEquals(1693563757, model.type()); - Assertions.assertEquals("cktyh", model.title()); - Assertions.assertEquals("qedcgzulwm", model.description()); - Assertions.assertEquals(false, model.isVisible()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticRendering model = new DiagnosticRendering().withType(1693563757) - .withTitle("cktyh") - .withDescription("qedcgzulwm") - .withIsVisible(false); - model = BinaryData.fromObject(model).toObject(DiagnosticRendering.class); - Assertions.assertEquals(1693563757, model.type()); - Assertions.assertEquals("cktyh", model.title()); - Assertions.assertEquals("qedcgzulwm", model.description()); - Assertions.assertEquals(false, model.isVisible()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticSupportTopicTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticSupportTopicTests.java deleted file mode 100644 index 504252bdb4047..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticSupportTopicTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DiagnosticSupportTopic; - -public final class DiagnosticSupportTopicTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiagnosticSupportTopic model - = BinaryData.fromString("{\"id\":\"fcvlerch\",\"pesId\":\"bm\"}").toObject(DiagnosticSupportTopic.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticSupportTopic model = new DiagnosticSupportTopic(); - model = BinaryData.fromObject(model).toObject(DiagnosticSupportTopic.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsCollectionInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsCollectionInnerTests.java deleted file mode 100644 index c8177203ab9b1..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsCollectionInnerTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.DiagnosticsCollectionInner; -import com.azure.resourcemanager.appcontainers.fluent.models.DiagnosticsInner; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataProviderMetadata; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataProviderMetadataPropertyBagItem; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataTableResponseObject; -import com.azure.resourcemanager.appcontainers.models.DiagnosticRendering; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsDataApiResponse; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsDefinition; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsProperties; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsStatus; -import com.azure.resourcemanager.appcontainers.models.DiagnosticSupportTopic; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DiagnosticsCollectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiagnosticsCollectionInner model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"metadata\":{\"id\":\"wqknfdn\",\"name\":\"jchrdgoihxumw\",\"description\":\"ond\",\"author\":\"luudfdlwggytsb\",\"category\":\"ovvtgseinqfiu\",\"supportTopicList\":[{}],\"analysisTypes\":[\"pirgnepttwq\",\"sniffc\",\"mqnrojlpijnkr\"],\"type\":\"rddh\",\"score\":24.058205},\"dataset\":[{\"table\":{},\"renderingProperties\":{}},{\"table\":{},\"renderingProperties\":{}},{\"table\":{},\"renderingProperties\":{}},{\"table\":{},\"renderingProperties\":{}}],\"status\":{\"message\":\"tozqyzhftwesgo\",\"statusId\":1830581356},\"dataProviderMetadata\":{\"providerName\":\"nnxk\",\"propertyBag\":[{},{},{}]}},\"id\":\"yhmossxkkg\",\"name\":\"h\",\"type\":\"rghxjb\"},{\"properties\":{\"metadata\":{\"id\":\"vcxgfrpdsofbshr\",\"name\":\"vbuswd\",\"description\":\"yybyc\",\"author\":\"nvjsrtkfa\",\"category\":\"opqgikyzirtxdyux\",\"supportTopicList\":[{},{},{},{}],\"analysisTypes\":[\"psew\",\"ioilqukrydxtq\"],\"type\":\"eoxorggufhyao\",\"score\":65.541954},\"dataset\":[{\"table\":{},\"renderingProperties\":{}},{\"table\":{},\"renderingProperties\":{}},{\"table\":{},\"renderingProperties\":{}},{\"table\":{},\"renderingProperties\":{}}],\"status\":{\"message\":\"vjzhpjbib\",\"statusId\":1575038550},\"dataProviderMetadata\":{\"providerName\":\"umvfclu\",\"propertyBag\":[{},{}]}},\"id\":\"xnbkfezzxscyhwzd\",\"name\":\"irujbz\",\"type\":\"omvzzbtd\"}],\"nextLink\":\"vp\"}") - .toObject(DiagnosticsCollectionInner.class); - Assertions.assertEquals("pirgnepttwq", model.value().get(0).properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("tozqyzhftwesgo", model.value().get(0).properties().status().message()); - Assertions.assertEquals(1830581356, model.value().get(0).properties().status().statusId()); - Assertions.assertEquals("nnxk", model.value().get(0).properties().dataProviderMetadata().providerName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticsCollectionInner model = new DiagnosticsCollectionInner().withValue(Arrays.asList( - new DiagnosticsInner().withProperties(new DiagnosticsProperties() - .withMetadata( - new DiagnosticsDefinition().withSupportTopicList(Arrays.asList(new DiagnosticSupportTopic())) - .withAnalysisTypes(Arrays.asList("pirgnepttwq", "sniffc", "mqnrojlpijnkr"))) - .withDataset(Arrays.asList( - new DiagnosticsDataApiResponse().withTable(new DiagnosticDataTableResponseObject()) - .withRenderingProperties(new DiagnosticRendering()), - new DiagnosticsDataApiResponse().withTable(new DiagnosticDataTableResponseObject()) - .withRenderingProperties(new DiagnosticRendering()), - new DiagnosticsDataApiResponse().withTable(new DiagnosticDataTableResponseObject()) - .withRenderingProperties(new DiagnosticRendering()), - new DiagnosticsDataApiResponse().withTable(new DiagnosticDataTableResponseObject()) - .withRenderingProperties(new DiagnosticRendering()))) - .withStatus(new DiagnosticsStatus().withMessage("tozqyzhftwesgo").withStatusId(1830581356)) - .withDataProviderMetadata(new DiagnosticDataProviderMetadata().withProviderName("nnxk") - .withPropertyBag(Arrays.asList(new DiagnosticDataProviderMetadataPropertyBagItem(), - new DiagnosticDataProviderMetadataPropertyBagItem(), - new DiagnosticDataProviderMetadataPropertyBagItem())))), - new DiagnosticsInner().withProperties(new DiagnosticsProperties() - .withMetadata(new DiagnosticsDefinition() - .withSupportTopicList(Arrays.asList(new DiagnosticSupportTopic(), new DiagnosticSupportTopic(), - new DiagnosticSupportTopic(), new DiagnosticSupportTopic())) - .withAnalysisTypes(Arrays.asList("psew", "ioilqukrydxtq"))) - .withDataset(Arrays.asList( - new DiagnosticsDataApiResponse().withTable(new DiagnosticDataTableResponseObject()) - .withRenderingProperties(new DiagnosticRendering()), - new DiagnosticsDataApiResponse().withTable(new DiagnosticDataTableResponseObject()) - .withRenderingProperties(new DiagnosticRendering()), - new DiagnosticsDataApiResponse().withTable(new DiagnosticDataTableResponseObject()) - .withRenderingProperties(new DiagnosticRendering()), - new DiagnosticsDataApiResponse().withTable(new DiagnosticDataTableResponseObject()) - .withRenderingProperties(new DiagnosticRendering()))) - .withStatus(new DiagnosticsStatus().withMessage("vjzhpjbib").withStatusId(1575038550)) - .withDataProviderMetadata(new DiagnosticDataProviderMetadata().withProviderName("umvfclu") - .withPropertyBag(Arrays.asList(new DiagnosticDataProviderMetadataPropertyBagItem(), - new DiagnosticDataProviderMetadataPropertyBagItem())))))); - model = BinaryData.fromObject(model).toObject(DiagnosticsCollectionInner.class); - Assertions.assertEquals("pirgnepttwq", model.value().get(0).properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("tozqyzhftwesgo", model.value().get(0).properties().status().message()); - Assertions.assertEquals(1830581356, model.value().get(0).properties().status().statusId()); - Assertions.assertEquals("nnxk", model.value().get(0).properties().dataProviderMetadata().providerName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsDataApiResponseTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsDataApiResponseTests.java deleted file mode 100644 index 8f9935e0e93b0..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsDataApiResponseTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataTableResponseColumn; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataTableResponseObject; -import com.azure.resourcemanager.appcontainers.models.DiagnosticRendering; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsDataApiResponse; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DiagnosticsDataApiResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiagnosticsDataApiResponse model = BinaryData.fromString( - "{\"table\":{\"tableName\":\"babwidfcxss\",\"columns\":[{\"columnName\":\"noxyhkx\",\"dataType\":\"ddrihpf\",\"columnType\":\"qcaaewdaomdjvl\"},{\"columnName\":\"x\",\"dataType\":\"zb\",\"columnType\":\"sgeivsiy\"}],\"rows\":[\"datadncj\",\"dataxonbzoggculapz\"]},\"renderingProperties\":{\"type\":669115418,\"title\":\"ogtqxepnylbf\",\"description\":\"jlyjtlvofq\",\"isVisible\":true}}") - .toObject(DiagnosticsDataApiResponse.class); - Assertions.assertEquals("babwidfcxss", model.table().tableName()); - Assertions.assertEquals("noxyhkx", model.table().columns().get(0).columnName()); - Assertions.assertEquals("ddrihpf", model.table().columns().get(0).dataType()); - Assertions.assertEquals("qcaaewdaomdjvl", model.table().columns().get(0).columnType()); - Assertions.assertEquals(669115418, model.renderingProperties().type()); - Assertions.assertEquals("ogtqxepnylbf", model.renderingProperties().title()); - Assertions.assertEquals("jlyjtlvofq", model.renderingProperties().description()); - Assertions.assertEquals(true, model.renderingProperties().isVisible()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticsDataApiResponse model = new DiagnosticsDataApiResponse() - .withTable(new DiagnosticDataTableResponseObject().withTableName("babwidfcxss") - .withColumns(Arrays.asList( - new DiagnosticDataTableResponseColumn().withColumnName("noxyhkx") - .withDataType("ddrihpf") - .withColumnType("qcaaewdaomdjvl"), - new DiagnosticDataTableResponseColumn().withColumnName("x") - .withDataType("zb") - .withColumnType("sgeivsiy"))) - .withRows(Arrays.asList("datadncj", "dataxonbzoggculapz"))) - .withRenderingProperties(new DiagnosticRendering().withType(669115418) - .withTitle("ogtqxepnylbf") - .withDescription("jlyjtlvofq") - .withIsVisible(true)); - model = BinaryData.fromObject(model).toObject(DiagnosticsDataApiResponse.class); - Assertions.assertEquals("babwidfcxss", model.table().tableName()); - Assertions.assertEquals("noxyhkx", model.table().columns().get(0).columnName()); - Assertions.assertEquals("ddrihpf", model.table().columns().get(0).dataType()); - Assertions.assertEquals("qcaaewdaomdjvl", model.table().columns().get(0).columnType()); - Assertions.assertEquals(669115418, model.renderingProperties().type()); - Assertions.assertEquals("ogtqxepnylbf", model.renderingProperties().title()); - Assertions.assertEquals("jlyjtlvofq", model.renderingProperties().description()); - Assertions.assertEquals(true, model.renderingProperties().isVisible()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsDefinitionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsDefinitionTests.java deleted file mode 100644 index 9de0f370f61b3..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsDefinitionTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsDefinition; -import com.azure.resourcemanager.appcontainers.models.DiagnosticSupportTopic; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DiagnosticsDefinitionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiagnosticsDefinition model = BinaryData.fromString( - "{\"id\":\"dg\",\"name\":\"gsj\",\"description\":\"nwqjnoba\",\"author\":\"hdd\",\"category\":\"acegfnmntf\",\"supportTopicList\":[{\"id\":\"emfnczdwvvbal\",\"pesId\":\"l\"}],\"analysisTypes\":[\"podbzevwrdnh\",\"ukuv\"],\"type\":\"cswsmystul\",\"score\":88.066}") - .toObject(DiagnosticsDefinition.class); - Assertions.assertEquals("podbzevwrdnh", model.analysisTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticsDefinition model - = new DiagnosticsDefinition().withSupportTopicList(Arrays.asList(new DiagnosticSupportTopic())) - .withAnalysisTypes(Arrays.asList("podbzevwrdnh", "ukuv")); - model = BinaryData.fromObject(model).toObject(DiagnosticsDefinition.class); - Assertions.assertEquals("podbzevwrdnh", model.analysisTypes().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsInnerTests.java deleted file mode 100644 index d1d75431bacc8..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsInnerTests.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.DiagnosticsInner; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataProviderMetadata; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataProviderMetadataPropertyBagItem; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataTableResponseColumn; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataTableResponseObject; -import com.azure.resourcemanager.appcontainers.models.DiagnosticRendering; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsDataApiResponse; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsDefinition; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsProperties; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsStatus; -import com.azure.resourcemanager.appcontainers.models.DiagnosticSupportTopic; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DiagnosticsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiagnosticsInner model = BinaryData.fromString( - "{\"properties\":{\"metadata\":{\"id\":\"jviylwdshfs\",\"name\":\"rbgyefry\",\"description\":\"gaojf\",\"author\":\"nc\",\"category\":\"mrfhirctymox\",\"supportTopicList\":[{\"id\":\"ipiwy\",\"pesId\":\"uh\"},{\"id\":\"cpqjlihhyu\",\"pesId\":\"skasdvlmfwdgzxu\"},{\"id\":\"cvpa\",\"pesId\":\"sreuzvxurisjnh\"}],\"analysisTypes\":[\"xifqjzgxm\",\"hu\"],\"type\":\"wp\",\"score\":44.895386},\"dataset\":[{\"table\":{\"tableName\":\"jupauut\",\"columns\":[{}],\"rows\":[\"dataih\",\"datajqgwzp\",\"datafqntcyp\",\"dataxjvfoimwksl\"]},\"renderingProperties\":{\"type\":844799753,\"title\":\"jxv\",\"description\":\"fceacvlhvygd\",\"isVisible\":false}},{\"table\":{\"tableName\":\"rtwnawjslbi\",\"columns\":[{},{}],\"rows\":[\"datacyztsfmznbaeqp\",\"datachqnrnrpxehuwry\",\"dataqgaifmviklbydv\",\"datahbejdznxcvdsrhnj\"]},\"renderingProperties\":{\"type\":1229018312,\"title\":\"tnovqfzgemjdftul\",\"description\":\"tduceamt\",\"isVisible\":false}},{\"table\":{\"tableName\":\"m\",\"columns\":[{}],\"rows\":[\"datawqiok\"]},\"renderingProperties\":{\"type\":603460584,\"title\":\"ojmsvpkjprvkwc\",\"description\":\"ql\",\"isVisible\":false}},{\"table\":{\"tableName\":\"czheyd\",\"columns\":[{},{},{},{}],\"rows\":[\"datam\",\"dataxmaehvbbxu\",\"dataiplt\"]},\"renderingProperties\":{\"type\":1239776527,\"title\":\"axkgx\",\"description\":\"rc\",\"isVisible\":true}}],\"status\":{\"message\":\"yhpluodpvruudlgz\",\"statusId\":1325865791},\"dataProviderMetadata\":{\"providerName\":\"stgktst\",\"propertyBag\":[{\"name\":\"clzedqbcvh\",\"value\":\"h\"},{\"name\":\"odqkdlwwqfb\",\"value\":\"lkxt\"},{\"name\":\"jfsmlmbtxhwgfwsr\",\"value\":\"wcoezbrhub\"},{\"name\":\"hud\",\"value\":\"oookkqfq\"}]}},\"id\":\"vleo\",\"name\":\"fmluiqtqzfavyvn\",\"type\":\"qybaryeua\"}") - .toObject(DiagnosticsInner.class); - Assertions.assertEquals("xifqjzgxm", model.properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("jupauut", model.properties().dataset().get(0).table().tableName()); - Assertions.assertEquals(844799753, model.properties().dataset().get(0).renderingProperties().type()); - Assertions.assertEquals("jxv", model.properties().dataset().get(0).renderingProperties().title()); - Assertions.assertEquals("fceacvlhvygd", - model.properties().dataset().get(0).renderingProperties().description()); - Assertions.assertEquals(false, model.properties().dataset().get(0).renderingProperties().isVisible()); - Assertions.assertEquals("yhpluodpvruudlgz", model.properties().status().message()); - Assertions.assertEquals(1325865791, model.properties().status().statusId()); - Assertions.assertEquals("stgktst", model.properties().dataProviderMetadata().providerName()); - Assertions.assertEquals("clzedqbcvh", model.properties().dataProviderMetadata().propertyBag().get(0).name()); - Assertions.assertEquals("h", model.properties().dataProviderMetadata().propertyBag().get(0).value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticsInner model - = new DiagnosticsInner() - .withProperties( - new DiagnosticsProperties() - .withMetadata(new DiagnosticsDefinition() - .withSupportTopicList(Arrays.asList(new DiagnosticSupportTopic(), - new DiagnosticSupportTopic(), new DiagnosticSupportTopic())) - .withAnalysisTypes(Arrays.asList("xifqjzgxm", "hu"))) - .withDataset( - Arrays - .asList( - new DiagnosticsDataApiResponse() - .withTable(new DiagnosticDataTableResponseObject().withTableName("jupauut") - .withColumns(Arrays.asList(new DiagnosticDataTableResponseColumn())) - .withRows(Arrays.asList("dataih", "datajqgwzp", "datafqntcyp", - "dataxjvfoimwksl"))) - .withRenderingProperties(new DiagnosticRendering().withType(844799753) - .withTitle("jxv") - .withDescription("fceacvlhvygd") - .withIsVisible(false)), - new DiagnosticsDataApiResponse() - .withTable(new DiagnosticDataTableResponseObject().withTableName("rtwnawjslbi") - .withColumns(Arrays.asList(new DiagnosticDataTableResponseColumn(), - new DiagnosticDataTableResponseColumn())) - .withRows(Arrays.asList("datacyztsfmznbaeqp", "datachqnrnrpxehuwry", - "dataqgaifmviklbydv", "datahbejdznxcvdsrhnj"))) - .withRenderingProperties(new DiagnosticRendering().withType(1229018312) - .withTitle("tnovqfzgemjdftul") - .withDescription("tduceamt") - .withIsVisible(false)), - new DiagnosticsDataApiResponse() - .withTable(new DiagnosticDataTableResponseObject().withTableName("m") - .withColumns(Arrays.asList(new DiagnosticDataTableResponseColumn())) - .withRows(Arrays.asList("datawqiok"))) - .withRenderingProperties(new DiagnosticRendering() - .withType(603460584) - .withTitle("ojmsvpkjprvkwc") - .withDescription("ql") - .withIsVisible(false)), - new DiagnosticsDataApiResponse() - .withTable(new DiagnosticDataTableResponseObject().withTableName("czheyd") - .withColumns(Arrays.asList(new DiagnosticDataTableResponseColumn(), - new DiagnosticDataTableResponseColumn(), - new DiagnosticDataTableResponseColumn(), - new DiagnosticDataTableResponseColumn())) - .withRows(Arrays.asList("datam", "dataxmaehvbbxu", "dataiplt"))) - .withRenderingProperties(new DiagnosticRendering().withType(1239776527) - .withTitle("axkgx") - .withDescription("rc") - .withIsVisible(true)))) - .withStatus(new DiagnosticsStatus().withMessage("yhpluodpvruudlgz").withStatusId(1325865791)) - .withDataProviderMetadata(new DiagnosticDataProviderMetadata().withProviderName("stgktst") - .withPropertyBag(Arrays.asList( - new DiagnosticDataProviderMetadataPropertyBagItem().withName("clzedqbcvh") - .withValue("h"), - new DiagnosticDataProviderMetadataPropertyBagItem().withName("odqkdlwwqfb") - .withValue("lkxt"), - new DiagnosticDataProviderMetadataPropertyBagItem().withName("jfsmlmbtxhwgfwsr") - .withValue("wcoezbrhub"), - new DiagnosticDataProviderMetadataPropertyBagItem().withName("hud") - .withValue("oookkqfq"))))); - model = BinaryData.fromObject(model).toObject(DiagnosticsInner.class); - Assertions.assertEquals("xifqjzgxm", model.properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("jupauut", model.properties().dataset().get(0).table().tableName()); - Assertions.assertEquals(844799753, model.properties().dataset().get(0).renderingProperties().type()); - Assertions.assertEquals("jxv", model.properties().dataset().get(0).renderingProperties().title()); - Assertions.assertEquals("fceacvlhvygd", - model.properties().dataset().get(0).renderingProperties().description()); - Assertions.assertEquals(false, model.properties().dataset().get(0).renderingProperties().isVisible()); - Assertions.assertEquals("yhpluodpvruudlgz", model.properties().status().message()); - Assertions.assertEquals(1325865791, model.properties().status().statusId()); - Assertions.assertEquals("stgktst", model.properties().dataProviderMetadata().providerName()); - Assertions.assertEquals("clzedqbcvh", model.properties().dataProviderMetadata().propertyBag().get(0).name()); - Assertions.assertEquals("h", model.properties().dataProviderMetadata().propertyBag().get(0).value()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsPropertiesTests.java deleted file mode 100644 index 5dd18398605cb..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsPropertiesTests.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataProviderMetadata; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataProviderMetadataPropertyBagItem; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataTableResponseColumn; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataTableResponseObject; -import com.azure.resourcemanager.appcontainers.models.DiagnosticRendering; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsDataApiResponse; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsDefinition; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsProperties; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsStatus; -import com.azure.resourcemanager.appcontainers.models.DiagnosticSupportTopic; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DiagnosticsPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiagnosticsProperties model = BinaryData.fromString( - "{\"metadata\":{\"id\":\"qabqgzslesjcb\",\"name\":\"rnntiewdjcv\",\"description\":\"uwrbehwagoh\",\"author\":\"f\",\"category\":\"mrqemvvhmx\",\"supportTopicList\":[{\"id\":\"futacoebjvewzc\",\"pesId\":\"nmwcpmgu\"},{\"id\":\"draufactkah\",\"pesId\":\"v\"}],\"analysisTypes\":[\"ziuxxpshnee\"],\"type\":\"lfg\",\"score\":26.94627},\"dataset\":[{\"table\":{\"tableName\":\"dlenrdsutujbazpj\",\"columns\":[{\"columnName\":\"inyflnorwmduvwp\",\"dataType\":\"vxwmygd\",\"columnType\":\"gpqch\"},{\"columnName\":\"zepn\",\"dataType\":\"jcrxgibbdaxcon\",\"columnType\":\"zauorsuk\"},{\"columnName\":\"wbqpl\",\"dataType\":\"vnuuepzl\",\"columnType\":\"hw\"},{\"columnName\":\"oldweyuqdu\",\"dataType\":\"mnnrwr\",\"columnType\":\"ork\"}],\"rows\":[\"dataywjhhgdnhx\",\"datasivfomilo\"]},\"renderingProperties\":{\"type\":1187169893,\"title\":\"fi\",\"description\":\"dieuzaofj\",\"isVisible\":false}},{\"table\":{\"tableName\":\"yysfgdot\",\"columns\":[{\"columnName\":\"ip\",\"dataType\":\"pwoqo\",\"columnType\":\"acjekni\"},{\"columnName\":\"hqvcimpevfgmblr\",\"dataType\":\"lbywdxsm\",\"columnType\":\"cwrwfs\"}],\"rows\":[\"datan\",\"datanszqujiz\",\"datavoqyt\",\"databyowbblgyavutp\"]},\"renderingProperties\":{\"type\":1107140158,\"title\":\"oismsksbpimlqol\",\"description\":\"kcgxxlxsffgcvi\",\"isVisible\":true}},{\"table\":{\"tableName\":\"l\",\"columns\":[{\"columnName\":\"oupfgfb\",\"dataType\":\"ubdyhgk\",\"columnType\":\"in\"},{\"columnName\":\"owzfttsttkt\",\"dataType\":\"hbq\",\"columnType\":\"tx\"},{\"columnName\":\"zukxitmmqtgqq\",\"dataType\":\"hrnxrxc\",\"columnType\":\"uisavokq\"}],\"rows\":[\"datavazivjlfr\",\"datattbaj\",\"datakatnwxyi\",\"datapidkqqfkuvscxkdm\"]},\"renderingProperties\":{\"type\":2101179664,\"title\":\"ibrxkp\",\"description\":\"oaz\",\"isVisible\":false}}],\"status\":{\"message\":\"bgo\",\"statusId\":1644940787},\"dataProviderMetadata\":{\"providerName\":\"oybfhjxakvvj\",\"propertyBag\":[{\"name\":\"r\",\"value\":\"lmywwtkgkxnyed\"},{\"name\":\"gyvudtjuewbc\",\"value\":\"xuuwhcj\"},{\"name\":\"ccybvp\",\"value\":\"akkud\"},{\"name\":\"xgwjplmagstcyoh\",\"value\":\"kyrk\"}]}}") - .toObject(DiagnosticsProperties.class); - Assertions.assertEquals("ziuxxpshnee", model.metadata().analysisTypes().get(0)); - Assertions.assertEquals("dlenrdsutujbazpj", model.dataset().get(0).table().tableName()); - Assertions.assertEquals("inyflnorwmduvwp", model.dataset().get(0).table().columns().get(0).columnName()); - Assertions.assertEquals("vxwmygd", model.dataset().get(0).table().columns().get(0).dataType()); - Assertions.assertEquals("gpqch", model.dataset().get(0).table().columns().get(0).columnType()); - Assertions.assertEquals(1187169893, model.dataset().get(0).renderingProperties().type()); - Assertions.assertEquals("fi", model.dataset().get(0).renderingProperties().title()); - Assertions.assertEquals("dieuzaofj", model.dataset().get(0).renderingProperties().description()); - Assertions.assertEquals(false, model.dataset().get(0).renderingProperties().isVisible()); - Assertions.assertEquals("bgo", model.status().message()); - Assertions.assertEquals(1644940787, model.status().statusId()); - Assertions.assertEquals("oybfhjxakvvj", model.dataProviderMetadata().providerName()); - Assertions.assertEquals("r", model.dataProviderMetadata().propertyBag().get(0).name()); - Assertions.assertEquals("lmywwtkgkxnyed", model.dataProviderMetadata().propertyBag().get(0).value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticsProperties model = new DiagnosticsProperties() - .withMetadata(new DiagnosticsDefinition() - .withSupportTopicList(Arrays.asList(new DiagnosticSupportTopic(), new DiagnosticSupportTopic())) - .withAnalysisTypes(Arrays.asList("ziuxxpshnee"))) - .withDataset(Arrays.asList( - new DiagnosticsDataApiResponse() - .withTable(new DiagnosticDataTableResponseObject().withTableName("dlenrdsutujbazpj") - .withColumns(Arrays.asList( - new DiagnosticDataTableResponseColumn().withColumnName("inyflnorwmduvwp") - .withDataType("vxwmygd") - .withColumnType("gpqch"), - new DiagnosticDataTableResponseColumn().withColumnName("zepn") - .withDataType("jcrxgibbdaxcon") - .withColumnType("zauorsuk"), - new DiagnosticDataTableResponseColumn().withColumnName("wbqpl") - .withDataType("vnuuepzl") - .withColumnType("hw"), - new DiagnosticDataTableResponseColumn().withColumnName("oldweyuqdu") - .withDataType("mnnrwr") - .withColumnType("ork"))) - .withRows(Arrays.asList("dataywjhhgdnhx", "datasivfomilo"))) - .withRenderingProperties(new DiagnosticRendering().withType(1187169893) - .withTitle("fi") - .withDescription("dieuzaofj") - .withIsVisible(false)), - new DiagnosticsDataApiResponse() - .withTable(new DiagnosticDataTableResponseObject().withTableName("yysfgdot") - .withColumns(Arrays.asList( - new DiagnosticDataTableResponseColumn().withColumnName("ip") - .withDataType("pwoqo") - .withColumnType("acjekni"), - new DiagnosticDataTableResponseColumn().withColumnName("hqvcimpevfgmblr") - .withDataType("lbywdxsm") - .withColumnType("cwrwfs"))) - .withRows(Arrays.asList("datan", "datanszqujiz", "datavoqyt", "databyowbblgyavutp"))) - .withRenderingProperties(new DiagnosticRendering().withType(1107140158) - .withTitle("oismsksbpimlqol") - .withDescription("kcgxxlxsffgcvi") - .withIsVisible(true)), - new DiagnosticsDataApiResponse() - .withTable(new DiagnosticDataTableResponseObject().withTableName("l") - .withColumns(Arrays.asList( - new DiagnosticDataTableResponseColumn().withColumnName("oupfgfb") - .withDataType("ubdyhgk") - .withColumnType("in"), - new DiagnosticDataTableResponseColumn().withColumnName("owzfttsttkt") - .withDataType("hbq") - .withColumnType("tx"), - new DiagnosticDataTableResponseColumn().withColumnName("zukxitmmqtgqq") - .withDataType("hrnxrxc") - .withColumnType("uisavokq"))) - .withRows(Arrays.asList("datavazivjlfr", "datattbaj", "datakatnwxyi", "datapidkqqfkuvscxkdm"))) - .withRenderingProperties(new DiagnosticRendering().withType(2101179664) - .withTitle("ibrxkp") - .withDescription("oaz") - .withIsVisible(false)))) - .withStatus(new DiagnosticsStatus().withMessage("bgo").withStatusId(1644940787)) - .withDataProviderMetadata(new DiagnosticDataProviderMetadata().withProviderName("oybfhjxakvvj") - .withPropertyBag(Arrays.asList( - new DiagnosticDataProviderMetadataPropertyBagItem().withName("r").withValue("lmywwtkgkxnyed"), - new DiagnosticDataProviderMetadataPropertyBagItem().withName("gyvudtjuewbc").withValue("xuuwhcj"), - new DiagnosticDataProviderMetadataPropertyBagItem().withName("ccybvp").withValue("akkud"), - new DiagnosticDataProviderMetadataPropertyBagItem().withName("xgwjplmagstcyoh") - .withValue("kyrk")))); - model = BinaryData.fromObject(model).toObject(DiagnosticsProperties.class); - Assertions.assertEquals("ziuxxpshnee", model.metadata().analysisTypes().get(0)); - Assertions.assertEquals("dlenrdsutujbazpj", model.dataset().get(0).table().tableName()); - Assertions.assertEquals("inyflnorwmduvwp", model.dataset().get(0).table().columns().get(0).columnName()); - Assertions.assertEquals("vxwmygd", model.dataset().get(0).table().columns().get(0).dataType()); - Assertions.assertEquals("gpqch", model.dataset().get(0).table().columns().get(0).columnType()); - Assertions.assertEquals(1187169893, model.dataset().get(0).renderingProperties().type()); - Assertions.assertEquals("fi", model.dataset().get(0).renderingProperties().title()); - Assertions.assertEquals("dieuzaofj", model.dataset().get(0).renderingProperties().description()); - Assertions.assertEquals(false, model.dataset().get(0).renderingProperties().isVisible()); - Assertions.assertEquals("bgo", model.status().message()); - Assertions.assertEquals(1644940787, model.status().statusId()); - Assertions.assertEquals("oybfhjxakvvj", model.dataProviderMetadata().providerName()); - Assertions.assertEquals("r", model.dataProviderMetadata().propertyBag().get(0).name()); - Assertions.assertEquals("lmywwtkgkxnyed", model.dataProviderMetadata().propertyBag().get(0).value()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsStatusTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsStatusTests.java deleted file mode 100644 index af4d23b4ce2fe..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsStatusTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsStatus; -import org.junit.jupiter.api.Assertions; - -public final class DiagnosticsStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiagnosticsStatus model = BinaryData.fromString("{\"message\":\"zrrjvpgly\",\"statusId\":431547090}") - .toObject(DiagnosticsStatus.class); - Assertions.assertEquals("zrrjvpgly", model.message()); - Assertions.assertEquals(431547090, model.statusId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticsStatus model = new DiagnosticsStatus().withMessage("zrrjvpgly").withStatusId(431547090); - model = BinaryData.fromObject(model).toObject(DiagnosticsStatus.class); - Assertions.assertEquals("zrrjvpgly", model.message()); - Assertions.assertEquals(431547090, model.statusId()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ExtendedLocationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ExtendedLocationTests.java deleted file mode 100644 index 2d9cda7c9d43d..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ExtendedLocationTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ExtendedLocation; -import com.azure.resourcemanager.appcontainers.models.ExtendedLocationTypes; -import org.junit.jupiter.api.Assertions; - -public final class ExtendedLocationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExtendedLocation model = BinaryData.fromString("{\"name\":\"mcmatuokthfuiu\",\"type\":\"CustomLocation\"}") - .toObject(ExtendedLocation.class); - Assertions.assertEquals("mcmatuokthfuiu", model.name()); - Assertions.assertEquals(ExtendedLocationTypes.CUSTOM_LOCATION, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExtendedLocation model - = new ExtendedLocation().withName("mcmatuokthfuiu").withType(ExtendedLocationTypes.CUSTOM_LOCATION); - model = BinaryData.fromObject(model).toObject(ExtendedLocation.class); - Assertions.assertEquals("mcmatuokthfuiu", model.name()); - Assertions.assertEquals(ExtendedLocationTypes.CUSTOM_LOCATION, model.type()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ForwardProxyTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ForwardProxyTests.java deleted file mode 100644 index 1150546269168..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ForwardProxyTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ForwardProxy; -import com.azure.resourcemanager.appcontainers.models.ForwardProxyConvention; -import org.junit.jupiter.api.Assertions; - -public final class ForwardProxyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ForwardProxy model = BinaryData.fromString( - "{\"convention\":\"Standard\",\"customHostHeaderName\":\"whdsoifiyip\",\"customProtoHeaderName\":\"sqwpgrjb\"}") - .toObject(ForwardProxy.class); - Assertions.assertEquals(ForwardProxyConvention.STANDARD, model.convention()); - Assertions.assertEquals("whdsoifiyip", model.customHostHeaderName()); - Assertions.assertEquals("sqwpgrjb", model.customProtoHeaderName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ForwardProxy model = new ForwardProxy().withConvention(ForwardProxyConvention.STANDARD) - .withCustomHostHeaderName("whdsoifiyip") - .withCustomProtoHeaderName("sqwpgrjb"); - model = BinaryData.fromObject(model).toObject(ForwardProxy.class); - Assertions.assertEquals(ForwardProxyConvention.STANDARD, model.convention()); - Assertions.assertEquals("whdsoifiyip", model.customHostHeaderName()); - Assertions.assertEquals("sqwpgrjb", model.customProtoHeaderName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/GlobalValidationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/GlobalValidationTests.java deleted file mode 100644 index fa819149f34df..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/GlobalValidationTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.GlobalValidation; -import com.azure.resourcemanager.appcontainers.models.UnauthenticatedClientActionV2; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class GlobalValidationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GlobalValidation model = BinaryData.fromString( - "{\"unauthenticatedClientAction\":\"Return401\",\"redirectToProvider\":\"mglzufcy\",\"excludedPaths\":[\"hdbihan\",\"fhfcb\",\"y\"]}") - .toObject(GlobalValidation.class); - Assertions.assertEquals(UnauthenticatedClientActionV2.RETURN401, model.unauthenticatedClientAction()); - Assertions.assertEquals("mglzufcy", model.redirectToProvider()); - Assertions.assertEquals("hdbihan", model.excludedPaths().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GlobalValidation model - = new GlobalValidation().withUnauthenticatedClientAction(UnauthenticatedClientActionV2.RETURN401) - .withRedirectToProvider("mglzufcy") - .withExcludedPaths(Arrays.asList("hdbihan", "fhfcb", "y")); - model = BinaryData.fromObject(model).toObject(GlobalValidation.class); - Assertions.assertEquals(UnauthenticatedClientActionV2.RETURN401, model.unauthenticatedClientAction()); - Assertions.assertEquals("mglzufcy", model.redirectToProvider()); - Assertions.assertEquals("hdbihan", model.excludedPaths().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpSettingsRoutesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpSettingsRoutesTests.java deleted file mode 100644 index f6c7004ee1803..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpSettingsRoutesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.HttpSettingsRoutes; -import org.junit.jupiter.api.Assertions; - -public final class HttpSettingsRoutesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HttpSettingsRoutes model - = BinaryData.fromString("{\"apiPrefix\":\"soodqxhcrmnoh\"}").toObject(HttpSettingsRoutes.class); - Assertions.assertEquals("soodqxhcrmnoh", model.apiPrefix()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HttpSettingsRoutes model = new HttpSettingsRoutes().withApiPrefix("soodqxhcrmnoh"); - model = BinaryData.fromObject(model).toObject(HttpSettingsRoutes.class); - Assertions.assertEquals("soodqxhcrmnoh", model.apiPrefix()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpSettingsTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpSettingsTests.java deleted file mode 100644 index 7af3807b0cf7b..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpSettingsTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ForwardProxy; -import com.azure.resourcemanager.appcontainers.models.ForwardProxyConvention; -import com.azure.resourcemanager.appcontainers.models.HttpSettings; -import com.azure.resourcemanager.appcontainers.models.HttpSettingsRoutes; -import org.junit.jupiter.api.Assertions; - -public final class HttpSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HttpSettings model = BinaryData.fromString( - "{\"requireHttps\":true,\"routes\":{\"apiPrefix\":\"chboosflnrosf\"},\"forwardProxy\":{\"convention\":\"Custom\",\"customHostHeaderName\":\"hzzvypyq\",\"customProtoHeaderName\":\"mzinpvswjdk\"}}") - .toObject(HttpSettings.class); - Assertions.assertEquals(true, model.requireHttps()); - Assertions.assertEquals("chboosflnrosf", model.routes().apiPrefix()); - Assertions.assertEquals(ForwardProxyConvention.CUSTOM, model.forwardProxy().convention()); - Assertions.assertEquals("hzzvypyq", model.forwardProxy().customHostHeaderName()); - Assertions.assertEquals("mzinpvswjdk", model.forwardProxy().customProtoHeaderName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HttpSettings model = new HttpSettings().withRequireHttps(true) - .withRoutes(new HttpSettingsRoutes().withApiPrefix("chboosflnrosf")) - .withForwardProxy(new ForwardProxy().withConvention(ForwardProxyConvention.CUSTOM) - .withCustomHostHeaderName("hzzvypyq") - .withCustomProtoHeaderName("mzinpvswjdk")); - model = BinaryData.fromObject(model).toObject(HttpSettings.class); - Assertions.assertEquals(true, model.requireHttps()); - Assertions.assertEquals("chboosflnrosf", model.routes().apiPrefix()); - Assertions.assertEquals(ForwardProxyConvention.CUSTOM, model.forwardProxy().convention()); - Assertions.assertEquals("hzzvypyq", model.forwardProxy().customHostHeaderName()); - Assertions.assertEquals("mzinpvswjdk", model.forwardProxy().customProtoHeaderName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IngressPortMappingTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IngressPortMappingTests.java deleted file mode 100644 index a0a4447cf1f0b..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IngressPortMappingTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.IngressPortMapping; -import org.junit.jupiter.api.Assertions; - -public final class IngressPortMappingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IngressPortMapping model - = BinaryData.fromString("{\"external\":false,\"targetPort\":1817395780,\"exposedPort\":311434030}") - .toObject(IngressPortMapping.class); - Assertions.assertEquals(false, model.external()); - Assertions.assertEquals(1817395780, model.targetPort()); - Assertions.assertEquals(311434030, model.exposedPort()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IngressPortMapping model - = new IngressPortMapping().withExternal(false).withTargetPort(1817395780).withExposedPort(311434030); - model = BinaryData.fromObject(model).toObject(IngressPortMapping.class); - Assertions.assertEquals(false, model.external()); - Assertions.assertEquals(1817395780, model.targetPort()); - Assertions.assertEquals(311434030, model.exposedPort()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IngressStickySessionsTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IngressStickySessionsTests.java deleted file mode 100644 index f5793c8ace6bd..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IngressStickySessionsTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.Affinity; -import com.azure.resourcemanager.appcontainers.models.IngressStickySessions; -import org.junit.jupiter.api.Assertions; - -public final class IngressStickySessionsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IngressStickySessions model - = BinaryData.fromString("{\"affinity\":\"none\"}").toObject(IngressStickySessions.class); - Assertions.assertEquals(Affinity.NONE, model.affinity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IngressStickySessions model = new IngressStickySessions().withAffinity(Affinity.NONE); - model = BinaryData.fromObject(model).toObject(IngressStickySessions.class); - Assertions.assertEquals(Affinity.NONE, model.affinity()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IpSecurityRestrictionRuleTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IpSecurityRestrictionRuleTests.java deleted file mode 100644 index b4dc645516012..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IpSecurityRestrictionRuleTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.Action; -import com.azure.resourcemanager.appcontainers.models.IpSecurityRestrictionRule; -import org.junit.jupiter.api.Assertions; - -public final class IpSecurityRestrictionRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpSecurityRestrictionRule model = BinaryData - .fromString( - "{\"name\":\"txon\",\"description\":\"ts\",\"ipAddressRange\":\"vjcbpwxqpsrknf\",\"action\":\"Deny\"}") - .toObject(IpSecurityRestrictionRule.class); - Assertions.assertEquals("txon", model.name()); - Assertions.assertEquals("ts", model.description()); - Assertions.assertEquals("vjcbpwxqpsrknf", model.ipAddressRange()); - Assertions.assertEquals(Action.DENY, model.action()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpSecurityRestrictionRule model = new IpSecurityRestrictionRule().withName("txon") - .withDescription("ts") - .withIpAddressRange("vjcbpwxqpsrknf") - .withAction(Action.DENY); - model = BinaryData.fromObject(model).toObject(IpSecurityRestrictionRule.class); - Assertions.assertEquals("txon", model.name()); - Assertions.assertEquals("ts", model.description()); - Assertions.assertEquals("vjcbpwxqpsrknf", model.ipAddressRange()); - Assertions.assertEquals(Action.DENY, model.action()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobConfigurationManualTriggerConfigTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobConfigurationManualTriggerConfigTests.java deleted file mode 100644 index eb74f01445951..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobConfigurationManualTriggerConfigTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.JobConfigurationManualTriggerConfig; -import org.junit.jupiter.api.Assertions; - -public final class JobConfigurationManualTriggerConfigTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobConfigurationManualTriggerConfig model - = BinaryData.fromString("{\"replicaCompletionCount\":792325056,\"parallelism\":1343904651}") - .toObject(JobConfigurationManualTriggerConfig.class); - Assertions.assertEquals(792325056, model.replicaCompletionCount()); - Assertions.assertEquals(1343904651, model.parallelism()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobConfigurationManualTriggerConfig model - = new JobConfigurationManualTriggerConfig().withReplicaCompletionCount(792325056) - .withParallelism(1343904651); - model = BinaryData.fromObject(model).toObject(JobConfigurationManualTriggerConfig.class); - Assertions.assertEquals(792325056, model.replicaCompletionCount()); - Assertions.assertEquals(1343904651, model.parallelism()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobConfigurationScheduleTriggerConfigTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobConfigurationScheduleTriggerConfigTests.java deleted file mode 100644 index 41072c87f9dfa..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobConfigurationScheduleTriggerConfigTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.JobConfigurationScheduleTriggerConfig; -import org.junit.jupiter.api.Assertions; - -public final class JobConfigurationScheduleTriggerConfigTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobConfigurationScheduleTriggerConfig model = BinaryData - .fromString("{\"replicaCompletionCount\":587108165,\"cronExpression\":\"to\",\"parallelism\":533122724}") - .toObject(JobConfigurationScheduleTriggerConfig.class); - Assertions.assertEquals(587108165, model.replicaCompletionCount()); - Assertions.assertEquals("to", model.cronExpression()); - Assertions.assertEquals(533122724, model.parallelism()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobConfigurationScheduleTriggerConfig model - = new JobConfigurationScheduleTriggerConfig().withReplicaCompletionCount(587108165) - .withCronExpression("to") - .withParallelism(533122724); - model = BinaryData.fromObject(model).toObject(JobConfigurationScheduleTriggerConfig.class); - Assertions.assertEquals(587108165, model.replicaCompletionCount()); - Assertions.assertEquals("to", model.cronExpression()); - Assertions.assertEquals(533122724, model.parallelism()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobExecutionBaseInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobExecutionBaseInnerTests.java deleted file mode 100644 index d169d8b33c5c8..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobExecutionBaseInnerTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionBaseInner; -import org.junit.jupiter.api.Assertions; - -public final class JobExecutionBaseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobExecutionBaseInner model = BinaryData.fromString("{\"name\":\"gwklnsr\",\"id\":\"feycxcktp\"}") - .toObject(JobExecutionBaseInner.class); - Assertions.assertEquals("gwklnsr", model.name()); - Assertions.assertEquals("feycxcktp", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobExecutionBaseInner model = new JobExecutionBaseInner().withName("gwklnsr").withId("feycxcktp"); - model = BinaryData.fromObject(model).toObject(JobExecutionBaseInner.class); - Assertions.assertEquals("gwklnsr", model.name()); - Assertions.assertEquals("feycxcktp", model.id()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobExecutionInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobExecutionInnerTests.java deleted file mode 100644 index 8fa66f04b14f8..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobExecutionInnerTests.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionInner; -import com.azure.resourcemanager.appcontainers.models.ContainerResources; -import com.azure.resourcemanager.appcontainers.models.EnvironmentVar; -import com.azure.resourcemanager.appcontainers.models.JobExecutionContainer; -import com.azure.resourcemanager.appcontainers.models.JobExecutionTemplate; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JobExecutionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JobExecutionInner model = BinaryData.fromString( - "{\"name\":\"brjlnacgcckknhxk\",\"id\":\"v\",\"type\":\"nrzvuljraaer\",\"properties\":{\"status\":\"Degraded\",\"startTime\":\"2021-08-09T04:53:10Z\",\"endTime\":\"2021-04-13T22:37:48Z\",\"template\":{\"containers\":[{\"image\":\"vbroylaxxu\",\"name\":\"disdosfjbjsvgj\",\"command\":[\"r\",\"vyc\"],\"args\":[\"c\",\"xgccknfnw\"],\"env\":[{},{},{}],\"resources\":{\"cpu\":92.58066049026887,\"memory\":\"jdhttzaefedxi\",\"ephemeralStorage\":\"hrphkmcrjdqn\"}}],\"initContainers\":[{\"image\":\"pbgtgkylkdghrj\",\"name\":\"utlwxezwzhok\",\"command\":[\"nhhtql\",\"ehgpp\",\"pifhpfeoajvgcxtx\",\"csheafidltugsr\"],\"args\":[\"kssjhoiftxfk\"],\"env\":[{},{},{}],\"resources\":{\"cpu\":54.436034211849226,\"memory\":\"tillucbiqtg\",\"ephemeralStorage\":\"ohmcwsld\"}},{\"image\":\"zetpwbra\",\"name\":\"libph\",\"command\":[\"mizak\",\"kan\",\"jpdn\"],\"args\":[\"ajoylhjl\"],\"env\":[{},{}],\"resources\":{\"cpu\":29.664656948593926,\"memory\":\"mrsopte\",\"ephemeralStorage\":\"jme\"}},{\"image\":\"ls\",\"name\":\"asylwx\",\"command\":[\"umweoohguufuzboy\",\"athwt\",\"olbaemwmdx\",\"ebwjscjpahlxvea\"],\"args\":[\"xnmwmqtibxyijddt\",\"qcttadijaeukmrsi\"],\"env\":[{}],\"resources\":{\"cpu\":66.99801356760808,\"memory\":\"apm\",\"ephemeralStorage\":\"qmeqwigpibudqwyx\"}}]}}}") - .toObject(JobExecutionInner.class); - Assertions.assertEquals("brjlnacgcckknhxk", model.name()); - Assertions.assertEquals("v", model.id()); - Assertions.assertEquals("nrzvuljraaer", model.type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-09T04:53:10Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-13T22:37:48Z"), model.endTime()); - Assertions.assertEquals("vbroylaxxu", model.template().containers().get(0).image()); - Assertions.assertEquals("disdosfjbjsvgj", model.template().containers().get(0).name()); - Assertions.assertEquals("r", model.template().containers().get(0).command().get(0)); - Assertions.assertEquals("c", model.template().containers().get(0).args().get(0)); - Assertions.assertEquals(92.58066049026887D, model.template().containers().get(0).resources().cpu()); - Assertions.assertEquals("jdhttzaefedxi", model.template().containers().get(0).resources().memory()); - Assertions.assertEquals("pbgtgkylkdghrj", model.template().initContainers().get(0).image()); - Assertions.assertEquals("utlwxezwzhok", model.template().initContainers().get(0).name()); - Assertions.assertEquals("nhhtql", model.template().initContainers().get(0).command().get(0)); - Assertions.assertEquals("kssjhoiftxfk", model.template().initContainers().get(0).args().get(0)); - Assertions.assertEquals(54.436034211849226D, model.template().initContainers().get(0).resources().cpu()); - Assertions.assertEquals("tillucbiqtg", model.template().initContainers().get(0).resources().memory()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobExecutionInner model - = new JobExecutionInner().withName("brjlnacgcckknhxk") - .withId("v") - .withType("nrzvuljraaer") - .withStartTime(OffsetDateTime.parse("2021-08-09T04:53:10Z")) - .withEndTime(OffsetDateTime.parse("2021-04-13T22:37:48Z")) - .withTemplate( - new JobExecutionTemplate() - .withContainers(Arrays.asList(new JobExecutionContainer().withImage("vbroylaxxu") - .withName("disdosfjbjsvgj") - .withCommand(Arrays.asList("r", "vyc")) - .withArgs(Arrays.asList("c", "xgccknfnw")) - .withEnv(Arrays.asList(new EnvironmentVar(), new EnvironmentVar(), new EnvironmentVar())) - .withResources( - new ContainerResources().withCpu(92.58066049026887D).withMemory("jdhttzaefedxi")))) - .withInitContainers( - Arrays - .asList( - new JobExecutionContainer().withImage("pbgtgkylkdghrj") - .withName("utlwxezwzhok") - .withCommand( - Arrays.asList("nhhtql", "ehgpp", "pifhpfeoajvgcxtx", "csheafidltugsr")) - .withArgs(Arrays.asList("kssjhoiftxfk")) - .withEnv(Arrays.asList(new EnvironmentVar(), new EnvironmentVar(), - new EnvironmentVar())) - .withResources(new ContainerResources() - .withCpu(54.436034211849226D) - .withMemory("tillucbiqtg")), - new JobExecutionContainer().withImage("zetpwbra") - .withName("libph") - .withCommand(Arrays.asList("mizak", "kan", "jpdn")) - .withArgs(Arrays.asList("ajoylhjl")) - .withEnv(Arrays.asList(new EnvironmentVar(), new EnvironmentVar())) - .withResources(new ContainerResources().withCpu(29.664656948593926D) - .withMemory("mrsopte")), - new JobExecutionContainer().withImage("ls") - .withName("asylwx") - .withCommand( - Arrays.asList("umweoohguufuzboy", "athwt", "olbaemwmdx", "ebwjscjpahlxvea")) - .withArgs(Arrays.asList("xnmwmqtibxyijddt", "qcttadijaeukmrsi")) - .withEnv(Arrays.asList(new EnvironmentVar())) - .withResources( - new ContainerResources().withCpu(66.99801356760808D).withMemory("apm"))))); - model = BinaryData.fromObject(model).toObject(JobExecutionInner.class); - Assertions.assertEquals("brjlnacgcckknhxk", model.name()); - Assertions.assertEquals("v", model.id()); - Assertions.assertEquals("nrzvuljraaer", model.type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-09T04:53:10Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-13T22:37:48Z"), model.endTime()); - Assertions.assertEquals("vbroylaxxu", model.template().containers().get(0).image()); - Assertions.assertEquals("disdosfjbjsvgj", model.template().containers().get(0).name()); - Assertions.assertEquals("r", model.template().containers().get(0).command().get(0)); - Assertions.assertEquals("c", model.template().containers().get(0).args().get(0)); - Assertions.assertEquals(92.58066049026887D, model.template().containers().get(0).resources().cpu()); - Assertions.assertEquals("jdhttzaefedxi", model.template().containers().get(0).resources().memory()); - Assertions.assertEquals("pbgtgkylkdghrj", model.template().initContainers().get(0).image()); - Assertions.assertEquals("utlwxezwzhok", model.template().initContainers().get(0).name()); - Assertions.assertEquals("nhhtql", model.template().initContainers().get(0).command().get(0)); - Assertions.assertEquals("kssjhoiftxfk", model.template().initContainers().get(0).args().get(0)); - Assertions.assertEquals(54.436034211849226D, model.template().initContainers().get(0).resources().cpu()); - Assertions.assertEquals("tillucbiqtg", model.template().initContainers().get(0).resources().memory()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobsDeleteMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobsDeleteMockTests.java deleted file mode 100644 index 9cd6d60ab6371..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class JobsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.jobs().delete("sauzpjlx", "ehuxiqhzlraym", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobsExecutionsListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobsExecutionsListMockTests.java deleted file mode 100644 index 14c8a58571253..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobsExecutionsListMockTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.JobExecution; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class JobsExecutionsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"lhkalehpavawugi\",\"id\":\"tiogqgdmini\",\"type\":\"teajohiyg\",\"properties\":{\"status\":\"Running\",\"startTime\":\"2021-01-10T08:24:54Z\",\"endTime\":\"2021-06-30T15:37:59Z\",\"template\":{\"containers\":[{\"image\":\"mktp\",\"name\":\"xqcsehch\",\"command\":[\"fmpqumqyjg\",\"dzulo\",\"saeuzanhsfnhsenw\"],\"args\":[\"zf\",\"gqjclidftujwj\",\"ufwbeqrku\"],\"env\":[{},{},{},{}],\"resources\":{}}],\"initContainers\":[{\"image\":\"uqnmdvhazcvj\",\"name\":\"iqswbqer\",\"command\":[\"iytxt\",\"gukvlbpkt\",\"dstyouam\"],\"args\":[\"reswmowegmmut\",\"yxey\",\"uqi\"],\"env\":[{},{},{},{}],\"resources\":{}},{\"image\":\"tnspxlzdesygri\",\"name\":\"aiuf\",\"command\":[\"aybfu\",\"qfrojsydgrhyd\",\"ygywe\"],\"args\":[\"iecafygzmxi\",\"qv\",\"smaklixqcahy\"],\"env\":[{},{},{}],\"resources\":{}},{\"image\":\"bx\",\"name\":\"oij\",\"command\":[\"tblxpkkwjdjodqhy\",\"incnr\"],\"args\":[\"hllizhceumoq\",\"dkadppyibn\",\"qladywrxwhydtlu\"],\"env\":[{},{}],\"resources\":{}}]}}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.jobsExecutions().list("y", "mvqdbpbhfckdvez", "rcssbzhddubbnq", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("lhkalehpavawugi", response.iterator().next().name()); - Assertions.assertEquals("tiogqgdmini", response.iterator().next().id()); - Assertions.assertEquals("teajohiyg", response.iterator().next().type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-10T08:24:54Z"), response.iterator().next().startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-30T15:37:59Z"), response.iterator().next().endTime()); - Assertions.assertEquals("mktp", response.iterator().next().template().containers().get(0).image()); - Assertions.assertEquals("xqcsehch", response.iterator().next().template().containers().get(0).name()); - Assertions.assertEquals("fmpqumqyjg", - response.iterator().next().template().containers().get(0).command().get(0)); - Assertions.assertEquals("zf", response.iterator().next().template().containers().get(0).args().get(0)); - Assertions.assertEquals("uqnmdvhazcvj", response.iterator().next().template().initContainers().get(0).image()); - Assertions.assertEquals("iqswbqer", response.iterator().next().template().initContainers().get(0).name()); - Assertions.assertEquals("iytxt", - response.iterator().next().template().initContainers().get(0).command().get(0)); - Assertions.assertEquals("reswmowegmmut", - response.iterator().next().template().initContainers().get(0).args().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobsGetDetectorWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobsGetDetectorWithResponseMockTests.java deleted file mode 100644 index 4a1bfaed7a174..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobsGetDetectorWithResponseMockTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.Diagnostics; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class JobsGetDetectorWithResponseMockTests { - @Test - public void testGetDetectorWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"metadata\":{\"id\":\"fijd\",\"name\":\"uqnwsithu\",\"description\":\"ly\",\"author\":\"luqw\",\"category\":\"lsutrjbh\",\"supportTopicList\":[{\"id\":\"hyqezvqq\",\"pesId\":\"drftbcvexreuquo\"}],\"analysisTypes\":[\"jv\",\"whreagkhyxvrq\",\"vbczsulmdg\"],\"type\":\"mepjpf\",\"score\":72.78206},\"dataset\":[{\"table\":{\"tableName\":\"ngpszngafpg\",\"columns\":[{}],\"rows\":[\"datacj\",\"datajcngoadyed\"]},\"renderingProperties\":{\"type\":2079437891,\"title\":\"foknubnoitp\",\"description\":\"ztrgdgxvcoq\",\"isVisible\":false}}],\"status\":{\"message\":\"gyxpqit\",\"statusId\":1168808481},\"dataProviderMetadata\":{\"providerName\":\"wvskbuhzacaqtylt\",\"propertyBag\":[{\"name\":\"ujpdsxzak\",\"value\":\"jkmvbi\"},{\"name\":\"jofqcvovjufycs\",\"value\":\"lbemyej\"}]}},\"id\":\"iuxegth\",\"name\":\"rtudawlpjfel\",\"type\":\"erppt\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Diagnostics response = manager.jobs() - .getDetectorWithResponse("akfqfrkemyildud", "jascowvfdjkpd", "phlkksnm", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("jv", response.properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("ngpszngafpg", response.properties().dataset().get(0).table().tableName()); - Assertions.assertEquals(2079437891, response.properties().dataset().get(0).renderingProperties().type()); - Assertions.assertEquals("foknubnoitp", response.properties().dataset().get(0).renderingProperties().title()); - Assertions.assertEquals("ztrgdgxvcoq", - response.properties().dataset().get(0).renderingProperties().description()); - Assertions.assertEquals(false, response.properties().dataset().get(0).renderingProperties().isVisible()); - Assertions.assertEquals("gyxpqit", response.properties().status().message()); - Assertions.assertEquals(1168808481, response.properties().status().statusId()); - Assertions.assertEquals("wvskbuhzacaqtylt", response.properties().dataProviderMetadata().providerName()); - Assertions.assertEquals("ujpdsxzak", response.properties().dataProviderMetadata().propertyBag().get(0).name()); - Assertions.assertEquals("jkmvbi", response.properties().dataProviderMetadata().propertyBag().get(0).value()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobsListDetectorsMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobsListDetectorsMockTests.java deleted file mode 100644 index fd4aa1faf320c..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobsListDetectorsMockTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.Diagnostics; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class JobsListDetectorsMockTests { - @Test - public void testListDetectors() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"metadata\":{\"id\":\"eeksnbksdqhjvyk\",\"name\":\"eslk\",\"description\":\"ustcpoq\",\"author\":\"vnwqjwgo\",\"category\":\"lejjjkxy\",\"supportTopicList\":[{\"id\":\"bkjbz\",\"pesId\":\"nsvk\"}],\"analysisTypes\":[\"jtjknsxf\",\"us\"],\"type\":\"dpkupnqrmgjf\",\"score\":95.03275},\"dataset\":[{\"table\":{\"tableName\":\"oiojfizfavkjzwfb\",\"columns\":[{},{}],\"rows\":[\"datammfz\",\"databfw\"]},\"renderingProperties\":{\"type\":1740416627,\"title\":\"dew\",\"description\":\"sxkrpl\",\"isVisible\":false}},{\"table\":{\"tableName\":\"jwwviy\",\"columns\":[{}],\"rows\":[\"datahbrnnhjx\",\"dataqwjhqkbiwetpozyc\",\"dataqiqyhgfsetzlexbs\"]},\"renderingProperties\":{\"type\":805982929,\"title\":\"no\",\"description\":\"ziu\",\"isVisible\":false}},{\"table\":{\"tableName\":\"kdtnhqsyclj\",\"columns\":[{},{},{}],\"rows\":[\"datapbafvafhlbylc\",\"databevxrhyzd\",\"datawrso\"]},\"renderingProperties\":{\"type\":417832295,\"title\":\"bmairrhvhfnracwn\",\"description\":\"igtuu\",\"isVisible\":true}},{\"table\":{\"tableName\":\"dawsigrbjb\",\"columns\":[{},{}],\"rows\":[\"datavitvqkjyaz\",\"dataumtggmuwdchozfn\",\"datafexl\"]},\"renderingProperties\":{\"type\":133463775,\"title\":\"kizvoa\",\"description\":\"naqln\",\"isVisible\":true}}],\"status\":{\"message\":\"yxl\",\"statusId\":1391539520},\"dataProviderMetadata\":{\"providerName\":\"vx\",\"propertyBag\":[{\"name\":\"hmpejtlkexaonw\",\"value\":\"kcq\"}]}},\"id\":\"xhxknlc\",\"name\":\"rmmkyupiju\",\"type\":\"yqjf\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.jobs().listDetectors("xaptefhexcgjok", "ljnhvlqj", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jtjknsxf", response.iterator().next().properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("oiojfizfavkjzwfb", - response.iterator().next().properties().dataset().get(0).table().tableName()); - Assertions.assertEquals(1740416627, - response.iterator().next().properties().dataset().get(0).renderingProperties().type()); - Assertions.assertEquals("dew", - response.iterator().next().properties().dataset().get(0).renderingProperties().title()); - Assertions.assertEquals("sxkrpl", - response.iterator().next().properties().dataset().get(0).renderingProperties().description()); - Assertions.assertEquals(false, - response.iterator().next().properties().dataset().get(0).renderingProperties().isVisible()); - Assertions.assertEquals("yxl", response.iterator().next().properties().status().message()); - Assertions.assertEquals(1391539520, response.iterator().next().properties().status().statusId()); - Assertions.assertEquals("vx", response.iterator().next().properties().dataProviderMetadata().providerName()); - Assertions.assertEquals("hmpejtlkexaonw", - response.iterator().next().properties().dataProviderMetadata().propertyBag().get(0).name()); - Assertions.assertEquals("kcq", - response.iterator().next().properties().dataProviderMetadata().propertyBag().get(0).value()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobsStopExecutionMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobsStopExecutionMockTests.java deleted file mode 100644 index 3d52ab0748ae8..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobsStopExecutionMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class JobsStopExecutionMockTests { - @Test - public void testStopExecution() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.jobs().stopExecution("aekqsykvwj", "qpkevmyltjc", "spxklu", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobsStopMultipleExecutionsMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobsStopMultipleExecutionsMockTests.java deleted file mode 100644 index 79266a7924d8b..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JobsStopMultipleExecutionsMockTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.ContainerAppJobExecutions; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class JobsStopMultipleExecutionsMockTests { - @Test - public void testStopMultipleExecutions() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"xigpxvkqmaupxvpi\",\"id\":\"f\",\"type\":\"fyzyzeyuub\",\"properties\":{\"status\":\"Succeeded\",\"startTime\":\"2020-12-29T14:04:31Z\",\"endTime\":\"2021-01-12T02:10:57Z\",\"template\":{\"containers\":[{}],\"initContainers\":[{},{},{}]}}},{\"name\":\"ygvfltgvdihoyn\",\"id\":\"xwetwkdrcyrucpc\",\"type\":\"nuzdqumo\",\"properties\":{\"status\":\"Failed\",\"startTime\":\"2021-01-18T16:39:51Z\",\"endTime\":\"2021-06-19T02:50:24Z\",\"template\":{\"containers\":[{}],\"initContainers\":[{},{},{},{}]}}},{\"name\":\"ndnelqkaadlknw\",\"id\":\"anniyopetxivcnr\",\"type\":\"xnucaephblkwqp\",\"properties\":{\"status\":\"Running\",\"startTime\":\"2021-02-09T00:06:02Z\",\"endTime\":\"2021-03-16T07:15:59Z\",\"template\":{\"containers\":[{},{},{}],\"initContainers\":[{},{},{}]}}}],\"nextLink\":\"i\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ContainerAppJobExecutions response - = manager.jobs().stopMultipleExecutions("cclfgxannn", "ytzpo", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xigpxvkqmaupxvpi", response.value().get(0).name()); - Assertions.assertEquals("f", response.value().get(0).id()); - Assertions.assertEquals("fyzyzeyuub", response.value().get(0).type()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-29T14:04:31Z"), response.value().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-12T02:10:57Z"), response.value().get(0).endTime()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JwtClaimChecksTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JwtClaimChecksTests.java deleted file mode 100644 index bf00df8a7cca1..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JwtClaimChecksTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.JwtClaimChecks; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JwtClaimChecksTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JwtClaimChecks model = BinaryData.fromString( - "{\"allowedGroups\":[\"wzo\",\"xjtfelluwfzit\",\"np\",\"qfpjk\"],\"allowedClientApplications\":[\"ofpdvh\",\"fxxypininmayhuy\",\"bkpodepooginuv\",\"mihe\"]}") - .toObject(JwtClaimChecks.class); - Assertions.assertEquals("wzo", model.allowedGroups().get(0)); - Assertions.assertEquals("ofpdvh", model.allowedClientApplications().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JwtClaimChecks model - = new JwtClaimChecks().withAllowedGroups(Arrays.asList("wzo", "xjtfelluwfzit", "np", "qfpjk")) - .withAllowedClientApplications(Arrays.asList("ofpdvh", "fxxypininmayhuy", "bkpodepooginuv", "mihe")); - model = BinaryData.fromObject(model).toObject(JwtClaimChecks.class); - Assertions.assertEquals("wzo", model.allowedGroups().get(0)); - Assertions.assertEquals("ofpdvh", model.allowedClientApplications().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/KedaConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/KedaConfigurationTests.java deleted file mode 100644 index f8fd9f9a184ba..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/KedaConfigurationTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.KedaConfiguration; - -public final class KedaConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - KedaConfiguration model = BinaryData.fromString("{\"version\":\"hfrbbc\"}").toObject(KedaConfiguration.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - KedaConfiguration model = new KedaConfiguration(); - model = BinaryData.fromObject(model).toObject(KedaConfiguration.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ListUsagesResultTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ListUsagesResultTests.java deleted file mode 100644 index 2364604db8598..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ListUsagesResultTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.UsageInner; -import com.azure.resourcemanager.appcontainers.models.ListUsagesResult; -import com.azure.resourcemanager.appcontainers.models.UsageName; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ListUsagesResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ListUsagesResult model = BinaryData.fromString( - "{\"value\":[{\"currentValue\":15.58252,\"limit\":82.00838,\"name\":{\"value\":\"hsgqc\",\"localizedValue\":\"hohsd\"}},{\"currentValue\":83.44366,\"limit\":29.644806,\"name\":{\"value\":\"zsu\",\"localizedValue\":\"ohdxbzlmcmu\"}}],\"nextLink\":\"cvhd\"}") - .toObject(ListUsagesResult.class); - Assertions.assertEquals(15.58252f, model.value().get(0).currentValue()); - Assertions.assertEquals(82.00838f, model.value().get(0).limit()); - Assertions.assertEquals("hsgqc", model.value().get(0).name().value()); - Assertions.assertEquals("hohsd", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("cvhd", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ListUsagesResult model = new ListUsagesResult() - .withValue(Arrays.asList( - new UsageInner().withCurrentValue(15.58252f) - .withLimit(82.00838f) - .withName(new UsageName().withValue("hsgqc").withLocalizedValue("hohsd")), - new UsageInner().withCurrentValue(83.44366f) - .withLimit(29.644806f) - .withName(new UsageName().withValue("zsu").withLocalizedValue("ohdxbzlmcmu")))) - .withNextLink("cvhd"); - model = BinaryData.fromObject(model).toObject(ListUsagesResult.class); - Assertions.assertEquals(15.58252f, model.value().get(0).currentValue()); - Assertions.assertEquals(82.00838f, model.value().get(0).limit()); - Assertions.assertEquals("hsgqc", model.value().get(0).name().value()); - Assertions.assertEquals("hohsd", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("cvhd", model.nextLink()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LoginRoutesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LoginRoutesTests.java deleted file mode 100644 index 8f222853c74fa..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LoginRoutesTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.LoginRoutes; -import org.junit.jupiter.api.Assertions; - -public final class LoginRoutesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LoginRoutes model = BinaryData.fromString("{\"logoutEndpoint\":\"i\"}").toObject(LoginRoutes.class); - Assertions.assertEquals("i", model.logoutEndpoint()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LoginRoutes model = new LoginRoutes().withLogoutEndpoint("i"); - model = BinaryData.fromObject(model).toObject(LoginRoutes.class); - Assertions.assertEquals("i", model.logoutEndpoint()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LoginScopesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LoginScopesTests.java deleted file mode 100644 index 93bfce2812c12..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LoginScopesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.LoginScopes; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LoginScopesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LoginScopes model = BinaryData.fromString("{\"scopes\":[\"uticndvkaozwyif\",\"yhxhu\",\"okftyxolniwpwcuk\"]}") - .toObject(LoginScopes.class); - Assertions.assertEquals("uticndvkaozwyif", model.scopes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LoginScopes model = new LoginScopes().withScopes(Arrays.asList("uticndvkaozwyif", "yhxhu", "okftyxolniwpwcuk")); - model = BinaryData.fromObject(model).toObject(LoginScopes.class); - Assertions.assertEquals("uticndvkaozwyif", model.scopes().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatePatchTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatePatchTests.java deleted file mode 100644 index bef0186a07435..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatePatchTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ManagedCertificatePatch; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ManagedCertificatePatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedCertificatePatch model = BinaryData.fromString("{\"tags\":{\"vizbfhfo\":\"boldforobwj\"}}") - .toObject(ManagedCertificatePatch.class); - Assertions.assertEquals("boldforobwj", model.tags().get("vizbfhfo")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedCertificatePatch model = new ManagedCertificatePatch().withTags(mapOf("vizbfhfo", "boldforobwj")); - model = BinaryData.fromObject(model).toObject(ManagedCertificatePatch.class); - Assertions.assertEquals("boldforobwj", model.tags().get("vizbfhfo")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesDeleteWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesDeleteWithResponseMockTests.java deleted file mode 100644 index fc0edfbd6158e..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesDeleteWithResponseMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ManagedCertificatesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.managedCertificates().deleteWithResponse("lmf", "jdoq", "ykglt", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsGetDetectorWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsGetDetectorWithResponseMockTests.java deleted file mode 100644 index 8a72693a5bd55..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsGetDetectorWithResponseMockTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.Diagnostics; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ManagedEnvironmentDiagnosticsGetDetectorWithResponseMockTests { - @Test - public void testGetDetectorWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"metadata\":{\"id\":\"txfkndlqvt\",\"name\":\"nvgmmbugtywa\",\"description\":\"qaqkuea\",\"author\":\"roeshoygzc\",\"category\":\"fqxkfaoyteh\",\"supportTopicList\":[{\"id\":\"jmvqmtd\",\"pesId\":\"kygroejnndljdj\"},{\"id\":\"kb\",\"pesId\":\"eqy\"}],\"analysisTypes\":[\"eysfaqegplw\",\"ysh\",\"ddkvbxgkqu\"],\"type\":\"bwptdacarvvlf\",\"score\":29.70447},\"dataset\":[{\"table\":{\"tableName\":\"iwenazero\",\"columns\":[{}],\"rows\":[\"dataa\",\"datasxkdnwqapfgsdpc\"]},\"renderingProperties\":{\"type\":1999952305,\"title\":\"zhhkuuipldqqc\",\"description\":\"kva\",\"isVisible\":false}}],\"status\":{\"message\":\"jqvq\",\"statusId\":218702918},\"dataProviderMetadata\":{\"providerName\":\"tae\",\"propertyBag\":[{\"name\":\"zysevusxi\",\"value\":\"rrryveimips\"},{\"name\":\"yzatvfuzkaft\",\"value\":\"vru\"},{\"name\":\"igsyeipqdsmjt\",\"value\":\"qgdgkkile\"}]}},\"id\":\"kcsmk\",\"name\":\"hwtbbaedorvvm\",\"type\":\"floygbdgwumg\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Diagnostics response = manager.managedEnvironmentDiagnostics() - .getDetectorWithResponse("eldotjv", "kwiswskukjtas", "vwisp", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("eysfaqegplw", response.properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("iwenazero", response.properties().dataset().get(0).table().tableName()); - Assertions.assertEquals(1999952305, response.properties().dataset().get(0).renderingProperties().type()); - Assertions.assertEquals("zhhkuuipldqqc", response.properties().dataset().get(0).renderingProperties().title()); - Assertions.assertEquals("kva", response.properties().dataset().get(0).renderingProperties().description()); - Assertions.assertEquals(false, response.properties().dataset().get(0).renderingProperties().isVisible()); - Assertions.assertEquals("jqvq", response.properties().status().message()); - Assertions.assertEquals(218702918, response.properties().status().statusId()); - Assertions.assertEquals("tae", response.properties().dataProviderMetadata().providerName()); - Assertions.assertEquals("zysevusxi", response.properties().dataProviderMetadata().propertyBag().get(0).name()); - Assertions.assertEquals("rrryveimips", - response.properties().dataProviderMetadata().propertyBag().get(0).value()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsListDetectorsWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsListDetectorsWithResponseMockTests.java deleted file mode 100644 index 52d93a24e15d0..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsListDetectorsWithResponseMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsCollection; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ManagedEnvironmentDiagnosticsListDetectorsWithResponseMockTests { - @Test - public void testListDetectorsWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"metadata\":{\"id\":\"nkyhf\",\"name\":\"vsqxfxjelgcmpzqj\",\"description\":\"hqxu\",\"author\":\"vcacoyv\",\"category\":\"bsizus\",\"supportTopicList\":[{},{},{}],\"analysisTypes\":[\"scmnlziji\"],\"type\":\"ehgmvflnwyv\",\"score\":78.07501},\"dataset\":[{},{},{}],\"status\":{\"message\":\"niylyly\",\"statusId\":1965919560},\"dataProviderMetadata\":{\"providerName\":\"tgqztwhghmup\",\"propertyBag\":[{},{},{},{}]}},\"id\":\"tcdxabbujftaben\",\"name\":\"bklqpxz\",\"type\":\"cafeddw\"},{\"properties\":{\"metadata\":{\"id\":\"a\",\"name\":\"xud\",\"description\":\"hgookrtalvnbwgpb\",\"author\":\"eluclvdjj\",\"category\":\"yrdnqod\",\"supportTopicList\":[{},{}],\"analysisTypes\":[\"hqfaqnvz\"],\"type\":\"gyipem\",\"score\":57.573597},\"dataset\":[{}],\"status\":{\"message\":\"zuejd\",\"statusId\":2069987266},\"dataProviderMetadata\":{\"providerName\":\"ghwzhomewjjstli\",\"propertyBag\":[{},{},{}]}},\"id\":\"wmoaiancznvodrrs\",\"name\":\"blxydkxr\",\"type\":\"vvbxiwkgfbqljnq\"},{\"properties\":{\"metadata\":{\"id\":\"h\",\"name\":\"okulehurqlrqf\",\"description\":\"weyurkphyjd\",\"author\":\"av\",\"category\":\"qdbrxmrgc\",\"supportTopicList\":[{}],\"analysisTypes\":[\"kiyfjjkbajbusc\"],\"type\":\"uusioycblev\",\"score\":36.174137},\"dataset\":[{},{},{}],\"status\":{\"message\":\"xkyxlzgs\",\"statusId\":733092764},\"dataProviderMetadata\":{\"providerName\":\"ltafhbzffo\",\"propertyBag\":[{}]}},\"id\":\"jlzqsczpgvdwnapf\",\"name\":\"qwowftptnuw\",\"type\":\"tkschgcgqyhl\"}],\"nextLink\":\"eyqrhv\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DiagnosticsCollection response = manager.managedEnvironmentDiagnostics() - .listDetectorsWithResponse("zpyglqdhmrj", "ralcxpjbyypsj", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("scmnlziji", response.value().get(0).properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("niylyly", response.value().get(0).properties().status().message()); - Assertions.assertEquals(1965919560, response.value().get(0).properties().status().statusId()); - Assertions.assertEquals("tgqztwhghmup", - response.value().get(0).properties().dataProviderMetadata().providerName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPropertiesPeerAuthenticationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPropertiesPeerAuthenticationTests.java deleted file mode 100644 index 5e7b39d3ab48b..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPropertiesPeerAuthenticationTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerAuthentication; -import com.azure.resourcemanager.appcontainers.models.Mtls; -import org.junit.jupiter.api.Assertions; - -public final class ManagedEnvironmentPropertiesPeerAuthenticationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedEnvironmentPropertiesPeerAuthentication model = BinaryData.fromString("{\"mtls\":{\"enabled\":true}}") - .toObject(ManagedEnvironmentPropertiesPeerAuthentication.class); - Assertions.assertEquals(true, model.mtls().enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedEnvironmentPropertiesPeerAuthentication model - = new ManagedEnvironmentPropertiesPeerAuthentication().withMtls(new Mtls().withEnabled(true)); - model = BinaryData.fromObject(model).toObject(ManagedEnvironmentPropertiesPeerAuthentication.class); - Assertions.assertEquals(true, model.mtls().enabled()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryptionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryptionTests.java deleted file mode 100644 index 359c7c91e0b40..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryptionTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption; -import org.junit.jupiter.api.Assertions; - -public final class ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryptionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption model - = BinaryData.fromString("{\"enabled\":false}") - .toObject(ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption.class); - Assertions.assertEquals(false, model.enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption model - = new ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption().withEnabled(false); - model = BinaryData.fromObject(model) - .toObject(ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption.class); - Assertions.assertEquals(false, model.enabled()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPropertiesPeerTrafficConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPropertiesPeerTrafficConfigurationTests.java deleted file mode 100644 index 097abba790df4..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPropertiesPeerTrafficConfigurationTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfiguration; -import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption; -import org.junit.jupiter.api.Assertions; - -public final class ManagedEnvironmentPropertiesPeerTrafficConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedEnvironmentPropertiesPeerTrafficConfiguration model - = BinaryData.fromString("{\"encryption\":{\"enabled\":true}}") - .toObject(ManagedEnvironmentPropertiesPeerTrafficConfiguration.class); - Assertions.assertEquals(true, model.encryption().enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedEnvironmentPropertiesPeerTrafficConfiguration model - = new ManagedEnvironmentPropertiesPeerTrafficConfiguration() - .withEncryption(new ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption().withEnabled(true)); - model = BinaryData.fromObject(model).toObject(ManagedEnvironmentPropertiesPeerTrafficConfiguration.class); - Assertions.assertEquals(true, model.encryption().enabled()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentUsagesListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentUsagesListMockTests.java deleted file mode 100644 index fe4cfd32ddeb6..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentUsagesListMockTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.Usage; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ManagedEnvironmentUsagesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"currentValue\":95.19338,\"limit\":81.57856,\"name\":{\"value\":\"pdctuhspfefyi\",\"localizedValue\":\"uyeuyl\"}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.managedEnvironmentUsages().list("gnaavu", "gnteta", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(95.19338f, response.iterator().next().currentValue()); - Assertions.assertEquals(81.57856f, response.iterator().next().limit()); - Assertions.assertEquals("pdctuhspfefyi", response.iterator().next().name().value()); - Assertions.assertEquals("uyeuyl", response.iterator().next().name().localizedValue()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDeleteMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDeleteMockTests.java deleted file mode 100644 index 51ac69905c6be..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ManagedEnvironmentsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.managedEnvironments().delete("rbhtmeplvukaobr", "bpgsnbagnc", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListWorkloadProfileStatesMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListWorkloadProfileStatesMockTests.java deleted file mode 100644 index c91a665785c0c..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListWorkloadProfileStatesMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.WorkloadProfileStates; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ManagedEnvironmentsListWorkloadProfileStatesMockTests { - @Test - public void testListWorkloadProfileStates() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"minimumCount\":599005580,\"maximumCount\":1716523833,\"currentCount\":1816194825},\"id\":\"omevtfycn\",\"name\":\"bvgjcodkkgj\",\"type\":\"iytssikizbc\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.managedEnvironments() - .listWorkloadProfileStates("hjym", "cgqtag", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(599005580, response.iterator().next().properties().minimumCount()); - Assertions.assertEquals(1716523833, response.iterator().next().properties().maximumCount()); - Assertions.assertEquals(1816194825, response.iterator().next().properties().currentCount()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesDeleteWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesDeleteWithResponseMockTests.java deleted file mode 100644 index 261852f63a823..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ManagedEnvironmentsStoragesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.managedEnvironmentsStorages() - .deleteWithResponse("carkuzlb", "nndtsnxa", "qytl", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedServiceIdentityTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedServiceIdentityTests.java deleted file mode 100644 index 740a1498417ac..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedServiceIdentityTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; -import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.appcontainers.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ManagedServiceIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedServiceIdentity model = BinaryData.fromString( - "{\"principalId\":\"a37208a0-1e53-4547-b33d-971be789a2fd\",\"tenantId\":\"73255bce-6e48-4671-b0ad-1b72c7706488\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"zkd\":{\"principalId\":\"6051e750-c929-4a58-8f48-0c93344b6361\",\"clientId\":\"4e32b6df-a4f0-4c96-bcfc-1c359734618f\"},\"pvlopwiyighxpkd\":{\"principalId\":\"f86c34ea-934b-4bce-a701-f1a79f2ed73f\",\"clientId\":\"406602fb-fe45-49a6-9216-9794bfc546c5\"},\"aiuebbaumnyqu\":{\"principalId\":\"9b2918e1-726d-48dc-b60b-9cdce56af137\",\"clientId\":\"88756a07-849e-458c-bcc9-61ebeba1b0b5\"},\"eojnabc\":{\"principalId\":\"dedf47ba-5982-4941-9d42-847703d16525\",\"clientId\":\"b03e034e-8a4f-4cdf-bb35-65fca2a4fd97\"}}}") - .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedServiceIdentity model - = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf("zkd", new UserAssignedIdentity(), "pvlopwiyighxpkd", new UserAssignedIdentity(), - "aiuebbaumnyqu", new UserAssignedIdentity(), "eojnabc", new UserAssignedIdentity())); - model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MtlsTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MtlsTests.java deleted file mode 100644 index ab133ecdb6d4a..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MtlsTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.Mtls; -import org.junit.jupiter.api.Assertions; - -public final class MtlsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Mtls model = BinaryData.fromString("{\"enabled\":false}").toObject(Mtls.class); - Assertions.assertEquals(false, model.enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Mtls model = new Mtls().withEnabled(false); - model = BinaryData.fromObject(model).toObject(Mtls.class); - Assertions.assertEquals(false, model.enabled()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/NamespacesCheckNameAvailabilityWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/NamespacesCheckNameAvailabilityWithResponseMockTests.java deleted file mode 100644 index b58a078fb78ec..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/NamespacesCheckNameAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityReason; -import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityRequest; -import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NamespacesCheckNameAvailabilityWithResponseMockTests { - @Test - public void testCheckNameAvailabilityWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":false,\"reason\":\"Invalid\",\"message\":\"qg\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CheckNameAvailabilityResponse response = manager.namespaces() - .checkNameAvailabilityWithResponse("cfrgnawbabgfbkt", "jmfczlfsyqkf", - new CheckNameAvailabilityRequest().withName("zgowox").withType("je"), com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, response.reason()); - Assertions.assertEquals("qg", response.message()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/NonceTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/NonceTests.java deleted file mode 100644 index 545293d7a4e62..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/NonceTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.Nonce; -import org.junit.jupiter.api.Assertions; - -public final class NonceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Nonce model = BinaryData.fromString("{\"validateNonce\":false,\"nonceExpirationInterval\":\"ewmdw\"}") - .toObject(Nonce.class); - Assertions.assertEquals(false, model.validateNonce()); - Assertions.assertEquals("ewmdw", model.nonceExpirationInterval()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Nonce model = new Nonce().withValidateNonce(false).withNonceExpirationInterval("ewmdw"); - model = BinaryData.fromObject(model).toObject(Nonce.class); - Assertions.assertEquals(false, model.validateNonce()); - Assertions.assertEquals("ewmdw", model.nonceExpirationInterval()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OpenIdConnectLoginTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OpenIdConnectLoginTests.java deleted file mode 100644 index 4e14557445480..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OpenIdConnectLoginTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.OpenIdConnectLogin; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OpenIdConnectLoginTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OpenIdConnectLogin model = BinaryData.fromString("{\"nameClaimType\":\"ckyfih\",\"scopes\":[\"dfvzwdzuhty\"]}") - .toObject(OpenIdConnectLogin.class); - Assertions.assertEquals("ckyfih", model.nameClaimType()); - Assertions.assertEquals("dfvzwdzuhty", model.scopes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OpenIdConnectLogin model - = new OpenIdConnectLogin().withNameClaimType("ckyfih").withScopes(Arrays.asList("dfvzwdzuhty")); - model = BinaryData.fromObject(model).toObject(OpenIdConnectLogin.class); - Assertions.assertEquals("ckyfih", model.nameClaimType()); - Assertions.assertEquals("dfvzwdzuhty", model.scopes().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OperationDetailInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OperationDetailInnerTests.java deleted file mode 100644 index 4d28d0d641f62..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OperationDetailInnerTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.OperationDetailInner; -import com.azure.resourcemanager.appcontainers.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationDetailInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDetailInner model = BinaryData.fromString( - "{\"name\":\"bousn\",\"isDataAction\":true,\"display\":{\"provider\":\"ewetwlyxgncxykxh\",\"resource\":\"h\",\"operation\":\"mmbcxfhbcp\",\"description\":\"xvxcjzhq\"},\"origin\":\"xfpxtgqscja\"}") - .toObject(OperationDetailInner.class); - Assertions.assertEquals("bousn", model.name()); - Assertions.assertEquals(true, model.isDataAction()); - Assertions.assertEquals("ewetwlyxgncxykxh", model.display().provider()); - Assertions.assertEquals("h", model.display().resource()); - Assertions.assertEquals("mmbcxfhbcp", model.display().operation()); - Assertions.assertEquals("xvxcjzhq", model.display().description()); - Assertions.assertEquals("xfpxtgqscja", model.origin()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDetailInner model = new OperationDetailInner().withName("bousn") - .withIsDataAction(true) - .withDisplay(new OperationDisplay().withProvider("ewetwlyxgncxykxh") - .withResource("h") - .withOperation("mmbcxfhbcp") - .withDescription("xvxcjzhq")) - .withOrigin("xfpxtgqscja"); - model = BinaryData.fromObject(model).toObject(OperationDetailInner.class); - Assertions.assertEquals("bousn", model.name()); - Assertions.assertEquals(true, model.isDataAction()); - Assertions.assertEquals("ewetwlyxgncxykxh", model.display().provider()); - Assertions.assertEquals("h", model.display().resource()); - Assertions.assertEquals("mmbcxfhbcp", model.display().operation()); - Assertions.assertEquals("xvxcjzhq", model.display().description()); - Assertions.assertEquals("xfpxtgqscja", model.origin()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OperationDisplayTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OperationDisplayTests.java deleted file mode 100644 index ed467f9bf86ea..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OperationDisplayTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData - .fromString( - "{\"provider\":\"t\",\"resource\":\"hdqazkmtgguwp\",\"operation\":\"r\",\"description\":\"civmmg\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("t", model.provider()); - Assertions.assertEquals("hdqazkmtgguwp", model.resource()); - Assertions.assertEquals("r", model.operation()); - Assertions.assertEquals("civmmg", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("t") - .withResource("hdqazkmtgguwp") - .withOperation("r") - .withDescription("civmmg"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("t", model.provider()); - Assertions.assertEquals("hdqazkmtgguwp", model.resource()); - Assertions.assertEquals("r", model.operation()); - Assertions.assertEquals("civmmg", model.description()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OperationsListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OperationsListMockTests.java deleted file mode 100644 index 6a4310fb083b6..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OperationsListMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.OperationDetail; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"ubseskvcuartr\",\"isDataAction\":false,\"display\":{\"provider\":\"iryky\",\"resource\":\"dzfqivjreuy\",\"operation\":\"bmnwa\",\"description\":\"tbxoee\"},\"origin\":\"qlnfw\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ubseskvcuartr", response.iterator().next().name()); - Assertions.assertEquals(false, response.iterator().next().isDataAction()); - Assertions.assertEquals("iryky", response.iterator().next().display().provider()); - Assertions.assertEquals("dzfqivjreuy", response.iterator().next().display().resource()); - Assertions.assertEquals("bmnwa", response.iterator().next().display().operation()); - Assertions.assertEquals("tbxoee", response.iterator().next().display().description()); - Assertions.assertEquals("qlnfw", response.iterator().next().origin()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaCollectionInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaCollectionInnerTests.java deleted file mode 100644 index 650137f754125..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaCollectionInnerTests.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.ReplicaCollectionInner; -import com.azure.resourcemanager.appcontainers.fluent.models.ReplicaInner; -import com.azure.resourcemanager.appcontainers.models.ReplicaContainer; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ReplicaCollectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReplicaCollectionInner model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"createdTime\":\"2021-03-01T03:16:18Z\",\"runningState\":\"Running\",\"runningStateDetails\":\"ejhzisxg\",\"containers\":[{\"name\":\"olppvksrpqvujz\",\"containerId\":\"ehtwdwrft\",\"ready\":false,\"started\":true,\"restartCount\":670463751,\"runningState\":\"Waiting\",\"runningStateDetails\":\"h\",\"logStreamEndpoint\":\"fwpracstwi\",\"execEndpoint\":\"khevxccedc\"},{\"name\":\"md\",\"containerId\":\"dnwzxltjcvnhltiu\",\"ready\":false,\"started\":false,\"restartCount\":1032415559,\"runningState\":\"Terminated\",\"runningStateDetails\":\"ibyqunyowxwlmdj\",\"logStreamEndpoint\":\"vfgbvfvpdboda\",\"execEndpoint\":\"zsjqlh\"},{\"name\":\"r\",\"containerId\":\"deibqip\",\"ready\":true,\"started\":false,\"restartCount\":370586550,\"runningState\":\"Waiting\",\"runningStateDetails\":\"mkrefajpjorwkq\",\"logStreamEndpoint\":\"hgbijt\",\"execEndpoint\":\"vfxzsjab\"},{\"name\":\"systawfsdjp\",\"containerId\":\"vp\",\"ready\":true,\"started\":true,\"restartCount\":1597087074,\"runningState\":\"Terminated\",\"runningStateDetails\":\"vncjabudurgk\",\"logStreamEndpoint\":\"mokzhjjklf\",\"execEndpoint\":\"mouwqlgzrfzeey\"}],\"initContainers\":[{\"name\":\"ikayuhqlbjbsybb\",\"containerId\":\"r\",\"ready\":true,\"started\":false,\"restartCount\":348550148,\"runningState\":\"Running\",\"runningStateDetails\":\"mpipaslthaqfxs\",\"logStreamEndpoint\":\"wutwbdsre\",\"execEndpoint\":\"drhneuyow\"},{\"name\":\"d\",\"containerId\":\"t\",\"ready\":false,\"started\":true,\"restartCount\":1145560346,\"runningState\":\"Waiting\",\"runningStateDetails\":\"kpzi\",\"logStreamEndpoint\":\"j\",\"execEndpoint\":\"nlfzxiavrmbz\"},{\"name\":\"okixrjqcir\",\"containerId\":\"pfrlazsz\",\"ready\":false,\"started\":false,\"restartCount\":1723984044,\"runningState\":\"Terminated\",\"runningStateDetails\":\"wp\",\"logStreamEndpoint\":\"lwbtlhf\",\"execEndpoint\":\"jcdh\"}]},\"id\":\"fjvfbgofeljagr\",\"name\":\"mqhldvrii\",\"type\":\"ojnal\"},{\"properties\":{\"createdTime\":\"2021-07-19T10:32:01Z\",\"runningState\":\"Unknown\",\"runningStateDetails\":\"sexso\",\"containers\":[{\"name\":\"uqhhahhxvrh\",\"containerId\":\"kwpjgwwspughftqs\",\"ready\":true,\"started\":true,\"restartCount\":318834407,\"runningState\":\"Running\",\"runningStateDetails\":\"dxdigr\",\"logStreamEndpoint\":\"uufzdmsyqtfihw\",\"execEndpoint\":\"otzi\"}],\"initContainers\":[{\"name\":\"vppho\",\"containerId\":\"qzudphq\",\"ready\":true,\"started\":false,\"restartCount\":1561885870,\"runningState\":\"Running\",\"runningStateDetails\":\"cvtbv\",\"logStreamEndpoint\":\"yhmtnvyqiat\",\"execEndpoint\":\"wp\"},{\"name\":\"p\",\"containerId\":\"cjaesgvvs\",\"ready\":true,\"started\":false,\"restartCount\":306781812,\"runningState\":\"Waiting\",\"runningStateDetails\":\"wygzlvdnkfxusem\",\"logStreamEndpoint\":\"zrmuhapfcqdps\",\"execEndpoint\":\"qvpsvuoymg\"},{\"name\":\"elvezrypq\",\"containerId\":\"feo\",\"ready\":false,\"started\":true,\"restartCount\":835251373,\"runningState\":\"Waiting\",\"runningStateDetails\":\"bopgxedkowepbqp\",\"logStreamEndpoint\":\"fkbw\",\"execEndpoint\":\"snjvcdwxlpqekftn\"},{\"name\":\"tjsyin\",\"containerId\":\"fq\",\"ready\":false,\"started\":true,\"restartCount\":872729199,\"runningState\":\"Running\",\"runningStateDetails\":\"ypgik\",\"logStreamEndpoint\":\"szywkbirryu\",\"execEndpoint\":\"lhkjoqrvqq\"}]},\"id\":\"t\",\"name\":\"inrvgoupmfi\",\"type\":\"bfggjioolvr\"},{\"properties\":{\"createdTime\":\"2021-05-18T06:59:06Z\",\"runningState\":\"NotRunning\",\"runningStateDetails\":\"gllqwjy\",\"containers\":[{\"name\":\"yvblmhvkzu\",\"containerId\":\"xvvy\",\"ready\":false,\"started\":true,\"restartCount\":868406426,\"runningState\":\"Waiting\",\"runningStateDetails\":\"fegxuvwzfb\",\"logStreamEndpoint\":\"lmctlpd\",\"execEndpoint\":\"itvgbmhrixkwm\"},{\"name\":\"jejveg\",\"containerId\":\"bpnaixexccbdre\",\"ready\":true,\"started\":true,\"restartCount\":1031923330,\"runningState\":\"Waiting\",\"runningStateDetails\":\"qahqkghtpwijn\",\"logStreamEndpoint\":\"jsvfycxzbfvoowv\",\"execEndpoint\":\"mtg\"},{\"name\":\"ppyostronzmyhgf\",\"containerId\":\"nsxkmcwaekrrjr\",\"ready\":false,\"started\":false,\"restartCount\":1090066080,\"runningState\":\"Running\",\"runningStateDetails\":\"jglikkxwslolb\",\"logStreamEndpoint\":\"vuzlm\",\"execEndpoint\":\"elfk\"}],\"initContainers\":[{\"name\":\"crpw\",\"containerId\":\"eznoig\",\"ready\":true,\"started\":false,\"restartCount\":2126528324,\"runningState\":\"Terminated\",\"runningStateDetails\":\"bsazejjoqka\",\"logStreamEndpoint\":\"hsxttaugzxnf\",\"execEndpoint\":\"zpxdt\"},{\"name\":\"dm\",\"containerId\":\"j\",\"ready\":false,\"started\":true,\"restartCount\":1206033090,\"runningState\":\"Waiting\",\"runningStateDetails\":\"yo\",\"logStreamEndpoint\":\"ibreb\",\"execEndpoint\":\"aysjkixqtnqttez\"},{\"name\":\"fffiak\",\"containerId\":\"pqqmted\",\"ready\":false,\"started\":false,\"restartCount\":659909061,\"runningState\":\"Terminated\",\"runningStateDetails\":\"zphv\",\"logStreamEndpoint\":\"uyqncygupkvipmd\",\"execEndpoint\":\"wx\"},{\"name\":\"pevzhfst\",\"containerId\":\"xhojuj\",\"ready\":true,\"started\":true,\"restartCount\":93878588,\"runningState\":\"Terminated\",\"runningStateDetails\":\"ixbjx\",\"logStreamEndpoint\":\"w\",\"execEndpoint\":\"lrcoolsttpki\"}]},\"id\":\"kbnujr\",\"name\":\"wvtylbfpncurdo\",\"type\":\"wiithtywub\"}]}") - .toObject(ReplicaCollectionInner.class); - Assertions.assertEquals("olppvksrpqvujz", model.value().get(0).containers().get(0).name()); - Assertions.assertEquals("ehtwdwrft", model.value().get(0).containers().get(0).containerId()); - Assertions.assertEquals(false, model.value().get(0).containers().get(0).ready()); - Assertions.assertEquals(true, model.value().get(0).containers().get(0).started()); - Assertions.assertEquals(670463751, model.value().get(0).containers().get(0).restartCount()); - Assertions.assertEquals("ikayuhqlbjbsybb", model.value().get(0).initContainers().get(0).name()); - Assertions.assertEquals("r", model.value().get(0).initContainers().get(0).containerId()); - Assertions.assertEquals(true, model.value().get(0).initContainers().get(0).ready()); - Assertions.assertEquals(false, model.value().get(0).initContainers().get(0).started()); - Assertions.assertEquals(348550148, model.value().get(0).initContainers().get(0).restartCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReplicaCollectionInner model = new ReplicaCollectionInner().withValue(Arrays.asList( - new ReplicaInner() - .withContainers(Arrays.asList( - new ReplicaContainer().withName("olppvksrpqvujz") - .withContainerId("ehtwdwrft") - .withReady(false) - .withStarted(true) - .withRestartCount(670463751), - new ReplicaContainer().withName("md") - .withContainerId("dnwzxltjcvnhltiu") - .withReady(false) - .withStarted(false) - .withRestartCount(1032415559), - new ReplicaContainer().withName("r") - .withContainerId("deibqip") - .withReady(true) - .withStarted(false) - .withRestartCount(370586550), - new ReplicaContainer().withName("systawfsdjp") - .withContainerId("vp") - .withReady(true) - .withStarted(true) - .withRestartCount(1597087074))) - .withInitContainers(Arrays.asList( - new ReplicaContainer().withName("ikayuhqlbjbsybb") - .withContainerId("r") - .withReady(true) - .withStarted(false) - .withRestartCount(348550148), - new ReplicaContainer().withName("d") - .withContainerId("t") - .withReady(false) - .withStarted(true) - .withRestartCount(1145560346), - new ReplicaContainer().withName("okixrjqcir") - .withContainerId("pfrlazsz") - .withReady(false) - .withStarted(false) - .withRestartCount(1723984044))), - new ReplicaInner() - .withContainers(Arrays.asList(new ReplicaContainer().withName("uqhhahhxvrh") - .withContainerId("kwpjgwwspughftqs") - .withReady(true) - .withStarted(true) - .withRestartCount(318834407))) - .withInitContainers(Arrays.asList( - new ReplicaContainer().withName("vppho") - .withContainerId("qzudphq") - .withReady(true) - .withStarted(false) - .withRestartCount(1561885870), - new ReplicaContainer().withName("p") - .withContainerId("cjaesgvvs") - .withReady(true) - .withStarted(false) - .withRestartCount(306781812), - new ReplicaContainer().withName("elvezrypq") - .withContainerId("feo") - .withReady(false) - .withStarted(true) - .withRestartCount(835251373), - new ReplicaContainer().withName("tjsyin") - .withContainerId("fq") - .withReady(false) - .withStarted(true) - .withRestartCount(872729199))), - new ReplicaInner() - .withContainers(Arrays.asList( - new ReplicaContainer().withName("yvblmhvkzu") - .withContainerId("xvvy") - .withReady(false) - .withStarted(true) - .withRestartCount(868406426), - new ReplicaContainer().withName("jejveg") - .withContainerId("bpnaixexccbdre") - .withReady(true) - .withStarted(true) - .withRestartCount(1031923330), - new ReplicaContainer().withName("ppyostronzmyhgf") - .withContainerId("nsxkmcwaekrrjr") - .withReady(false) - .withStarted(false) - .withRestartCount(1090066080))) - .withInitContainers(Arrays.asList( - new ReplicaContainer().withName("crpw") - .withContainerId("eznoig") - .withReady(true) - .withStarted(false) - .withRestartCount(2126528324), - new ReplicaContainer().withName("dm") - .withContainerId("j") - .withReady(false) - .withStarted(true) - .withRestartCount(1206033090), - new ReplicaContainer().withName("fffiak") - .withContainerId("pqqmted") - .withReady(false) - .withStarted(false) - .withRestartCount(659909061), - new ReplicaContainer().withName("pevzhfst") - .withContainerId("xhojuj") - .withReady(true) - .withStarted(true) - .withRestartCount(93878588))))); - model = BinaryData.fromObject(model).toObject(ReplicaCollectionInner.class); - Assertions.assertEquals("olppvksrpqvujz", model.value().get(0).containers().get(0).name()); - Assertions.assertEquals("ehtwdwrft", model.value().get(0).containers().get(0).containerId()); - Assertions.assertEquals(false, model.value().get(0).containers().get(0).ready()); - Assertions.assertEquals(true, model.value().get(0).containers().get(0).started()); - Assertions.assertEquals(670463751, model.value().get(0).containers().get(0).restartCount()); - Assertions.assertEquals("ikayuhqlbjbsybb", model.value().get(0).initContainers().get(0).name()); - Assertions.assertEquals("r", model.value().get(0).initContainers().get(0).containerId()); - Assertions.assertEquals(true, model.value().get(0).initContainers().get(0).ready()); - Assertions.assertEquals(false, model.value().get(0).initContainers().get(0).started()); - Assertions.assertEquals(348550148, model.value().get(0).initContainers().get(0).restartCount()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaContainerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaContainerTests.java deleted file mode 100644 index dc3906aa732ed..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaContainerTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ReplicaContainer; -import org.junit.jupiter.api.Assertions; - -public final class ReplicaContainerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReplicaContainer model = BinaryData.fromString( - "{\"name\":\"msweypqwdxggicc\",\"containerId\":\"xqhuexm\",\"ready\":true,\"started\":true,\"restartCount\":713697907,\"runningState\":\"Terminated\",\"runningStateDetails\":\"wem\",\"logStreamEndpoint\":\"rncsdtclu\",\"execEndpoint\":\"ypbsfgytguslfead\"}") - .toObject(ReplicaContainer.class); - Assertions.assertEquals("msweypqwdxggicc", model.name()); - Assertions.assertEquals("xqhuexm", model.containerId()); - Assertions.assertEquals(true, model.ready()); - Assertions.assertEquals(true, model.started()); - Assertions.assertEquals(713697907, model.restartCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReplicaContainer model = new ReplicaContainer().withName("msweypqwdxggicc") - .withContainerId("xqhuexm") - .withReady(true) - .withStarted(true) - .withRestartCount(713697907); - model = BinaryData.fromObject(model).toObject(ReplicaContainer.class); - Assertions.assertEquals("msweypqwdxggicc", model.name()); - Assertions.assertEquals("xqhuexm", model.containerId()); - Assertions.assertEquals(true, model.ready()); - Assertions.assertEquals(true, model.started()); - Assertions.assertEquals(713697907, model.restartCount()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaInnerTests.java deleted file mode 100644 index 6a07e38d04418..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaInnerTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.ReplicaInner; -import com.azure.resourcemanager.appcontainers.models.ReplicaContainer; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ReplicaInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReplicaInner model = BinaryData.fromString( - "{\"properties\":{\"createdTime\":\"2021-12-09T17:34:33Z\",\"runningState\":\"Running\",\"runningStateDetails\":\"sbvdkcrodtjinfw\",\"containers\":[{\"name\":\"tkacj\",\"containerId\":\"f\",\"ready\":false,\"started\":true,\"restartCount\":1731932488,\"runningState\":\"Terminated\",\"runningStateDetails\":\"fpagaowpulp\",\"logStreamEndpoint\":\"lyls\",\"execEndpoint\":\"k\"},{\"name\":\"nsj\",\"containerId\":\"vti\",\"ready\":true,\"started\":false,\"restartCount\":300652105,\"runningState\":\"Waiting\",\"runningStateDetails\":\"psbzkfzbeyvpn\",\"logStreamEndpoint\":\"cvinvkjjxdxrbuuk\",\"execEndpoint\":\"lewyhmlwpaz\"}],\"initContainers\":[{\"name\":\"fn\",\"containerId\":\"kwyfzqwhxxbuyqax\",\"ready\":false,\"started\":true,\"restartCount\":1560492687,\"runningState\":\"Waiting\",\"runningStateDetails\":\"o\",\"logStreamEndpoint\":\"or\",\"execEndpoint\":\"lt\"},{\"name\":\"mncwsobqwcsdb\",\"containerId\":\"dcfhucqdpf\",\"ready\":false,\"started\":false,\"restartCount\":665760554,\"runningState\":\"Running\",\"runningStateDetails\":\"nvxbvt\",\"logStreamEndpoint\":\"dut\",\"execEndpoint\":\"ormrlxqtvcofudfl\"}]},\"id\":\"gj\",\"name\":\"bgdknnqv\",\"type\":\"aznqntoru\"}") - .toObject(ReplicaInner.class); - Assertions.assertEquals("tkacj", model.containers().get(0).name()); - Assertions.assertEquals("f", model.containers().get(0).containerId()); - Assertions.assertEquals(false, model.containers().get(0).ready()); - Assertions.assertEquals(true, model.containers().get(0).started()); - Assertions.assertEquals(1731932488, model.containers().get(0).restartCount()); - Assertions.assertEquals("fn", model.initContainers().get(0).name()); - Assertions.assertEquals("kwyfzqwhxxbuyqax", model.initContainers().get(0).containerId()); - Assertions.assertEquals(false, model.initContainers().get(0).ready()); - Assertions.assertEquals(true, model.initContainers().get(0).started()); - Assertions.assertEquals(1560492687, model.initContainers().get(0).restartCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReplicaInner model = new ReplicaInner() - .withContainers(Arrays.asList( - new ReplicaContainer().withName("tkacj") - .withContainerId("f") - .withReady(false) - .withStarted(true) - .withRestartCount(1731932488), - new ReplicaContainer().withName("nsj") - .withContainerId("vti") - .withReady(true) - .withStarted(false) - .withRestartCount(300652105))) - .withInitContainers(Arrays.asList( - new ReplicaContainer().withName("fn") - .withContainerId("kwyfzqwhxxbuyqax") - .withReady(false) - .withStarted(true) - .withRestartCount(1560492687), - new ReplicaContainer().withName("mncwsobqwcsdb") - .withContainerId("dcfhucqdpf") - .withReady(false) - .withStarted(false) - .withRestartCount(665760554))); - model = BinaryData.fromObject(model).toObject(ReplicaInner.class); - Assertions.assertEquals("tkacj", model.containers().get(0).name()); - Assertions.assertEquals("f", model.containers().get(0).containerId()); - Assertions.assertEquals(false, model.containers().get(0).ready()); - Assertions.assertEquals(true, model.containers().get(0).started()); - Assertions.assertEquals(1731932488, model.containers().get(0).restartCount()); - Assertions.assertEquals("fn", model.initContainers().get(0).name()); - Assertions.assertEquals("kwyfzqwhxxbuyqax", model.initContainers().get(0).containerId()); - Assertions.assertEquals(false, model.initContainers().get(0).ready()); - Assertions.assertEquals(true, model.initContainers().get(0).started()); - Assertions.assertEquals(1560492687, model.initContainers().get(0).restartCount()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaPropertiesTests.java deleted file mode 100644 index 6762712a551ee..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaPropertiesTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.ReplicaProperties; -import com.azure.resourcemanager.appcontainers.models.ReplicaContainer; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ReplicaPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReplicaProperties model = BinaryData.fromString( - "{\"createdTime\":\"2021-11-12T17:58:44Z\",\"runningState\":\"Running\",\"runningStateDetails\":\"mkycgra\",\"containers\":[{\"name\":\"etaebu\",\"containerId\":\"vdmovsmzlxwabm\",\"ready\":false,\"started\":false,\"restartCount\":1947677125,\"runningState\":\"Terminated\",\"runningStateDetails\":\"puqujmqlgkfbtn\",\"logStreamEndpoint\":\"aongbj\",\"execEndpoint\":\"tujitcjedft\"},{\"name\":\"ae\",\"containerId\":\"ojvdcpzfoqo\",\"ready\":false,\"started\":true,\"restartCount\":795659639,\"runningState\":\"Terminated\",\"runningStateDetails\":\"szufoxciqopidoa\",\"logStreamEndpoint\":\"iodhkhazxkhnz\",\"execEndpoint\":\"nlwntoe\"},{\"name\":\"kdwbwhkszz\",\"containerId\":\"rvexztvb\",\"ready\":true,\"started\":false,\"restartCount\":2061865087,\"runningState\":\"Waiting\",\"runningStateDetails\":\"koowtl\",\"logStreamEndpoint\":\"guxawqaldsyuuxi\",\"execEndpoint\":\"rqf\"}],\"initContainers\":[{\"name\":\"znkbykutwpfhpagm\",\"containerId\":\"skdsnfdsdoakg\",\"ready\":false,\"started\":false,\"restartCount\":551895521,\"runningState\":\"Terminated\",\"runningStateDetails\":\"l\",\"logStreamEndpoint\":\"wpusdsttwvogv\",\"execEndpoint\":\"ejdcngqqmoakuf\"},{\"name\":\"jzrwrdgrtw\",\"containerId\":\"nuuzkopbm\",\"ready\":false,\"started\":true,\"restartCount\":123182613,\"runningState\":\"Waiting\",\"runningStateDetails\":\"hziuiefozbhdms\",\"logStreamEndpoint\":\"mzqhoftrmaequi\",\"execEndpoint\":\"xicslfao\"},{\"name\":\"piyylhalnswhccsp\",\"containerId\":\"aivwitqscywu\",\"ready\":true,\"started\":false,\"restartCount\":94422109,\"runningState\":\"Waiting\",\"runningStateDetails\":\"wem\",\"logStreamEndpoint\":\"i\",\"execEndpoint\":\"brgz\"}]}") - .toObject(ReplicaProperties.class); - Assertions.assertEquals("etaebu", model.containers().get(0).name()); - Assertions.assertEquals("vdmovsmzlxwabm", model.containers().get(0).containerId()); - Assertions.assertEquals(false, model.containers().get(0).ready()); - Assertions.assertEquals(false, model.containers().get(0).started()); - Assertions.assertEquals(1947677125, model.containers().get(0).restartCount()); - Assertions.assertEquals("znkbykutwpfhpagm", model.initContainers().get(0).name()); - Assertions.assertEquals("skdsnfdsdoakg", model.initContainers().get(0).containerId()); - Assertions.assertEquals(false, model.initContainers().get(0).ready()); - Assertions.assertEquals(false, model.initContainers().get(0).started()); - Assertions.assertEquals(551895521, model.initContainers().get(0).restartCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReplicaProperties model = new ReplicaProperties() - .withContainers(Arrays.asList( - new ReplicaContainer().withName("etaebu") - .withContainerId("vdmovsmzlxwabm") - .withReady(false) - .withStarted(false) - .withRestartCount(1947677125), - new ReplicaContainer().withName("ae") - .withContainerId("ojvdcpzfoqo") - .withReady(false) - .withStarted(true) - .withRestartCount(795659639), - new ReplicaContainer().withName("kdwbwhkszz") - .withContainerId("rvexztvb") - .withReady(true) - .withStarted(false) - .withRestartCount(2061865087))) - .withInitContainers(Arrays.asList( - new ReplicaContainer().withName("znkbykutwpfhpagm") - .withContainerId("skdsnfdsdoakg") - .withReady(false) - .withStarted(false) - .withRestartCount(551895521), - new ReplicaContainer().withName("jzrwrdgrtw") - .withContainerId("nuuzkopbm") - .withReady(false) - .withStarted(true) - .withRestartCount(123182613), - new ReplicaContainer().withName("piyylhalnswhccsp") - .withContainerId("aivwitqscywu") - .withReady(true) - .withStarted(false) - .withRestartCount(94422109))); - model = BinaryData.fromObject(model).toObject(ReplicaProperties.class); - Assertions.assertEquals("etaebu", model.containers().get(0).name()); - Assertions.assertEquals("vdmovsmzlxwabm", model.containers().get(0).containerId()); - Assertions.assertEquals(false, model.containers().get(0).ready()); - Assertions.assertEquals(false, model.containers().get(0).started()); - Assertions.assertEquals(1947677125, model.containers().get(0).restartCount()); - Assertions.assertEquals("znkbykutwpfhpagm", model.initContainers().get(0).name()); - Assertions.assertEquals("skdsnfdsdoakg", model.initContainers().get(0).containerId()); - Assertions.assertEquals(false, model.initContainers().get(0).ready()); - Assertions.assertEquals(false, model.initContainers().get(0).started()); - Assertions.assertEquals(551895521, model.initContainers().get(0).restartCount()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ResourceProvidersGetCustomDomainVerificationIdWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ResourceProvidersGetCustomDomainVerificationIdWithResponseMockTests.java deleted file mode 100644 index 6103b708b836b..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ResourceProvidersGetCustomDomainVerificationIdWithResponseMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ResourceProvidersGetCustomDomainVerificationIdWithResponseMockTests { - @Test - public void testGetCustomDomainVerificationIdWithResponse() throws Exception { - String responseStr = "\"utrpbr\""; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - String response = manager.resourceProviders() - .getCustomDomainVerificationIdWithResponse(com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("utrpbr", response); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ResourceProvidersJobExecutionWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ResourceProvidersJobExecutionWithResponseMockTests.java deleted file mode 100644 index 33d6f966d9e2e..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ResourceProvidersJobExecutionWithResponseMockTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.JobExecution; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ResourceProvidersJobExecutionWithResponseMockTests { - @Test - public void testJobExecutionWithResponse() throws Exception { - String responseStr - = "{\"name\":\"fmvlihcvjdrqc\",\"id\":\"idhftu\",\"type\":\"hdxlw\",\"properties\":{\"status\":\"Running\",\"startTime\":\"2021-02-13T08:09:39Z\",\"endTime\":\"2021-03-15T14:07:07Z\",\"template\":{\"containers\":[{\"image\":\"yixhafratqxmb\",\"name\":\"oum\",\"command\":[\"valqjrhuzgfxo\"],\"args\":[\"pusllywpv\",\"iotzbpdbollgryfq\",\"uasigr\"],\"env\":[{},{},{},{}],\"resources\":{}},{\"image\":\"nequy\",\"name\":\"jboq\",\"command\":[\"tqjkqevad\",\"mmwiuawvcmjz\",\"xiid\",\"scz\"],\"args\":[\"s\",\"oqiqazugamx\",\"krrcoiisbamnpp\",\"cekuz\"],\"env\":[{},{},{},{}],\"resources\":{}}],\"initContainers\":[{\"image\":\"xyfukzxuizhyhn\",\"name\":\"kpetiarxq\",\"command\":[\"xdukecpxd\",\"zvdhctmmkosz\",\"dblnsntrp\",\"aqkiofkb\"],\"args\":[\"hklbnldpvcbh\",\"ezyquw\"],\"env\":[{},{},{},{}],\"resources\":{}}]}}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - JobExecution response = manager.resourceProviders() - .jobExecutionWithResponse("swzsnuyemlowuo", "hlxlnwyrmou", "blgmokzkltrfowtd", - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("fmvlihcvjdrqc", response.name()); - Assertions.assertEquals("idhftu", response.id()); - Assertions.assertEquals("hdxlw", response.type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-13T08:09:39Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-15T14:07:07Z"), response.endTime()); - Assertions.assertEquals("yixhafratqxmb", response.template().containers().get(0).image()); - Assertions.assertEquals("oum", response.template().containers().get(0).name()); - Assertions.assertEquals("valqjrhuzgfxo", response.template().containers().get(0).command().get(0)); - Assertions.assertEquals("pusllywpv", response.template().containers().get(0).args().get(0)); - Assertions.assertEquals("xyfukzxuizhyhn", response.template().initContainers().get(0).image()); - Assertions.assertEquals("kpetiarxq", response.template().initContainers().get(0).name()); - Assertions.assertEquals("xdukecpxd", response.template().initContainers().get(0).command().get(0)); - Assertions.assertEquals("hklbnldpvcbh", response.template().initContainers().get(0).args().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RevisionCollectionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RevisionCollectionTests.java deleted file mode 100644 index b71bc2896fcff..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RevisionCollectionTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.RevisionInner; -import com.azure.resourcemanager.appcontainers.models.RevisionCollection; -import java.util.Arrays; - -public final class RevisionCollectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RevisionCollection model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"createdTime\":\"2021-03-07T12:12:41Z\",\"lastActiveTime\":\"2021-11-23T00:36:56Z\",\"fqdn\":\"cdpu\",\"template\":{\"revisionSuffix\":\"g\",\"terminationGracePeriodSeconds\":359022541227333751,\"initContainers\":[{},{}],\"containers\":[{},{},{}],\"scale\":{\"minReplicas\":1095888431,\"maxReplicas\":1347586165,\"rules\":[{},{}]},\"volumes\":[{},{},{},{}],\"serviceBinds\":[{},{}]},\"active\":false,\"replicas\":706339919,\"trafficWeight\":1505312764,\"provisioningError\":\"kdmtncvokotll\",\"healthState\":\"Unhealthy\",\"provisioningState\":\"Deprovisioning\",\"runningState\":\"Running\"},\"id\":\"cogjltdtbn\",\"name\":\"hadoocrk\",\"type\":\"cikhnv\"},{\"properties\":{\"createdTime\":\"2021-11-15T20:00:26Z\",\"lastActiveTime\":\"2021-05-20T03:12:36Z\",\"fqdn\":\"queziky\",\"template\":{\"revisionSuffix\":\"xkalla\",\"terminationGracePeriodSeconds\":8033658748454090244,\"initContainers\":[{},{},{}],\"containers\":[{},{},{}],\"scale\":{\"minReplicas\":1103817240,\"maxReplicas\":834190026,\"rules\":[{}]},\"volumes\":[{}],\"serviceBinds\":[{},{}]},\"active\":false,\"replicas\":2028866606,\"trafficWeight\":980473752,\"provisioningError\":\"yrnxxmueedn\",\"healthState\":\"None\",\"provisioningState\":\"Deprovisioned\",\"runningState\":\"Unknown\"},\"id\":\"qqtch\",\"name\":\"alm\",\"type\":\"mtdaa\"},{\"properties\":{\"createdTime\":\"2021-03-18T16:40:33Z\",\"lastActiveTime\":\"2021-06-10T20:03:46Z\",\"fqdn\":\"piohgwxrtfu\",\"template\":{\"revisionSuffix\":\"pxgy\",\"terminationGracePeriodSeconds\":2498438211029299669,\"initContainers\":[{},{},{},{}],\"containers\":[{},{},{},{}],\"scale\":{\"minReplicas\":812348156,\"maxReplicas\":2088277848,\"rules\":[{}]},\"volumes\":[{}],\"serviceBinds\":[{},{},{}]},\"active\":false,\"replicas\":261614569,\"trafficWeight\":1772217773,\"provisioningError\":\"jhfjxwm\",\"healthState\":\"Unhealthy\",\"provisioningState\":\"Provisioned\",\"runningState\":\"Failed\"},\"id\":\"eyfkzikfja\",\"name\":\"n\",\"type\":\"a\"}],\"nextLink\":\"xwczelpcire\"}") - .toObject(RevisionCollection.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RevisionCollection model = new RevisionCollection() - .withValue(Arrays.asList(new RevisionInner(), new RevisionInner(), new RevisionInner())); - model = BinaryData.fromObject(model).toObject(RevisionCollection.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ServiceBindTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ServiceBindTests.java deleted file mode 100644 index 362df42d40746..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ServiceBindTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ServiceBind; -import org.junit.jupiter.api.Assertions; - -public final class ServiceBindTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceBind model = BinaryData.fromString("{\"serviceId\":\"ndsytgadg\",\"name\":\"aeaeneqnzarrw\"}") - .toObject(ServiceBind.class); - Assertions.assertEquals("ndsytgadg", model.serviceId()); - Assertions.assertEquals("aeaeneqnzarrw", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceBind model = new ServiceBind().withServiceId("ndsytgadg").withName("aeaeneqnzarrw"); - model = BinaryData.fromObject(model).toObject(ServiceBind.class); - Assertions.assertEquals("ndsytgadg", model.serviceId()); - Assertions.assertEquals("aeaeneqnzarrw", model.name()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ServiceTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ServiceTests.java deleted file mode 100644 index af2ea70e74638..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ServiceTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.Service; -import org.junit.jupiter.api.Assertions; - -public final class ServiceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Service model = BinaryData.fromString("{\"type\":\"aln\"}").toObject(Service.class); - Assertions.assertEquals("aln", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Service model = new Service().withType("aln"); - model = BinaryData.fromObject(model).toObject(Service.class); - Assertions.assertEquals("aln", model.type()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/TrafficWeightTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/TrafficWeightTests.java deleted file mode 100644 index 7fad8eaa071cb..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/TrafficWeightTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.TrafficWeight; -import org.junit.jupiter.api.Assertions; - -public final class TrafficWeightTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TrafficWeight model = BinaryData - .fromString("{\"revisionName\":\"v\",\"weight\":2103137599,\"latestRevision\":true,\"label\":\"gibtnm\"}") - .toObject(TrafficWeight.class); - Assertions.assertEquals("v", model.revisionName()); - Assertions.assertEquals(2103137599, model.weight()); - Assertions.assertEquals(true, model.latestRevision()); - Assertions.assertEquals("gibtnm", model.label()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TrafficWeight model = new TrafficWeight().withRevisionName("v") - .withWeight(2103137599) - .withLatestRevision(true) - .withLabel("gibtnm"); - model = BinaryData.fromObject(model).toObject(TrafficWeight.class); - Assertions.assertEquals("v", model.revisionName()); - Assertions.assertEquals(2103137599, model.weight()); - Assertions.assertEquals(true, model.latestRevision()); - Assertions.assertEquals("gibtnm", model.label()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/UsageInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/UsageInnerTests.java deleted file mode 100644 index de50b3f017e3c..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/UsageInnerTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.UsageInner; -import com.azure.resourcemanager.appcontainers.models.UsageName; -import org.junit.jupiter.api.Assertions; - -public final class UsageInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UsageInner model = BinaryData.fromString( - "{\"currentValue\":78.008675,\"limit\":1.3999999,\"name\":{\"value\":\"qqxeyskon\",\"localizedValue\":\"inkfkbgbz\"}}") - .toObject(UsageInner.class); - Assertions.assertEquals(78.008675f, model.currentValue()); - Assertions.assertEquals(1.3999999f, model.limit()); - Assertions.assertEquals("qqxeyskon", model.name().value()); - Assertions.assertEquals("inkfkbgbz", model.name().localizedValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UsageInner model = new UsageInner().withCurrentValue(78.008675f) - .withLimit(1.3999999f) - .withName(new UsageName().withValue("qqxeyskon").withLocalizedValue("inkfkbgbz")); - model = BinaryData.fromObject(model).toObject(UsageInner.class); - Assertions.assertEquals(78.008675f, model.currentValue()); - Assertions.assertEquals(1.3999999f, model.limit()); - Assertions.assertEquals("qqxeyskon", model.name().value()); - Assertions.assertEquals("inkfkbgbz", model.name().localizedValue()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/UsageNameTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/UsageNameTests.java deleted file mode 100644 index 10e19b84c8ec9..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/UsageNameTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.UsageName; -import org.junit.jupiter.api.Assertions; - -public final class UsageNameTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UsageName model = BinaryData.fromString("{\"value\":\"wxeqocljmygvkzqk\",\"localizedValue\":\"eokbze\"}") - .toObject(UsageName.class); - Assertions.assertEquals("wxeqocljmygvkzqk", model.value()); - Assertions.assertEquals("eokbze", model.localizedValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UsageName model = new UsageName().withValue("wxeqocljmygvkzqk").withLocalizedValue("eokbze"); - model = BinaryData.fromObject(model).toObject(UsageName.class); - Assertions.assertEquals("wxeqocljmygvkzqk", model.value()); - Assertions.assertEquals("eokbze", model.localizedValue()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/UsagesListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/UsagesListMockTests.java deleted file mode 100644 index ad11bbc9e699a..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/UsagesListMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.Usage; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class UsagesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"currentValue\":80.57476,\"limit\":97.5071,\"name\":{\"value\":\"cvjqdv\",\"localizedValue\":\"kqpldrle\"}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ContainerAppsApiManager manager = ContainerAppsApiManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.usages().list("rymdwmf", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(80.57476f, response.iterator().next().currentValue()); - Assertions.assertEquals(97.5071f, response.iterator().next().limit()); - Assertions.assertEquals("cvjqdv", response.iterator().next().name().value()); - Assertions.assertEquals("kqpldrle", response.iterator().next().name().localizedValue()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/UserAssignedIdentityTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/UserAssignedIdentityTests.java deleted file mode 100644 index 8d43f6a4a28ea..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/UserAssignedIdentityTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.UserAssignedIdentity; - -public final class UserAssignedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentity model = BinaryData.fromString( - "{\"principalId\":\"5821a198-77d0-4f20-a917-c4c7536c0731\",\"clientId\":\"e53a75b9-5172-4089-ae25-0800a92e9efc\"}") - .toObject(UserAssignedIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = new UserAssignedIdentity(); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConfigurationTests.java deleted file mode 100644 index 1a0028f8166c4..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConfigurationTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.VnetConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class VnetConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VnetConfiguration model = BinaryData.fromString( - "{\"internal\":true,\"infrastructureSubnetId\":\"vv\",\"dockerBridgeCidr\":\"nk\",\"platformReservedCidr\":\"hqyikvy\",\"platformReservedDnsIP\":\"uyav\"}") - .toObject(VnetConfiguration.class); - Assertions.assertEquals(true, model.internal()); - Assertions.assertEquals("vv", model.infrastructureSubnetId()); - Assertions.assertEquals("nk", model.dockerBridgeCidr()); - Assertions.assertEquals("hqyikvy", model.platformReservedCidr()); - Assertions.assertEquals("uyav", model.platformReservedDnsIp()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VnetConfiguration model = new VnetConfiguration().withInternal(true) - .withInfrastructureSubnetId("vv") - .withDockerBridgeCidr("nk") - .withPlatformReservedCidr("hqyikvy") - .withPlatformReservedDnsIp("uyav"); - model = BinaryData.fromObject(model).toObject(VnetConfiguration.class); - Assertions.assertEquals(true, model.internal()); - Assertions.assertEquals("vv", model.infrastructureSubnetId()); - Assertions.assertEquals("nk", model.dockerBridgeCidr()); - Assertions.assertEquals("hqyikvy", model.platformReservedCidr()); - Assertions.assertEquals("uyav", model.platformReservedDnsIp()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VolumeMountTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VolumeMountTests.java deleted file mode 100644 index cb866e5a01a5f..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VolumeMountTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.VolumeMount; -import org.junit.jupiter.api.Assertions; - -public final class VolumeMountTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VolumeMount model - = BinaryData.fromString("{\"volumeName\":\"uoujmkcjhwqy\",\"mountPath\":\"r\",\"subPath\":\"n\"}") - .toObject(VolumeMount.class); - Assertions.assertEquals("uoujmkcjhwqy", model.volumeName()); - Assertions.assertEquals("r", model.mountPath()); - Assertions.assertEquals("n", model.subPath()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VolumeMount model = new VolumeMount().withVolumeName("uoujmkcjhwqy").withMountPath("r").withSubPath("n"); - model = BinaryData.fromObject(model).toObject(VolumeMount.class); - Assertions.assertEquals("uoujmkcjhwqy", model.volumeName()); - Assertions.assertEquals("r", model.mountPath()); - Assertions.assertEquals("n", model.subPath()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileStatesCollectionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileStatesCollectionTests.java deleted file mode 100644 index 00e408ce87c13..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileStatesCollectionTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.WorkloadProfileStatesInner; -import com.azure.resourcemanager.appcontainers.models.WorkloadProfileStatesCollection; -import com.azure.resourcemanager.appcontainers.models.WorkloadProfileStatesProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadProfileStatesCollectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadProfileStatesCollection model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"minimumCount\":125361630,\"maximumCount\":325946802,\"currentCount\":808258027},\"id\":\"wpgdak\",\"name\":\"hzyvlixqnrkcx\",\"type\":\"jibnxmysu\"},{\"properties\":{\"minimumCount\":1250131057,\"maximumCount\":1365374514,\"currentCount\":342142930},\"id\":\"wijpsttexoqqpwc\",\"name\":\"yufmhruncuwmq\",\"type\":\"pkcdqzhlct\"},{\"properties\":{\"minimumCount\":1078377836,\"maximumCount\":538765688,\"currentCount\":801241331},\"id\":\"pchrqbn\",\"name\":\"jrcg\",\"type\":\"gydcw\"}],\"nextLink\":\"xjumvq\"}") - .toObject(WorkloadProfileStatesCollection.class); - Assertions.assertEquals(125361630, model.value().get(0).properties().minimumCount()); - Assertions.assertEquals(325946802, model.value().get(0).properties().maximumCount()); - Assertions.assertEquals(808258027, model.value().get(0).properties().currentCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadProfileStatesCollection model = new WorkloadProfileStatesCollection().withValue(Arrays.asList( - new WorkloadProfileStatesInner() - .withProperties(new WorkloadProfileStatesProperties().withMinimumCount(125361630) - .withMaximumCount(325946802) - .withCurrentCount(808258027)), - new WorkloadProfileStatesInner() - .withProperties(new WorkloadProfileStatesProperties().withMinimumCount(1250131057) - .withMaximumCount(1365374514) - .withCurrentCount(342142930)), - new WorkloadProfileStatesInner() - .withProperties(new WorkloadProfileStatesProperties().withMinimumCount(1078377836) - .withMaximumCount(538765688) - .withCurrentCount(801241331)))); - model = BinaryData.fromObject(model).toObject(WorkloadProfileStatesCollection.class); - Assertions.assertEquals(125361630, model.value().get(0).properties().minimumCount()); - Assertions.assertEquals(325946802, model.value().get(0).properties().maximumCount()); - Assertions.assertEquals(808258027, model.value().get(0).properties().currentCount()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileStatesInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileStatesInnerTests.java deleted file mode 100644 index ab471eacec73d..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileStatesInnerTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.WorkloadProfileStatesInner; -import com.azure.resourcemanager.appcontainers.models.WorkloadProfileStatesProperties; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadProfileStatesInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadProfileStatesInner model = BinaryData.fromString( - "{\"properties\":{\"minimumCount\":733872098,\"maximumCount\":181294530,\"currentCount\":396602814},\"id\":\"ouau\",\"name\":\"rjtloq\",\"type\":\"fuojrngif\"}") - .toObject(WorkloadProfileStatesInner.class); - Assertions.assertEquals(733872098, model.properties().minimumCount()); - Assertions.assertEquals(181294530, model.properties().maximumCount()); - Assertions.assertEquals(396602814, model.properties().currentCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadProfileStatesInner model = new WorkloadProfileStatesInner() - .withProperties(new WorkloadProfileStatesProperties().withMinimumCount(733872098) - .withMaximumCount(181294530) - .withCurrentCount(396602814)); - model = BinaryData.fromObject(model).toObject(WorkloadProfileStatesInner.class); - Assertions.assertEquals(733872098, model.properties().minimumCount()); - Assertions.assertEquals(181294530, model.properties().maximumCount()); - Assertions.assertEquals(396602814, model.properties().currentCount()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileStatesPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileStatesPropertiesTests.java deleted file mode 100644 index 4f43dc384886f..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileStatesPropertiesTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.WorkloadProfileStatesProperties; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadProfileStatesPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadProfileStatesProperties model = BinaryData - .fromString("{\"minimumCount\":193344927,\"maximumCount\":2039990607,\"currentCount\":1842642996}") - .toObject(WorkloadProfileStatesProperties.class); - Assertions.assertEquals(193344927, model.minimumCount()); - Assertions.assertEquals(2039990607, model.maximumCount()); - Assertions.assertEquals(1842642996, model.currentCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadProfileStatesProperties model = new WorkloadProfileStatesProperties().withMinimumCount(193344927) - .withMaximumCount(2039990607) - .withCurrentCount(1842642996); - model = BinaryData.fromObject(model).toObject(WorkloadProfileStatesProperties.class); - Assertions.assertEquals(193344927, model.minimumCount()); - Assertions.assertEquals(2039990607, model.maximumCount()); - Assertions.assertEquals(1842642996, model.currentCount()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileTests.java deleted file mode 100644 index 45764098640a4..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.WorkloadProfile; -import org.junit.jupiter.api.Assertions; - -public final class WorkloadProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkloadProfile model = BinaryData.fromString( - "{\"name\":\"u\",\"workloadProfileType\":\"otppnv\",\"minimumCount\":827884246,\"maximumCount\":1931037183}") - .toObject(WorkloadProfile.class); - Assertions.assertEquals("u", model.name()); - Assertions.assertEquals("otppnv", model.workloadProfileType()); - Assertions.assertEquals(827884246, model.minimumCount()); - Assertions.assertEquals(1931037183, model.maximumCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadProfile model = new WorkloadProfile().withName("u") - .withWorkloadProfileType("otppnv") - .withMinimumCount(827884246) - .withMaximumCount(1931037183); - model = BinaryData.fromObject(model).toObject(WorkloadProfile.class); - Assertions.assertEquals("u", model.name()); - Assertions.assertEquals("otppnv", model.workloadProfileType()); - Assertions.assertEquals(827884246, model.minimumCount()); - Assertions.assertEquals(1931037183, model.maximumCount()); - } -}