diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 5bef20bd1c1f..44d022c62e53 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -410,7 +410,7 @@ com.azure.resourcemanager:azure-resourcemanager-mobilenetwork;1.3.1;1.4.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-azureadexternalidentities;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-dashboard;1.2.0;1.3.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-servicelinker;1.0.0;1.1.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-appcontainers;1.2.0;1.3.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-appcontainers;1.2.0;1.3.0 com.azure.resourcemanager:azure-resourcemanager-scvmm;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-hardwaresecuritymodules;1.1.0;1.2.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-workloads;1.1.0;1.2.0-beta.1 diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/CHANGELOG.md b/sdk/appcontainers/azure-resourcemanager-appcontainers/CHANGELOG.md index 1bd1f15c0188..a170b97544e6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/CHANGELOG.md +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/CHANGELOG.md @@ -1,14 +1,1102 @@ # Release History -## 1.3.0-beta.1 (Unreleased) +## 1.3.0 (2026-09-10) + +- 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 api-version 2026-07-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +### Breaking Changes + +#### `models.PrivateEndpointConnectionListResult` was removed + +#### `models.WorkloadProfileStatesCollection` was removed + +#### `models.DaprComponentsCollection` was removed + +#### `models.ManagedCertificateCollection` was removed + +#### `models.AvailableWorkloadProfilesCollection` was removed + +#### `models.JobsCollection` was removed + +#### `models.ListUsagesResult` was removed + +#### `models.ContainerAppCollection` was removed + +#### `models.ConnectedEnvironmentCollection` was removed + +#### `models.CertificateCollection` was removed + +#### `models.WorkflowEnvelopeCollection` was removed + +#### `models.JavaComponentsCollection` was removed + +#### `models.PrivateLinkResourceListResult` was removed + +#### `models.AvailableOperations` was removed + +#### `models.RevisionCollection` was removed + +#### `models.HttpRouteConfigCollection` was removed + +#### `models.MaintenanceConfigurationCollection` was removed + +#### `models.SourceControlCollection` was removed + +#### `models.ManagedEnvironmentsCollection` was removed + +#### `models.AuthConfigCollection` was removed + +#### `models.SessionPoolCollection` was removed + +#### `models.SessionContainer` was modified + +* `validate()` was removed + +#### `models.JobConfigurationScheduleTriggerConfig` was modified + +* `validate()` was removed + +#### `models.IngressConfiguration` was modified + +* `validate()` was removed + +#### `models.ManagedCertificatePatch` was modified + +* `validate()` was removed + +#### `models.HttpRouteProvisioningErrors` was modified + +* `HttpRouteProvisioningErrors()` was changed to private access +* `validate()` was removed + +#### `models.Runtime` was modified + +* `validate()` was removed + +#### `models.ServiceBind` was modified + +* `validate()` was removed + +#### `models.SessionPoolUpdatableProperties` was modified + +* `validate()` was removed + +#### `models.JavaComponentPropertiesScale` was modified + +* `validate()` was removed + +#### `models.ScaleConfiguration` was modified + +* `validate()` was removed + +#### `models.Secret` was modified + +* `validate()` was removed + +#### `models.AzureActiveDirectoryValidation` was modified + +* `validate()` was removed + +#### `models.HttpRouteConfigProperties` was modified + +* `validate()` was removed + +#### `models.LoginScopes` was modified + +* `validate()` was removed + +#### `models.AvailableWorkloadProfileProperties` was modified + +* `AvailableWorkloadProfileProperties()` was changed to private access +* `withCategory(java.lang.String)` was removed +* `withGpus(java.lang.Integer)` was removed +* `withMemoryGiB(java.lang.Integer)` was removed +* `validate()` was removed +* `withCores(java.lang.Integer)` was removed +* `withApplicability(models.Applicability)` was removed +* `withDisplayName(java.lang.String)` was removed + +#### `models.HttpSettings` was modified + +* `validate()` was removed + +#### `models.CertificateKeyVaultProperties` was modified + +* `validate()` was removed + +#### `models.Google` was modified + +* `validate()` was removed + +#### `models.AllowedPrincipals` was modified + +* `validate()` was removed + +#### `models.ConnectedEnvironmentPatchResource` was modified + +* `validate()` was removed + +#### `models.ContainerAppProbeHttpGetHttpHeadersItem` was modified + +* `validate()` was removed + +#### `models.KedaConfiguration` was modified + +* `validate()` was removed + +#### `models.SpringBootAdminComponent` was modified + +* `validate()` was removed + +#### `models.DiagnosticsDefinition` was modified + +* `DiagnosticsDefinition()` was changed to private access +* `withSupportTopicList(java.util.List)` was removed +* `withAnalysisTypes(java.util.List)` was removed +* `validate()` was removed + +#### `models.PrivateEndpoint` was modified + +* `validate()` was removed + +#### `models.JavaComponentServiceBind` was modified + +* `validate()` was removed + +#### `models.GlobalValidation` was modified + +* `validate()` was removed + +#### `models.AzureActiveDirectoryLogin` was modified + +* `validate()` was removed + +#### `models.WorkloadProfile` was modified + +* `validate()` was removed + +#### `models.InitContainer` was modified + +* `validate()` was removed + +#### `models.EnvironmentVar` was modified + +* `validate()` was removed + +#### `models.CertificatePatch` was modified + +* `validate()` was removed + +#### `models.UsageName` was modified + +* `UsageName()` was changed to private access +* `withValue(java.lang.String)` was removed +* `validate()` was removed +* `withLocalizedValue(java.lang.String)` was removed + +#### `models.TrafficWeight` was modified + +* `validate()` was removed + +#### `models.JobScale` was modified + +* `validate()` was removed + +#### `models.IpSecurityRestrictionRule` was modified + +* `validate()` was removed + +#### `models.AppleRegistration` was modified + +* `validate()` was removed + +#### `models.QueueScaleRule` was modified + +* `validate()` was removed + +#### `models.CheckNameAvailabilityRequest` was modified + +* `validate()` was removed + +#### `models.OpenIdConnectLogin` was modified + +* `validate()` was removed + +#### `models.UserAssignedIdentity` was modified + +* `java.util.UUID principalId()` -> `java.lang.String principalId()` +* `java.util.UUID clientId()` -> `java.lang.String clientId()` +* `validate()` was removed + +#### `models.SecretKeyVaultProperties` was modified + +* `validate()` was removed + +#### `models.JavaComponentConfigurationProperty` was modified + +* `validate()` was removed + +#### `models.ConnectedEnvironmentStorageProperties` was modified + +* `validate()` was removed + +#### `models.AppRegistration` was modified + +* `validate()` was removed + +#### `models.ContainerAppSecret` was modified + +* `ContainerAppSecret()` was changed to private access +* `validate()` was removed + +#### `models.SpringCloudConfigComponent` was modified + +* `validate()` was removed + +#### `models.Service` was modified + +* `validate()` was removed + +#### `models.DaprAppHealth` was modified + +* `validate()` was removed + +#### `models.BillingMeterProperties` was modified + +* `BillingMeterProperties()` was changed to private access +* `withCategory(java.lang.String)` was removed +* `validate()` was removed +* `withMeterType(java.lang.String)` was removed +* `withDisplayName(java.lang.String)` was removed + +#### `models.ManagedEnvironmentStorageProperties` was modified + +* `validate()` was removed + +#### `models.OpenIdConnectConfig` was modified + +* `validate()` was removed + +#### `models.BillingMeter` was modified + +* `BillingMeter()` was changed to private access +* `validate()` was removed +* `withLocation(java.lang.String)` was removed +* `withProperties(models.BillingMeterProperties)` was removed + +#### `models.GithubActionConfiguration` was modified + +* `validate()` was removed + +#### `models.JobPatchPropertiesProperties` was modified + +* `validate()` was removed + +#### `models.AllowedAudiencesValidation` was modified + +* `validate()` was removed + +#### `models.LifecycleConfiguration` was modified + +* `validate()` was removed + +#### `models.ScaleRule` was modified + +* `validate()` was removed + +#### `models.ClientRegistration` was modified + +* `validate()` was removed + +#### `models.WorkflowEnvelopeProperties` was modified + +* `WorkflowEnvelopeProperties()` was changed to private access +* `validate()` was removed +* `withHealth(models.WorkflowHealth)` was removed +* `withFlowState(models.WorkflowState)` was removed +* `withFiles(java.lang.Object)` was removed + +#### `models.CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem` was modified + +* `CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem()` was changed to private access +* `validate()` was removed + +#### `models.ForwardProxy` was modified + +* `validate()` was removed + +#### `models.IdentityProviders` was modified + +* `validate()` was removed + +#### `models.ContainerAppProbe` was modified + +* `validate()` was removed + +#### `models.ScaleRuleAuth` was modified + +* `validate()` was removed + +#### `models.JobConfiguration` was modified + +* `validate()` was removed + +#### `models.TcpScaleRule` was modified + +* `validate()` was removed + +#### `models.SecretVolumeItem` was modified + +* `validate()` was removed + +#### `models.OperationDisplay` was modified + +* `OperationDisplay()` was changed to private access +* `withDescription(java.lang.String)` was removed +* `withResource(java.lang.String)` was removed +* `withProvider(java.lang.String)` was removed +* `validate()` was removed +* `withOperation(java.lang.String)` was removed + +#### `models.JobConfigurationManualTriggerConfig` was modified + +* `validate()` was removed + +#### `models.JobConfigurationEventTriggerConfig` was modified + +* `validate()` was removed + +#### `models.Scale` was modified + +* `validate()` was removed + +#### `models.SessionIngress` was modified + +* `validate()` was removed + +#### `models.CustomDomain` was modified + +* `validate()` was removed + +#### `models.IngressStickySessions` was modified + +* `validate()` was removed + +#### `models.TokenStore` was modified + +* `validate()` was removed + +#### `models.ErrorEntity` was modified + +* `ErrorEntity()` was changed to private access +* `withParameters(java.util.List)` was removed +* `withTarget(java.lang.String)` was removed +* `withCode(java.lang.String)` was removed +* `withDetails(java.util.List)` was removed +* `withExtendedCode(java.lang.String)` was removed +* `withMessageTemplate(java.lang.String)` was removed +* `validate()` was removed +* `withInnerErrors(java.util.List)` was removed +* `withMessage(java.lang.String)` was removed + +#### `models.VnetConfiguration` was modified + +* `validate()` was removed + +#### `models.PrivateLinkServiceConnectionState` was modified + +* `validate()` was removed + +#### `models.WorkflowHealth` was modified + +* `WorkflowHealth()` was changed to private access +* `withError(models.ErrorEntity)` was removed +* `withState(models.WorkflowHealthState)` was removed +* `validate()` was removed + +#### `models.LogAnalyticsConfiguration` was modified + +* `validate()` was removed + +#### `models.Mtls` was modified + +* `validate()` was removed + +#### `models.NfsAzureFileProperties` was modified + +* `validate()` was removed + +#### `models.SessionContainerResources` was modified + +* `validate()` was removed + +#### `models.SessionPoolSecret` was modified + +* `validate()` was removed + +#### `models.AzureFileProperties` was modified + +* `validate()` was removed + +#### `models.AuthPlatform` was modified + +* `validate()` was removed + +#### `models.CorsPolicy` was modified + +* `validate()` was removed + +#### `models.RegistryCredentials` was modified + +* `validate()` was removed + +#### `models.HttpRouteMatch` was modified + +* `validate()` was removed + +#### `models.OpenIdConnectClientCredential` was modified + +* `validate()` was removed + +#### `models.JobTemplate` was modified + +* `validate()` was removed + +#### `models.AzureActiveDirectoryRegistration` was modified + +* `validate()` was removed + +#### `models.ManagedServiceIdentity` was modified + +* `java.util.UUID tenantId()` -> `java.lang.String tenantId()` +* `validate()` was removed +* `java.util.UUID principalId()` -> `java.lang.String principalId()` + +#### `models.DefaultAuthorizationPolicy` was modified + +* `validate()` was removed + +#### `models.DefaultErrorResponseError` was modified + +* `DefaultErrorResponseError()` was changed to private access +* `validate()` was removed + +#### `models.AzureCredentials` was modified + +* `validate()` was removed + +#### `models.WorkloadProfileStatesProperties` was modified + +* `WorkloadProfileStatesProperties()` was changed to private access +* `withMaximumCount(java.lang.Integer)` was removed +* `withCurrentCount(java.lang.Integer)` was removed +* `validate()` was removed +* `withMinimumCount(java.lang.Integer)` was removed + +#### `models.HttpScaleRule` was modified + +* `validate()` was removed + +#### `models.AzureActiveDirectory` was modified + +* `validate()` was removed + +#### `models.Login` was modified + +* `validate()` was removed + +#### `models.DiagnosticsDataApiResponse` was modified + +* `DiagnosticsDataApiResponse()` was changed to private access +* `validate()` was removed +* `withRenderingProperties(models.DiagnosticRendering)` was removed +* `withTable(models.DiagnosticDataTableResponseObject)` was removed + +#### `models.HttpRouteAction` was modified + +* `validate()` was removed + +#### `models.ManagedCertificateProperties` was modified + +* `validate()` was removed + +#### `models.JobExecutionContainer` was modified + +* `validate()` was removed + +#### `models.AzureStaticWebApps` was modified + +* `validate()` was removed + +#### `models.RuntimeJava` was modified + +* `validate()` was removed + +#### `models.DaprConfiguration` was modified + +* `validate()` was removed + +#### `models.JobPatchProperties` was modified + +* `validate()` was removed + +#### `models.AzureStaticWebAppsRegistration` was modified + +* `validate()` was removed + +#### `models.ManagedEnvironmentPropertiesPeerTrafficConfiguration` was modified + +* `validate()` was removed + +#### `models.TwitterRegistration` was modified + +* `validate()` was removed + +#### `models.EncryptionSettings` was modified + +* `validate()` was removed + +#### `models.Twitter` was modified + +* `validate()` was removed + +#### `models.ScheduledEntry` was modified + +* `validate()` was removed + +#### `models.Container` was modified + +* `validate()` was removed + +#### `models.CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo` was modified + +* `CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo()` was changed to private access +* `validate()` was removed +* `withDetails(java.util.List)` was removed + +#### `models.Facebook` was modified + +* `validate()` was removed + +#### `models.CookieExpiration` was modified + +* `validate()` was removed + +#### `models.ManagedIdentitySetting` was modified + +* `withLifecycle(models.IdentitySettingsLifeCycle)` was removed +* `models.IdentitySettingsLifeCycle lifecycle()` -> `models.SessionPoolIdentityLifeCycle lifecycle()` +* `validate()` was removed + +#### `models.CustomOpenIdConnectProvider` was modified + +* `validate()` was removed + +#### `models.CertificateProperties` was modified + +* `validate()` was removed + +#### `models.DiagnosticRendering` was modified + +* `DiagnosticRendering()` was changed to private access +* `withTitle(java.lang.String)` was removed +* `withType(java.lang.Integer)` was removed +* `withDescription(java.lang.String)` was removed +* `withIsVisible(java.lang.Boolean)` was removed +* `validate()` was removed + +#### `models.Apple` was modified + +* `validate()` was removed + +#### `models.CustomContainerTemplate` was modified + +* `validate()` was removed + +#### `models.DiagnosticSupportTopic` was modified + +* `DiagnosticSupportTopic()` was changed to private access +* `validate()` was removed + +#### `models.JwtClaimChecks` was modified + +* `validate()` was removed + +#### `models.ContainerAppProbeHttpGet` was modified + +* `validate()` was removed + +#### `models.SessionNetworkConfiguration` was modified + +* `validate()` was removed + +#### `models.JobScaleRule` was modified + +* `validate()` was removed + +#### `models.DynamicPoolConfiguration` was modified + +* `validate()` was removed + +#### `models.RegistryInfo` was modified + +* `validate()` was removed + +#### `models.ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption` was modified + +* `validate()` was removed + +#### `models.Volume` was modified + +* `validate()` was removed + +#### `models.DaprSecret` was modified + +* `DaprSecret()` was changed to private access +* `validate()` was removed + +#### `models.IdentitySettings` was modified + +* `validate()` was removed + +#### `models.DaprMetadata` was modified + +* `validate()` was removed + +#### `models.JobExecutionTemplate` was modified + +* `validate()` was removed + +#### `models.HttpRouteTarget` was modified + +* `validate()` was removed + +#### `models.DiagnosticsProperties` was modified + +* `DiagnosticsProperties()` was changed to private access +* `validate()` was removed +* `withMetadata(models.DiagnosticsDefinition)` was removed +* `withDataset(java.util.List)` was removed +* `withStatus(models.DiagnosticsStatus)` was removed +* `withDataProviderMetadata(models.DiagnosticDataProviderMetadata)` was removed + +#### `models.IngressPortMapping` was modified + +* `validate()` was removed + +#### `models.DiagnosticsStatus` was modified + +* `DiagnosticsStatus()` was changed to private access +* `withMessage(java.lang.String)` was removed +* `withStatusId(java.lang.Integer)` was removed +* `validate()` was removed + +#### `models.ReplicaContainer` was modified + +* `ReplicaContainer()` was changed to private access +* `withContainerId(java.lang.String)` was removed +* `withReady(java.lang.Boolean)` was removed +* `validate()` was removed +* `withRestartCount(java.lang.Integer)` was removed +* `withStarted(java.lang.Boolean)` was removed +* `withName(java.lang.String)` was removed + +#### `models.BaseContainer` was modified + +* `validate()` was removed + +#### `models.BlobStorageTokenStore` was modified + +* `validate()` was removed + +#### `models.VolumeMount` was modified + +* `validate()` was removed + +#### `models.DiagnosticDataProviderMetadata` was modified + +* `DiagnosticDataProviderMetadata()` was changed to private access +* `withProviderName(java.lang.String)` was removed +* `validate()` was removed +* `withPropertyBag(java.util.List)` was removed + +#### `models.ExtendedLocation` was modified + +* `validate()` was removed + +#### `models.DiagnosticDataTableResponseObject` was modified + +* `DiagnosticDataTableResponseObject()` was changed to private access +* `withColumns(java.util.List)` was removed +* `validate()` was removed +* `withRows(java.util.List)` was removed +* `withTableName(java.lang.String)` was removed + +#### `models.SessionRegistryCredentials` was modified + +* `validate()` was removed + +#### `models.ManagedEnvironmentPropertiesPeerAuthentication` was modified + +* `validate()` was removed + +#### `models.DiagnosticDataProviderMetadataPropertyBagItem` was modified + +* `DiagnosticDataProviderMetadataPropertyBagItem()` was changed to private access +* `validate()` was removed +* `withName(java.lang.String)` was removed +* `withValue(java.lang.String)` was removed + +#### `models.AppLogsConfiguration` was modified + +* `validate()` was removed + +#### `models.HttpRouteRule` was modified + +* `validate()` was removed + +#### `models.JavaComponentProperties` was modified + +* `validate()` was removed + +#### `models.GitHub` was modified + +* `validate()` was removed + +#### `models.ResourceTags` was modified + +* `validate()` was removed + +#### `models.CustomScaleRule` was modified + +* `validate()` was removed + +#### `models.Nonce` was modified + +* `validate()` was removed + +#### `models.ContainerResources` was modified + +* `validate()` was removed + +#### `models.OpenIdConnectRegistration` was modified + +* `validate()` was removed + +#### `models.Ingress` was modified + +* `validate()` was removed + +#### `models.HttpRoute` was modified + +* `validate()` was removed + +#### `models.CustomDomainConfiguration` was modified + +* `validate()` was removed + +#### `models.JavaComponentIngress` was modified + +* `validate()` was removed + +#### `models.Dapr` was modified + +* `validate()` was removed + +#### `models.HttpSettingsRoutes` was modified + +* `validate()` was removed + +#### `models.DiagnosticDataTableResponseColumn` was modified + +* `DiagnosticDataTableResponseColumn()` was changed to private access +* `withColumnType(java.lang.String)` was removed +* `validate()` was removed +* `withColumnName(java.lang.String)` was removed +* `withDataType(java.lang.String)` was removed + +#### `models.Configuration` was modified + +* `validate()` was removed + +#### `models.Template` was modified + +* `validate()` was removed + +#### `models.ContainerAppProbeTcpSocket` was modified + +* `validate()` was removed + +#### `models.SpringCloudEurekaComponent` was modified + +* `validate()` was removed + +#### `models.LoginRoutes` was modified + +* `validate()` was removed ### Features Added -### Breaking Changes +* `models.DotNetComponent$UpdateStages` was added + +* `models.LabelHistory` was added + +* `models.CheckMigrationEligibilityResponse` was added + +* `models.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration` was added + +* `models.ContainerAppsFunction` was added + +* `models.VnetConnectionProperties` was added + +* `models.SessionPoolIdentityLifeCycle` was added + +* `models.DotNetComponents` was added + +* `models.SandboxGroups` was added + +* `models.LabelHistoryRecordItem` was added + +* `models.SessionProbe` was added + +* `models.VnetConnectionProvisioningState` was added + +* `models.ContainerAppsFunctionState` was added + +* `models.ContainerAppPrivateEndpointConnections` was added + +* `models.DotNetComponentServiceBind` was added + +* `models.SessionProbeTcpSocket` was added + +* `models.SandboxGroupProperties` was added + +* `models.LogsConfiguration` was added + +* `models.VnetConnection$Definition` was added + +* `models.DotNetComponent$Update` was added + +* `models.SandboxGroupPatchProperties` was added + +* `models.DotNetComponent$DefinitionStages` was added + +* `models.Status` was added + +* `models.SandboxGroup$DefinitionStages` was added + +* `models.VnetConnection$UpdateStages` was added + +* `models.DotNetComponentProvisioningState` was added + +* `models.DotNetComponentType` was added + +* `models.FunctionsExtensions` was added + +* `models.DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration` was added + +* `models.SessionProbeHttpGet` was added + +* `models.OtlpConfiguration` was added + +* `models.MetricsConfiguration` was added + +* `models.TracesConfiguration` was added + +* `models.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration` was added + +* `models.VnetConnection` was added + +* `models.SandboxGroupPatch` was added + +* `models.VnetConnections` was added + +* `models.DotNetComponentConfigurationProperty` was added + +* `models.AppInsightsConfiguration` was added + +* `models.DaprComponentResiliencyPolicy$Definition` was added + +* `models.VnetConnection$Update` was added + +* `models.AvailableEnvironmentModeProperties` was added + +* `models.ContainerAppNetworkingConfiguration` was added + +* `models.DaprComponentResiliencyPolicy$DefinitionStages` was added + +* `models.DaprComponentResiliencyPolicies` was added + +* `models.DotNetComponent` was added + +* `models.ContainerAppsLabelHistories` was added + +* `models.DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration` was added + +* `models.DaprComponentResiliencyPolicyConfiguration` was added + +* `models.OpenTelemetryConfiguration` was added + +* `models.SandboxGroup$Definition` was added + +* `models.DaprComponentResiliencyPolicy$Update` was added + +* `models.ContainerAppsFunctions` was added + +* `models.ContainerAppPrivateLinkResources` was added + +* `models.DestinationsConfiguration` was added + +* `models.DataDogConfiguration` was added + +* `models.DotNetComponent$Definition` was added + +* `models.AvailableEnvironmentMode` was added + +* `models.MigrationEligibilityFailureReason` was added + +* `models.SandboxGroup$UpdateStages` was added + +* `models.DaprComponentResiliencyPolicy$UpdateStages` was added + +* `models.ReplicaExecutionStatus` was added + +* `models.ContainerExecutionStatus` was added + +* `models.SandboxGroupProvisioningState` was added + +* `models.LabelHistoryProperties` was added + +* `models.CheckMigrationEligibilityRequest` was added + +* `models.SessionProbeType` was added + +* `models.ExecutionStatus` was added + +* `models.VnetConnection$DefinitionStages` was added + +* `models.DaprComponentResiliencyPolicy` was added + +* `models.JobRunningState` was added + +* `models.ManagedEnvironmentMode` was added + +* `models.AvailableEnvironmentModes` was added + +* `models.SandboxGroup` was added + +* `models.SandboxGroup$Update` was added + +* `models.SessionProbeHttpGetHttpHeadersItem` was added + +* `models.Header` was added + +* `models.ContainerAppsRevisionFunctions` was added + +#### `models.SessionContainer` was modified + +* `probes()` was added +* `withProbes(java.util.List)` was added + +#### `models.Job` was modified + +* `resume(com.azure.core.util.Context)` was added +* `resume()` was added +* `suspend()` was added +* `runningState()` was added +* `suspend(com.azure.core.util.Context)` was added -### Bugs Fixed +#### `models.ManagedEnvironment$Update` was modified + +* `withAppInsightsConfiguration(models.AppInsightsConfiguration)` was added +* `withOpenTelemetryConfiguration(models.OpenTelemetryConfiguration)` was added +* `withEnvironmentMode(models.ManagedEnvironmentMode)` was added + +#### `models.Jobs` was modified + +* `suspend(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `resume(java.lang.String,java.lang.String)` was added +* `suspend(java.lang.String,java.lang.String)` was added +* `resume(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `models.ManagedEnvironment$Definition` was modified + +* `withOpenTelemetryConfiguration(models.OpenTelemetryConfiguration)` was added +* `withEnvironmentMode(models.ManagedEnvironmentMode)` was added +* `withAppInsightsConfiguration(models.AppInsightsConfiguration)` was added + +#### `models.ContainerApp$Update` was modified + +* `withNetworking(models.ContainerAppNetworkingConfiguration)` was added + +#### `models.Scale` was modified + +* `allowScalingRuleOverride()` was added +* `withAllowScalingRuleOverride(java.lang.Boolean)` was added + +#### `models.ManagedEnvironment` was modified + +* `openTelemetryConfiguration()` was added +* `checkMigrationEligibilityWithResponse(models.CheckMigrationEligibilityRequest,com.azure.core.util.Context)` was added +* `checkMigrationEligibility(models.CheckMigrationEligibilityRequest)` was added +* `appInsightsConfiguration()` was added +* `environmentMode()` was added + +#### `models.ManagedEnvironments` was modified + +* `checkMigrationEligibility(java.lang.String,java.lang.String,models.CheckMigrationEligibilityRequest)` was added +* `checkMigrationEligibilityWithResponse(java.lang.String,java.lang.String,models.CheckMigrationEligibilityRequest,com.azure.core.util.Context)` was added + +#### `models.JobExecution` was modified + +* `detailedStatus()` was added +* `reason()` was added +* `message()` was added +* `systemData()` was added + +#### `models.ManagedEnvironmentPrivateLinkResources` was modified + +* `getWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `get(java.lang.String,java.lang.String,java.lang.String)` was added + +#### `models.ManagedIdentitySetting` was modified + +* `withLifecycle(models.SessionPoolIdentityLifeCycle)` was added + +#### `models.ContainerApp` was modified + +* `networking()` was added + +#### `ContainerAppsApiManager` was modified + +* `containerAppsFunctions()` was added +* `containerAppPrivateEndpointConnections()` was added +* `sandboxGroups()` was added +* `containerAppPrivateLinkResources()` was added +* `containerAppsRevisionFunctions()` was added +* `containerAppsLabelHistories()` was added +* `functionsExtensions()` was added +* `vnetConnections()` was added +* `dotNetComponents()` was added +* `daprComponentResiliencyPolicies()` was added +* `availableEnvironmentModes()` was added + +#### `models.ReplicaContainer` was modified + +* `debugEndpoint()` was added + +#### `models.BlobStorageTokenStore` was modified + +* `blobContainerUri()` was added +* `withManagedIdentityResourceId(java.lang.String)` was added +* `managedIdentityResourceId()` was added +* `withClientId(java.lang.String)` was added +* `clientId()` was added +* `withBlobContainerUri(java.lang.String)` was added + +#### `models.ContainerApp$Definition` was modified -### Other Changes +* `withNetworking(models.ContainerAppNetworkingConfiguration)` was added ## 1.2.0 (2025-10-24) diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/README.md b/sdk/appcontainers/azure-resourcemanager-appcontainers/README.md index 6b7991125806..d901939eadf0 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. Logic app is an extension resource on container app and the extension resource enables logic specific operations on the container app through the APIs listed. Package tag package-2025-07-01. 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 api-version 2026-07-01. 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.2.0 + 1.3.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/SAMPLE.md b/sdk/appcontainers/azure-resourcemanager-appcontainers/SAMPLE.md index 90c2fbb84676..c358ecb84f0c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/SAMPLE.md +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/SAMPLE.md @@ -1,6 +1,10 @@ # Code snippets and samples +## AvailableEnvironmentModes + +- [List](#availableenvironmentmodes_list) + ## AvailableWorkloadProfiles - [Get](#availableworkloadprofiles_get) @@ -50,6 +54,18 @@ - [Get](#connectedenvironmentsstorages_get) - [List](#connectedenvironmentsstorages_list) +## ContainerAppPrivateEndpointConnections + +- [CreateOrUpdate](#containerappprivateendpointconnections_createorupdate) +- [Delete](#containerappprivateendpointconnections_delete) +- [Get](#containerappprivateendpointconnections_get) +- [List](#containerappprivateendpointconnections_list) + +## ContainerAppPrivateLinkResources + +- [Get](#containerappprivatelinkresources_get) +- [List](#containerappprivatelinkresources_list) + ## ContainerApps - [CreateOrUpdate](#containerapps_createorupdate) @@ -79,6 +95,22 @@ - [ListDetectors](#containerappsdiagnostics_listdetectors) - [ListRevisions](#containerappsdiagnostics_listrevisions) +## ContainerAppsFunctions + +- [Get](#containerappsfunctions_get) +- [List](#containerappsfunctions_list) + +## ContainerAppsLabelHistory + +- [DeleteLabelHistory](#containerappslabelhistory_deletelabelhistory) +- [GetLabelHistory](#containerappslabelhistory_getlabelhistory) +- [ListLabelHistory](#containerappslabelhistory_listlabelhistory) + +## ContainerAppsRevisionFunctions + +- [Get](#containerappsrevisionfunctions_get) +- [List](#containerappsrevisionfunctions_list) + ## ContainerAppsRevisionReplicas - [GetReplica](#containerappsrevisionreplicas_getreplica) @@ -108,6 +140,13 @@ - [Get](#containerappssourcecontrols_get) - [ListByContainerApp](#containerappssourcecontrols_listbycontainerapp) +## DaprComponentResiliencyPolicies + +- [CreateOrUpdate](#daprcomponentresiliencypolicies_createorupdate) +- [Delete](#daprcomponentresiliencypolicies_delete) +- [Get](#daprcomponentresiliencypolicies_get) +- [List](#daprcomponentresiliencypolicies_list) + ## DaprComponents - [CreateOrUpdate](#daprcomponents_createorupdate) @@ -116,6 +155,18 @@ - [List](#daprcomponents_list) - [ListSecrets](#daprcomponents_listsecrets) +## DotNetComponents + +- [CreateOrUpdate](#dotnetcomponents_createorupdate) +- [Delete](#dotnetcomponents_delete) +- [Get](#dotnetcomponents_get) +- [List](#dotnetcomponents_list) +- [Update](#dotnetcomponents_update) + +## FunctionsExtension + +- [InvokeFunctionsHost](#functionsextension_invokefunctionshost) + ## HttpRouteConfig - [CreateOrUpdate](#httprouteconfig_createorupdate) @@ -143,9 +194,11 @@ - [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 @@ -190,6 +243,7 @@ ## ManagedEnvironmentPrivateLinkResources +- [Get](#managedenvironmentprivatelinkresources_get) - [List](#managedenvironmentprivatelinkresources_list) ## ManagedEnvironmentUsages @@ -198,6 +252,7 @@ ## ManagedEnvironments +- [CheckMigrationEligibility](#managedenvironments_checkmigrationeligibility) - [CreateOrUpdate](#managedenvironments_createorupdate) - [Delete](#managedenvironments_delete) - [GetAuthToken](#managedenvironments_getauthtoken) @@ -231,9 +286,47 @@ - [GetCustomDomainVerificationId](#resourceprovider_getcustomdomainverificationid) - [JobExecution](#resourceprovider_jobexecution) +## SandboxGroups + +- [CreateOrUpdate](#sandboxgroups_createorupdate) +- [Delete](#sandboxgroups_delete) +- [GetByResourceGroup](#sandboxgroups_getbyresourcegroup) +- [List](#sandboxgroups_list) +- [ListByResourceGroup](#sandboxgroups_listbyresourcegroup) +- [Update](#sandboxgroups_update) + ## Usages - [List](#usages_list) + +## VnetConnections + +- [CreateOrUpdate](#vnetconnections_createorupdate) +- [Delete](#vnetconnections_delete) +- [Get](#vnetconnections_get) +- [ListBySandboxGroup](#vnetconnections_listbysandboxgroup) +### AvailableEnvironmentModes_List + +```java +/** + * Samples for AvailableEnvironmentModes List. + */ +public final class AvailableEnvironmentModesListSamples { + /* + * x-ms-original-file: 2026-07-01/AvailableEnvironmentModes_List.json + */ + /** + * Sample code: AvailableEnvironmentModes_List. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + availableEnvironmentModesList(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.availableEnvironmentModes().list("East US", com.azure.core.util.Context.NONE); + } +} +``` + ### AvailableWorkloadProfiles_Get ```java @@ -242,8 +335,7 @@ */ public final class AvailableWorkloadProfilesGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * AvailableWorkloadProfiles_Get.json + * x-ms-original-file: 2026-07-01/AvailableWorkloadProfiles_Get.json */ /** * Sample code: BillingMeters_Get. @@ -264,8 +356,7 @@ public final class AvailableWorkloadProfilesGetSamples { */ public final class BillingMetersGetSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/BillingMeters_Get.json + * x-ms-original-file: 2026-07-01/BillingMeters_Get.json */ /** * Sample code: BillingMeters_Get. @@ -290,8 +381,7 @@ import com.azure.resourcemanager.appcontainers.models.CertificateProperties; */ public final class CertificatesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * Certificate_CreateOrUpdate_FromKeyVault.json + * x-ms-original-file: 2026-07-01/Certificate_CreateOrUpdate_FromKeyVault.json */ /** * Sample code: Create or Update Certificate using Managed Identity. @@ -311,8 +401,7 @@ public final class CertificatesCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * Certificate_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01/Certificate_CreateOrUpdate.json */ /** * Sample code: Create or Update Certificate. @@ -339,8 +428,7 @@ public final class CertificatesCreateOrUpdateSamples { */ public final class CertificatesDeleteSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Certificate_Delete.json + * x-ms-original-file: 2026-07-01/Certificate_Delete.json */ /** * Sample code: Delete Certificate. @@ -363,8 +451,7 @@ public final class CertificatesDeleteSamples { */ public final class CertificatesGetSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Certificate_Get.json + * x-ms-original-file: 2026-07-01/Certificate_Get.json */ /** * Sample code: Get Certificate. @@ -387,8 +474,7 @@ public final class CertificatesGetSamples { */ public final class CertificatesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * Certificates_ListByManagedEnvironment.json + * x-ms-original-file: 2026-07-01/Certificates_ListByManagedEnvironment.json */ /** * Sample code: List Certificates by Managed Environment. @@ -414,8 +500,7 @@ import java.util.Map; */ public final class CertificatesUpdateSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Certificates_Patch.json + * x-ms-original-file: 2026-07-01/Certificates_Patch.json */ /** * Sample code: Patch Certificate. @@ -453,8 +538,7 @@ import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityReque */ public final class ConnectedEnvironmentsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ConnectedEnvironmentsCertificates_CheckNameAvailability.json + * x-ms-original-file: 2026-07-01/ConnectedEnvironmentsCertificates_CheckNameAvailability.json */ /** * Sample code: Certificates_CheckNameAvailability. @@ -482,8 +566,7 @@ import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; */ public final class ConnectedEnvironmentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ConnectedEnvironments_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01/ConnectedEnvironments_CreateOrUpdate.json */ /** * Sample code: Create kube environments. @@ -514,8 +597,7 @@ public final class ConnectedEnvironmentsCreateOrUpdateSamples { */ public final class ConnectedEnvironmentsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ConnectedEnvironments_Delete.json + * x-ms-original-file: 2026-07-01/ConnectedEnvironments_Delete.json */ /** * Sample code: Delete connected environment by connectedEnvironmentName. @@ -537,8 +619,7 @@ public final class ConnectedEnvironmentsDeleteSamples { */ public final class ConnectedEnvironmentsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ConnectedEnvironments_Get.json + * x-ms-original-file: 2026-07-01/ConnectedEnvironments_Get.json */ /** * Sample code: Get connected environment by connectedEnvironmentName. @@ -561,8 +642,7 @@ public final class ConnectedEnvironmentsGetByResourceGroupSamples { */ public final class ConnectedEnvironmentsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ConnectedEnvironments_ListBySubscription.json + * x-ms-original-file: 2026-07-01/ConnectedEnvironments_ListBySubscription.json */ /** * Sample code: List connected environments by subscription. @@ -584,8 +664,7 @@ public final class ConnectedEnvironmentsListSamples { */ public final class ConnectedEnvironmentsListByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ConnectedEnvironments_ListByResourceGroup.json + * x-ms-original-file: 2026-07-01/ConnectedEnvironments_ListByResourceGroup.json */ /** * Sample code: List environments by resource group. @@ -611,8 +690,7 @@ import java.util.Map; */ public final class ConnectedEnvironmentsUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ConnectedEnvironments_Patch.json + * x-ms-original-file: 2026-07-01/ConnectedEnvironments_Patch.json */ /** * Sample code: Patch Managed Environment. @@ -651,8 +729,7 @@ import com.azure.resourcemanager.appcontainers.models.CertificateProperties; */ public final class ConnectedEnvironmentsCertificatesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ConnectedEnvironmentsCertificate_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01/ConnectedEnvironmentsCertificate_CreateOrUpdate.json */ /** * Sample code: Create or Update Certificate. @@ -680,8 +757,7 @@ public final class ConnectedEnvironmentsCertificatesCreateOrUpdateSamples { */ public final class ConnectedEnvironmentsCertificatesDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ConnectedEnvironmentsCertificate_Delete.json + * x-ms-original-file: 2026-07-01/ConnectedEnvironmentsCertificate_Delete.json */ /** * Sample code: Delete Certificate. @@ -703,8 +779,7 @@ public final class ConnectedEnvironmentsCertificatesDeleteSamples { */ public final class ConnectedEnvironmentsCertificatesGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ConnectedEnvironmentsCertificate_Get.json + * x-ms-original-file: 2026-07-01/ConnectedEnvironmentsCertificate_Get.json */ /** * Sample code: Get Certificate. @@ -727,8 +802,7 @@ public final class ConnectedEnvironmentsCertificatesGetSamples { */ public final class ConnectedEnvironmentsCertificatesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json + * x-ms-original-file: 2026-07-01/ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json */ /** * Sample code: List Certificates by Connected Environment. @@ -755,8 +829,7 @@ import java.util.Map; */ public final class ConnectedEnvironmentsCertificatesUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ConnectedEnvironmentsCertificates_Patch.json + * x-ms-original-file: 2026-07-01/ConnectedEnvironmentsCertificates_Patch.json */ /** * Sample code: Patch Certificate. @@ -797,8 +870,7 @@ import java.util.Arrays; */ public final class ConnectedEnvironmentsDaprComponentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json */ /** * Sample code: Create or update dapr component. @@ -833,8 +905,7 @@ public final class ConnectedEnvironmentsDaprComponentsCreateOrUpdateSamples { */ public final class ConnectedEnvironmentsDaprComponentsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ConnectedEnvironmentsDaprComponents_Delete.json + * x-ms-original-file: 2026-07-01/ConnectedEnvironmentsDaprComponents_Delete.json */ /** * Sample code: Delete dapr component. @@ -856,8 +927,7 @@ public final class ConnectedEnvironmentsDaprComponentsDeleteSamples { */ public final class ConnectedEnvironmentsDaprComponentsGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ConnectedEnvironmentsDaprComponents_Get.json + * x-ms-original-file: 2026-07-01/ConnectedEnvironmentsDaprComponents_Get.json */ /** * Sample code: Get Dapr Component. @@ -879,8 +949,7 @@ public final class ConnectedEnvironmentsDaprComponentsGetSamples { */ public final class ConnectedEnvironmentsDaprComponentsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ConnectedEnvironmentsDaprComponents_List.json + * x-ms-original-file: 2026-07-01/ConnectedEnvironmentsDaprComponents_List.json */ /** * Sample code: List Dapr Components. @@ -902,8 +971,7 @@ public final class ConnectedEnvironmentsDaprComponentsListSamples { */ public final class ConnectedEnvironmentsDaprComponentsListSecretsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ConnectedEnvironmentsDaprComponents_ListSecrets.json + * x-ms-original-file: 2026-07-01/ConnectedEnvironmentsDaprComponents_ListSecrets.json */ /** * Sample code: List Container Apps Secrets. @@ -930,8 +998,7 @@ import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentStorag */ public final class ConnectedEnvironmentsStoragesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ConnectedEnvironmentsStorages_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01/ConnectedEnvironmentsStorages_CreateOrUpdate.json */ /** * Sample code: Create or update environments storage. @@ -961,8 +1028,7 @@ public final class ConnectedEnvironmentsStoragesCreateOrUpdateSamples { */ public final class ConnectedEnvironmentsStoragesDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ConnectedEnvironmentsStorages_Delete.json + * x-ms-original-file: 2026-07-01/ConnectedEnvironmentsStorages_Delete.json */ /** * Sample code: List environments storages by subscription. @@ -985,8 +1051,7 @@ public final class ConnectedEnvironmentsStoragesDeleteSamples { */ public final class ConnectedEnvironmentsStoragesGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ConnectedEnvironmentsStorages_Get.json + * x-ms-original-file: 2026-07-01/ConnectedEnvironmentsStorages_Get.json */ /** * Sample code: get a environments storage properties by subscription. @@ -1009,8 +1074,7 @@ public final class ConnectedEnvironmentsStoragesGetSamples { */ public final class ConnectedEnvironmentsStoragesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ConnectedEnvironmentsStorages_List.json + * x-ms-original-file: 2026-07-01/ConnectedEnvironmentsStorages_List.json */ /** * Sample code: List environments storages by subscription. @@ -1025,6 +1089,154 @@ public final class ConnectedEnvironmentsStoragesListSamples { } ``` +### ContainerAppPrivateEndpointConnections_CreateOrUpdate + +```java +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.appcontainers.models.PrivateLinkServiceConnectionState; + +/** + * Samples for ContainerAppPrivateEndpointConnections CreateOrUpdate. + */ +public final class ContainerAppPrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-07-01/ContainerAppPrivateEndpointConnections_CreateOrUpdate.json + */ + /** + * Sample code: Update a Private Endpoint Connection by Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void updateAPrivateEndpointConnectionByContainerApp( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppPrivateEndpointConnections() + .createOrUpdate("examplerg", "testcontainerapp0", "test-private-endpoint-connection", + new PrivateEndpointConnectionInner().withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withActionsRequired("None")), + com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppPrivateEndpointConnections_Delete + +```java +/** + * Samples for ContainerAppPrivateEndpointConnections Delete. + */ +public final class ContainerAppPrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: 2026-07-01/ContainerAppPrivateEndpointConnections_Delete.json + */ + /** + * Sample code: Delete a Private Endpoint Connection by Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteAPrivateEndpointConnectionByContainerApp( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppPrivateEndpointConnections() + .delete("examplerg", "testcontainerapp0", "test-private-endpoint-connection", + com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppPrivateEndpointConnections_Get + +```java +/** + * Samples for ContainerAppPrivateEndpointConnections Get. + */ +public final class ContainerAppPrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: 2026-07-01/ContainerAppPrivateEndpointConnections_Get.json + */ + /** + * Sample code: Get a Private Endpoint Connection by Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getAPrivateEndpointConnectionByContainerApp( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppPrivateEndpointConnections() + .getWithResponse("examplerg", "testcontainerapp0", "test-private-endpoint-connection", + com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppPrivateEndpointConnections_List + +```java +/** + * Samples for ContainerAppPrivateEndpointConnections List. + */ +public final class ContainerAppPrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: 2026-07-01/ContainerAppPrivateEndpointConnections_List.json + */ + /** + * Sample code: List Private Endpoint Connections by Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listPrivateEndpointConnectionsByContainerApp( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppPrivateEndpointConnections() + .list("examplerg", "testcontainerapp0", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppPrivateLinkResources_Get + +```java +/** + * Samples for ContainerAppPrivateLinkResources Get. + */ +public final class ContainerAppPrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: 2026-07-01/ContainerAppPrivateLinkResources_Get.json + */ + /** + * Sample code: Get a Private Link Resource by Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + getAPrivateLinkResourceByContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppPrivateLinkResources() + .getWithResponse("examplerg", "testcontainerapp0", "containerApps", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppPrivateLinkResources_List + +```java +/** + * Samples for ContainerAppPrivateLinkResources List. + */ +public final class ContainerAppPrivateLinkResourcesListSamples { + /* + * x-ms-original-file: 2026-07-01/ContainerAppPrivateLinkResources_List.json + */ + /** + * Sample code: List Private Link Resources by Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listPrivateLinkResourcesByContainerApp( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppPrivateLinkResources() + .list("examplerg", "testcontainerapp0", com.azure.core.util.Context.NONE); + } +} +``` + ### ContainerApps_CreateOrUpdate ```java @@ -1035,6 +1247,7 @@ 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.ContainerAppNetworkingConfiguration; import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe; import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; @@ -1046,6 +1259,8 @@ import com.azure.resourcemanager.appcontainers.models.CustomScaleRule; import com.azure.resourcemanager.appcontainers.models.Dapr; import com.azure.resourcemanager.appcontainers.models.DaprAppHealth; import com.azure.resourcemanager.appcontainers.models.EnvironmentVar; +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.Ingress; @@ -1083,8 +1298,7 @@ import java.util.Map; */ public final class ContainerAppsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ContainerApps_Kind_WorkflowApp_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01/ContainerApps_Kind_WorkflowApp_CreateOrUpdate.json */ /** * Sample code: Create or Update WorkflowApp Kind. @@ -1114,8 +1328,95 @@ public final class ContainerAppsCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ContainerApps_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01/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").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))) + .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: 2026-07-01/ContainerApps_CreateOrUpdate.json */ /** * Sample code: Create or Update Container App. @@ -1125,7 +1426,7 @@ public final class ContainerAppsCreateOrUpdateSamples { public static void createOrUpdateContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager.containerApps() - .define("testcontainerapp0") + .define("testcontainerApp0") .withRegion("East US") .withExistingResourceGroup("rg") .withIdentity(new ManagedServiceIdentity() @@ -1136,79 +1437,68 @@ public final class ContainerAppsCreateOrUpdateSamples { .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) - .withAppHealth(new DaprAppHealth() - .withEnabled(true) - .withPath("/health") - .withProbeIntervalSeconds(3) - .withProbeTimeoutMilliseconds(1000) - .withThreshold(3)) - .withMaxConcurrency(10)) - .withRuntime(new Runtime().withJava(new RuntimeJava().withEnableMetrics(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)))) + .withConfiguration(new Configuration().withIngress(new Ingress().withExternal(true) + .withTargetPort(3000) + .withTraffic(Arrays + .asList(new TrafficWeight().withRevisionName("testcontainerApp0-ab1234").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) + .withAppHealth(new DaprAppHealth().withEnabled(true) + .withPath("/health") + .withProbeIntervalSeconds(3) + .withProbeTimeoutMilliseconds(1000) + .withThreshold(3)) + .withMaxConcurrency(10)) + .withRuntime(new Runtime().withJava(new RuntimeJava().withEnableMetrics(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") + .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("repo/testcontainerApp0:v1") + .withName("testcontainerApp0") .withVolumeMounts( Arrays.asList( new VolumeMount().withVolumeName("azurefile") @@ -1258,8 +1548,32 @@ public final class ContainerAppsCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ContainerApps_TcpApp_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01/ContainerApps_CreateOrUpdate_Networking.json + */ + /** + * Sample code: Create or Update Container App with per-app outbound VNet subnet. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateContainerAppWithPerAppOutboundVNetSubnet( + 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/expressenv") + .withNetworking(new ContainerAppNetworkingConfiguration().withOutboundVnetSubnetId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/appsubnet")) + .withTemplate( + new Template().withContainers(Arrays.asList(new Container().withImage("repo/testcontainerApp0:v1") + .withName("testcontainerApp0") + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi"))))) + .create(); + } + + /* + * x-ms-original-file: 2026-07-01/ContainerApps_TcpApp_CreateOrUpdate.json */ /** * Sample code: Create or Update Tcp App. @@ -1268,21 +1582,19 @@ 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( "/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))))) + .withConfiguration(new Configuration().withIngress(new Ingress().withExternal(true) + .withTargetPort(3000) + .withExposedPort(4000) + .withTransport(IngressTransportMethod.TCP) + .withTraffic(Arrays.asList(new TrafficWeight().withRevisionName("testcontainerAppTcp-ab1234"))))) .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)) @@ -1297,8 +1609,7 @@ public final class ContainerAppsCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ContainerApps_Kind_FunctionApp_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01/ContainerApps_Kind_FunctionApp_CreateOrUpdate.json */ /** * Sample code: Create or Update FunctionApp Kind. @@ -1327,14 +1638,16 @@ public final class ContainerAppsCreateOrUpdateSamples { new EnvironmentVar().withName("FUNCTIONS_WORKER_RUNTIME").withValue("dotnet"), new EnvironmentVar().withName("WEBSITES_ENABLE_APP_SERVICE_STORAGE").withValue("false"))) .withResources(new ContainerResources().withCpu(0.5D).withMemory("1.0Gi")))) - .withScale( - new Scale().withMinReplicas(0).withMaxReplicas(10).withCooldownPeriod(300).withPollingInterval(30))) + .withScale(new Scale().withMinReplicas(0) + .withMaxReplicas(10) + .withCooldownPeriod(300) + .withPollingInterval(30) + .withAllowScalingRuleOverride(true))) .create(); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ContainerApps_ManagedBy_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01/ContainerApps_ManagedBy_CreateOrUpdate.json */ /** * Sample code: Create or Update ManagedBy App. @@ -1344,7 +1657,7 @@ public final class ContainerAppsCreateOrUpdateSamples { public static void createOrUpdateManagedByApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager.containerApps() - .define("testcontainerappmanagedby") + .define("testcontainerAppManagedBy") .withRegion("East US") .withExistingResourceGroup("rg") .withManagedBy( @@ -1355,11 +1668,10 @@ public final class ContainerAppsCreateOrUpdateSamples { .withTargetPort(3000) .withExposedPort(4000) .withTransport(IngressTransportMethod.TCP) - .withTraffic(Arrays - .asList(new TrafficWeight().withRevisionName("testcontainerappmanagedby-ab1234").withWeight(100))))) + .withTraffic(Arrays.asList(new TrafficWeight().withRevisionName("testcontainerAppManagedBy-ab1234"))))) .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)) @@ -1395,9 +1707,7 @@ public final class ContainerAppsCreateOrUpdateSamples { */ public final class ContainerAppsDeleteSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ContainerApps_Delete. - * json + * x-ms-original-file: 2026-07-01/ContainerApps_Delete.json */ /** * Sample code: Delete Container App. @@ -1405,7 +1715,7 @@ 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); } } ``` @@ -1418,8 +1728,7 @@ public final class ContainerAppsDeleteSamples { */ public final class ContainerAppsGetAuthTokenSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ContainerApps_GetAuthToken.json + * x-ms-original-file: 2026-07-01/ContainerApps_GetAuthToken.json */ /** * Sample code: Get Container App Auth Token. @@ -1428,7 +1737,7 @@ 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); } } ``` @@ -1441,8 +1750,7 @@ public final class ContainerAppsGetAuthTokenSamples { */ public final class ContainerAppsGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ContainerApps_Get.json + * x-ms-original-file: 2026-07-01/ContainerApps_Get.json */ /** * Sample code: Get Container App. @@ -1451,7 +1759,7 @@ 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); } } ``` @@ -1464,8 +1772,7 @@ public final class ContainerAppsGetByResourceGroupSamples { */ public final class ContainerAppsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ContainerApps_ListBySubscription.json + * x-ms-original-file: 2026-07-01/ContainerApps_ListBySubscription.json */ /** * Sample code: List Container Apps by subscription. @@ -1487,8 +1794,7 @@ public final class ContainerAppsListSamples { */ public final class ContainerAppsListByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ContainerApps_ListByResourceGroup.json + * x-ms-original-file: 2026-07-01/ContainerApps_ListByResourceGroup.json */ /** * Sample code: List Container Apps by resource group. @@ -1510,8 +1816,7 @@ public final class ContainerAppsListByResourceGroupSamples { */ public final class ContainerAppsListCustomHostnameAnalysisSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ContainerApps_ListCustomHostNameAnalysis.json + * x-ms-original-file: 2026-07-01/ContainerApps_ListCustomHostNameAnalysis.json */ /** * Sample code: Analyze Custom Hostname. @@ -1520,7 +1825,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); } } @@ -1534,8 +1839,7 @@ public final class ContainerAppsListCustomHostnameAnalysisSamples { */ public final class ContainerAppsListSecretsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ContainerApps_ListSecrets.json + * x-ms-original-file: 2026-07-01/ContainerApps_ListSecrets.json */ /** * Sample code: List Container Apps Secrets. @@ -1544,7 +1848,7 @@ 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); } } ``` @@ -1557,9 +1861,7 @@ public final class ContainerAppsListSecretsSamples { */ public final class ContainerAppsStartSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ContainerApps_Start. - * json + * x-ms-original-file: 2026-07-01/ContainerApps_Start.json */ /** * Sample code: Start Container App. @@ -1567,7 +1869,7 @@ 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); } } ``` @@ -1580,8 +1882,7 @@ public final class ContainerAppsStartSamples { */ public final class ContainerAppsStopSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ContainerApps_Stop.json + * x-ms-original-file: 2026-07-01/ContainerApps_Stop.json */ /** * Sample code: Stop Container App. @@ -1589,7 +1890,7 @@ 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); } } ``` @@ -1635,9 +1936,7 @@ import java.util.Map; */ public final class ContainerAppsUpdateSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ContainerApps_Patch. - * json + * x-ms-original-file: 2026-07-01/ContainerApps_Patch.json */ /** * Sample code: Patch Container App. @@ -1646,64 +1945,55 @@ 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")) - .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) - .withAppHealth(new DaprAppHealth().withEnabled(true) - .withPath("/health") - .withProbeIntervalSeconds(3) - .withProbeTimeoutMilliseconds(1000) - .withThreshold(3)) - .withMaxConcurrency(10)) - .withRuntime(new Runtime().withJava(new RuntimeJava().withEnableMetrics(true))) - .withMaxInactiveRevisions(10) - .withService(new Service().withType("redis"))) + .withConfiguration(new Configuration().withIngress(new Ingress().withExternal(true) + .withTargetPort(3000) + .withTraffic(Arrays + .asList(new TrafficWeight().withRevisionName("testcontainerApp0-ab1234").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) + .withAppHealth(new DaprAppHealth().withEnabled(true) + .withPath("/health") + .withProbeIntervalSeconds(3) + .withProbeTimeoutMilliseconds(1000) + .withThreshold(3)) + .withMaxConcurrency(10)) + .withRuntime(new Runtime().withJava(new RuntimeJava().withEnableMetrics(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( @@ -1745,10 +2035,13 @@ public final class ContainerAppsUpdateSamples { ```java import com.azure.resourcemanager.appcontainers.models.AppRegistration; import com.azure.resourcemanager.appcontainers.models.AuthPlatform; +import com.azure.resourcemanager.appcontainers.models.BlobStorageTokenStore; 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.Login; +import com.azure.resourcemanager.appcontainers.models.TokenStore; import com.azure.resourcemanager.appcontainers.models.UnauthenticatedClientActionV2; /** @@ -1756,8 +2049,7 @@ import com.azure.resourcemanager.appcontainers.models.UnauthenticatedClientActio */ public final class ContainerAppsAuthConfigsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * AuthConfigs_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01/AuthConfigs_CreateOrUpdate.json */ /** * Sample code: Create or Update Container App AuthConfig. @@ -1779,6 +2071,62 @@ public final class ContainerAppsAuthConfigsCreateOrUpdateSamples { .withContainerAppAuthSigningSecretName("fakeTokenPlaceholder")) .create(); } + + /* + * x-ms-original-file: 2026-07-01/AuthConfigs_BlobStorageTokenStore_ClientId_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Container App AuthConfig with msi clientID blob storage token store. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateContainerAppAuthConfigWithMsiClientIDBlobStorageTokenStore( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsAuthConfigs() + .define("current") + .withExistingContainerApp("rg1", "myapp") + .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")))) + .withLogin(new Login().withTokenStore(new TokenStore().withAzureBlobStorage( + new BlobStorageTokenStore().withBlobContainerUri("https://test.blob.core.windows.net/container1") + .withClientId("00000000-0000-0000-0000-000000000000")))) + .withEncryptionSettings( + new EncryptionSettings().withContainerAppAuthEncryptionSecretName("fakeTokenPlaceholder") + .withContainerAppAuthSigningSecretName("fakeTokenPlaceholder")) + .create(); + } + + /* + * x-ms-original-file: 2026-07-01/AuthConfigs_BlobStorageTokenStore_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Container App AuthConfig with msi managedIdentityResourceId blob storage token + * store. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateContainerAppAuthConfigWithMsiManagedIdentityResourceIdBlobStorageTokenStore( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsAuthConfigs() + .define("current") + .withExistingContainerApp("rg1", "myapp") + .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")))) + .withLogin(new Login().withTokenStore(new TokenStore().withAzureBlobStorage(new BlobStorageTokenStore() + .withBlobContainerUri("https://test.blob.core.windows.net/container1") + .withManagedIdentityResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1")))) + .withEncryptionSettings( + new EncryptionSettings().withContainerAppAuthEncryptionSecretName("fakeTokenPlaceholder") + .withContainerAppAuthSigningSecretName("fakeTokenPlaceholder")) + .create(); + } } ``` @@ -1790,8 +2138,7 @@ public final class ContainerAppsAuthConfigsCreateOrUpdateSamples { */ public final class ContainerAppsAuthConfigsDeleteSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/AuthConfigs_Delete.json + * x-ms-original-file: 2026-07-01/AuthConfigs_Delete.json */ /** * Sample code: Delete Container App AuthConfig. @@ -1814,8 +2161,7 @@ public final class ContainerAppsAuthConfigsDeleteSamples { */ public final class ContainerAppsAuthConfigsGetSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/AuthConfigs_Get.json + * x-ms-original-file: 2026-07-01/AuthConfigs_Get.json */ /** * Sample code: Get Container App's AuthConfig. @@ -1838,8 +2184,7 @@ public final class ContainerAppsAuthConfigsGetSamples { */ public final class ContainerAppsAuthConfigsListByContainerAppSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * AuthConfigs_ListByContainer.json + * x-ms-original-file: 2026-07-01/AuthConfigs_ListByContainer.json */ /** * Sample code: List Auth Configs by Container Apps. @@ -1862,8 +2207,7 @@ public final class ContainerAppsAuthConfigsListByContainerAppSamples { */ public final class ContainerAppsDiagnosticsGetDetectorSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ContainerAppsDiagnostics_Get.json + * x-ms-original-file: 2026-07-01/ContainerAppsDiagnostics_Get.json */ /** * Sample code: Get Container App's diagnostics info. @@ -1887,8 +2231,7 @@ public final class ContainerAppsDiagnosticsGetDetectorSamples { */ public final class ContainerAppsDiagnosticsGetRevisionSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Revisions_Get.json + * x-ms-original-file: 2026-07-01/Revisions_Get1.json */ /** * Sample code: Get Container App's revision. @@ -1912,8 +2255,7 @@ public final class ContainerAppsDiagnosticsGetRevisionSamples { */ public final class ContainerAppsDiagnosticsGetRootSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ContainerApps_Get.json + * x-ms-original-file: 2026-07-01/ContainerApps_Get1.json */ /** * Sample code: Get Container App. @@ -1922,7 +2264,7 @@ 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); } } ``` @@ -1935,8 +2277,7 @@ public final class ContainerAppsDiagnosticsGetRootSamples { */ public final class ContainerAppsDiagnosticsListDetectorsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ContainerAppsDiagnostics_List.json + * x-ms-original-file: 2026-07-01/ContainerAppsDiagnostics_List.json */ /** * Sample code: Get the list of available diagnostics for a given Container App. @@ -1959,8 +2300,7 @@ public final class ContainerAppsDiagnosticsListDetectorsSamples { */ public final class ContainerAppsDiagnosticsListRevisionsSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Revisions_List.json + * x-ms-original-file: 2026-07-01/Revisions_List1.json */ /** * Sample code: List Container App's revisions. @@ -1975,50 +2315,209 @@ public final class ContainerAppsDiagnosticsListRevisionsSamples { } ``` -### ContainerAppsRevisionReplicas_GetReplica +### ContainerAppsFunctions_Get ```java /** - * Samples for ContainerAppsRevisionReplicas GetReplica. + * Samples for ContainerAppsFunctions Get. */ -public final class ContainerAppsRevisionReplicasGetReplicaSamples { +public final class ContainerAppsFunctionsGetSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Replicas_Get.json + * x-ms-original-file: 2026-07-01/ContainerAppsFunctions_Get.json */ /** - * Sample code: Get Container App's revision replica. + * Sample code: Get Container App's function. * * @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); + getContainerAppSFunction(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsFunctions() + .getWithResponse("myResourceGroup", "myContainerApp", "HttpExample", com.azure.core.util.Context.NONE); } } ``` -### ContainerAppsRevisionReplicas_ListReplicas +### ContainerAppsFunctions_List ```java /** - * Samples for ContainerAppsRevisionReplicas ListReplicas. + * Samples for ContainerAppsFunctions List. */ -public final class ContainerAppsRevisionReplicasListReplicasSamples { +public final class ContainerAppsFunctionsListSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Replicas_List.json + * x-ms-original-file: 2026-07-01/ContainerAppsFunctions_List.json */ /** - * Sample code: List Container App's replicas. + * Sample code: List Container App's functions. * * @param manager Entry point to ContainerAppsApiManager. */ public static void - listContainerAppSReplicas(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsRevisionReplicas() + listContainerAppSFunctions(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsFunctions().list("myResourceGroup", "myContainerApp", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsLabelHistory_DeleteLabelHistory + +```java +/** + * Samples for ContainerAppsLabelHistory DeleteLabelHistory. + */ +public final class ContainerAppsLabelHistoryDeleteLabelHistorySamples { + /* + * x-ms-original-file: 2026-07-01/LabelHistory_Delete.json + */ + /** + * Sample code: Delete Container App's label history for a given label. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteContainerAppSLabelHistoryForAGivenLabel( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsLabelHistories() + .deleteLabelHistoryWithResponse("rg", "testContainerApp", "dev", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsLabelHistory_GetLabelHistory + +```java +/** + * Samples for ContainerAppsLabelHistory GetLabelHistory. + */ +public final class ContainerAppsLabelHistoryGetLabelHistorySamples { + /* + * x-ms-original-file: 2026-07-01/LabelHistory_Get.json + */ + /** + * Sample code: Get Container App's single label history. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + getContainerAppSSingleLabelHistory(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsLabelHistories() + .getLabelHistoryWithResponse("rg", "testContainerApp", "dev", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsLabelHistory_ListLabelHistory + +```java +/** + * Samples for ContainerAppsLabelHistory ListLabelHistory. + */ +public final class ContainerAppsLabelHistoryListLabelHistorySamples { + /* + * x-ms-original-file: 2026-07-01/LabelHistory_List.json + */ + /** + * Sample code: List Container App's all label history. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listContainerAppSAllLabelHistory(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsLabelHistories() + .listLabelHistory("rg", "testContainerApp", null, com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsRevisionFunctions_Get + +```java +/** + * Samples for ContainerAppsRevisionFunctions Get. + */ +public final class ContainerAppsRevisionFunctionsGetSamples { + /* + * x-ms-original-file: 2026-07-01/ContainerAppsRevisionFunctions_Get.json + */ + /** + * Sample code: Get Container App Revision's function. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + getContainerAppRevisionSFunction(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsRevisionFunctions() + .getWithResponse("myResourceGroup", "myContainerApp", "myContainerApp-abc123", "HttpExample", + com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsRevisionFunctions_List + +```java +/** + * Samples for ContainerAppsRevisionFunctions List. + */ +public final class ContainerAppsRevisionFunctionsListSamples { + /* + * x-ms-original-file: 2026-07-01/ContainerAppsRevisionFunctions_List.json + */ + /** + * Sample code: List Container App Revision's functions. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listContainerAppRevisionSFunctions(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsRevisionFunctions() + .list("myResourceGroup", "myContainerApp", "myContainerApp-abc123", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerAppsRevisionReplicas_GetReplica + +```java +/** + * Samples for ContainerAppsRevisionReplicas GetReplica. + */ +public final class ContainerAppsRevisionReplicasGetReplicaSamples { + /* + * x-ms-original-file: 2026-07-01/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: 2026-07-01/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); } } @@ -2032,8 +2531,7 @@ public final class ContainerAppsRevisionReplicasListReplicasSamples { */ public final class ContainerAppsRevisionsActivateRevisionSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Revisions_Activate.json + * x-ms-original-file: 2026-07-01/Revisions_Activate.json */ /** * Sample code: Activate Container App's revision. @@ -2057,9 +2555,7 @@ public final class ContainerAppsRevisionsActivateRevisionSamples { */ public final class ContainerAppsRevisionsDeactivateRevisionSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Revisions_Deactivate. - * json + * x-ms-original-file: 2026-07-01/Revisions_Deactivate.json */ /** * Sample code: Deactivate Container App's revision. @@ -2083,8 +2579,7 @@ public final class ContainerAppsRevisionsDeactivateRevisionSamples { */ public final class ContainerAppsRevisionsGetRevisionSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Revisions_Get.json + * x-ms-original-file: 2026-07-01/Revisions_Get.json */ /** * Sample code: Get Container App's revision. @@ -2108,8 +2603,7 @@ public final class ContainerAppsRevisionsGetRevisionSamples { */ public final class ContainerAppsRevisionsListRevisionsSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Revisions_List.json + * x-ms-original-file: 2026-07-01/Revisions_List.json */ /** * Sample code: List Container App's revisions. @@ -2132,8 +2626,7 @@ public final class ContainerAppsRevisionsListRevisionsSamples { */ public final class ContainerAppsRevisionsRestartRevisionSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Revisions_Restart.json + * x-ms-original-file: 2026-07-01/Revisions_Restart.json */ /** * Sample code: Restart Container App's revision. @@ -2155,7 +2648,6 @@ public final class ContainerAppsRevisionsRestartRevisionSamples { 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.IdentitySettingsLifeCycle; import com.azure.resourcemanager.appcontainers.models.LifecycleConfiguration; import com.azure.resourcemanager.appcontainers.models.LifecycleType; import com.azure.resourcemanager.appcontainers.models.ManagedIdentitySetting; @@ -2168,6 +2660,7 @@ 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.SessionPoolIdentityLifeCycle; import com.azure.resourcemanager.appcontainers.models.SessionRegistryCredentials; import java.util.Arrays; @@ -2176,8 +2669,31 @@ import java.util.Arrays; */ public final class ContainerAppsSessionPoolsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * SessionPools_LifecycleOnContainerExit_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01/SessionPools_McpServer_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Session Pool with MCP server. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateSessionPoolWithMCPServer( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsSessionPools() + .define("testsessionpool") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withContainerType(ContainerType.fromString("Shell")) + .withPoolManagementType(PoolManagementType.DYNAMIC) + .withScaleConfiguration(new ScaleConfiguration().withMaxConcurrentSessions(50)) + .withDynamicPoolConfiguration(new DynamicPoolConfiguration().withLifecycleConfiguration( + new LifecycleConfiguration().withLifecycleType(LifecycleType.TIMED).withCooldownPeriodInSeconds(600))) + .withSessionNetworkConfiguration( + new SessionNetworkConfiguration().withStatus(SessionNetworkStatus.EGRESS_ENABLED)) + .create(); + } + + /* + * x-ms-original-file: 2026-07-01/SessionPools_LifecycleOnContainerExit_CreateOrUpdate.json */ /** * Sample code: Create or Update Session Pool with lifecycle OnContainerExit Timed. @@ -2213,13 +2729,12 @@ public final class ContainerAppsSessionPoolsCreateOrUpdateSamples { .withSessionNetworkConfiguration( new SessionNetworkConfiguration().withStatus(SessionNetworkStatus.EGRESS_ENABLED)) .withManagedIdentitySettings(Arrays.asList( - new ManagedIdentitySetting().withIdentity("system").withLifecycle(IdentitySettingsLifeCycle.MAIN))) + new ManagedIdentitySetting().withIdentity("system").withLifecycle(SessionPoolIdentityLifeCycle.MAIN))) .create(); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * SessionPools_LifecycleTimed_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01/SessionPools_LifecycleTimed_CreateOrUpdate.json */ /** * Sample code: Create or Update Session Pool with lifecycle type Timed. @@ -2240,8 +2755,7 @@ public final class ContainerAppsSessionPoolsCreateOrUpdateSamples { .withScaleConfiguration( new ScaleConfiguration().withMaxConcurrentSessions(500).withReadySessionInstances(100)) .withDynamicPoolConfiguration(new DynamicPoolConfiguration().withLifecycleConfiguration( - new LifecycleConfiguration().withLifecycleType(LifecycleType.ON_CONTAINER_EXIT) - .withMaxAlivePeriodInSeconds(86400))) + new LifecycleConfiguration().withLifecycleType(LifecycleType.TIMED).withCooldownPeriodInSeconds(600))) .withCustomContainerTemplate(new CustomContainerTemplate() .withRegistryCredentials(new SessionRegistryCredentials().withServer("test.azurecr.io") .withIdentity( @@ -2255,7 +2769,7 @@ public final class ContainerAppsSessionPoolsCreateOrUpdateSamples { .withSessionNetworkConfiguration( new SessionNetworkConfiguration().withStatus(SessionNetworkStatus.EGRESS_ENABLED)) .withManagedIdentitySettings(Arrays.asList( - new ManagedIdentitySetting().withIdentity("system").withLifecycle(IdentitySettingsLifeCycle.MAIN))) + new ManagedIdentitySetting().withIdentity("system").withLifecycle(SessionPoolIdentityLifeCycle.MAIN))) .create(); } } @@ -2269,9 +2783,7 @@ public final class ContainerAppsSessionPoolsCreateOrUpdateSamples { */ public final class ContainerAppsSessionPoolsDeleteSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/SessionPools_Delete. - * json + * x-ms-original-file: 2026-07-01/SessionPools_Delete.json */ /** * Sample code: Delete Session Pool. @@ -2292,8 +2804,7 @@ public final class ContainerAppsSessionPoolsDeleteSamples { */ public final class ContainerAppsSessionPoolsGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/SessionPools_Get.json + * x-ms-original-file: 2026-07-01/SessionPools_Get.json */ /** * Sample code: Get Session Pool. @@ -2304,6 +2815,20 @@ public final class ContainerAppsSessionPoolsGetByResourceGroupSamples { manager.containerAppsSessionPools() .getByResourceGroupWithResponse("rg", "testsessionpool", com.azure.core.util.Context.NONE); } + + /* + * x-ms-original-file: 2026-07-01/SessionPools_Get_InProgress.json + */ + /** + * Sample code: Get Session Pool during update. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + getSessionPoolDuringUpdate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.containerAppsSessionPools() + .getByResourceGroupWithResponse("rg", "testsessionpool", com.azure.core.util.Context.NONE); + } } ``` @@ -2315,8 +2840,7 @@ public final class ContainerAppsSessionPoolsGetByResourceGroupSamples { */ public final class ContainerAppsSessionPoolsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * SessionPools_ListBySubscription.json + * x-ms-original-file: 2026-07-01/SessionPools_ListBySubscription.json */ /** * Sample code: List Session Pools by subscription. @@ -2338,8 +2862,7 @@ public final class ContainerAppsSessionPoolsListSamples { */ public final class ContainerAppsSessionPoolsListByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * SessionPools_ListByResourceGroup.json + * x-ms-original-file: 2026-07-01/SessionPools_ListByResourceGroup.json */ /** * Sample code: List Session Pools by resource group. @@ -2357,6 +2880,9 @@ public final class ContainerAppsSessionPoolsListByResourceGroupSamples { ```java import com.azure.resourcemanager.appcontainers.models.CustomContainerTemplate; +import com.azure.resourcemanager.appcontainers.models.DynamicPoolConfiguration; +import com.azure.resourcemanager.appcontainers.models.LifecycleConfiguration; +import com.azure.resourcemanager.appcontainers.models.LifecycleType; import com.azure.resourcemanager.appcontainers.models.ScaleConfiguration; import com.azure.resourcemanager.appcontainers.models.SessionContainer; import com.azure.resourcemanager.appcontainers.models.SessionContainerResources; @@ -2371,8 +2897,7 @@ import java.util.Arrays; */ public final class ContainerAppsSessionPoolsUpdateSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/SessionPools_Patch.json + * x-ms-original-file: 2026-07-01/SessionPools_Patch.json */ /** * Sample code: Update Session Pool. @@ -2386,6 +2911,8 @@ public final class ContainerAppsSessionPoolsUpdateSamples { resource.update() .withScaleConfiguration( new ScaleConfiguration().withMaxConcurrentSessions(500).withReadySessionInstances(100)) + .withDynamicPoolConfiguration(new DynamicPoolConfiguration().withLifecycleConfiguration( + new LifecycleConfiguration().withLifecycleType(LifecycleType.TIMED).withCooldownPeriodInSeconds(600))) .withCustomContainerTemplate(new CustomContainerTemplate() .withContainers(Arrays.asList(new SessionContainer().withImage("repo/testcontainer:v4") .withName("testinitcontainer") @@ -2412,8 +2939,7 @@ import com.azure.resourcemanager.appcontainers.models.RegistryInfo; */ public final class ContainerAppsSourceControlsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * SourceControls_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01/SourceControls_CreateOrUpdate.json */ /** * Sample code: Create or Update Container App SourceControl. @@ -2451,9 +2977,7 @@ public final class ContainerAppsSourceControlsCreateOrUpdateSamples { */ public final class ContainerAppsSourceControlsDeleteSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/SourceControls_Delete. - * json + * x-ms-original-file: 2026-07-01/SourceControls_Delete.json */ /** * Sample code: Delete Container App SourceControl. @@ -2476,8 +3000,7 @@ public final class ContainerAppsSourceControlsDeleteSamples { */ public final class ContainerAppsSourceControlsGetSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/SourceControls_Get.json + * x-ms-original-file: 2026-07-01/SourceControls_Get.json */ /** * Sample code: Get Container App's SourceControl. @@ -2500,8 +3023,7 @@ public final class ContainerAppsSourceControlsGetSamples { */ public final class ContainerAppsSourceControlsListByContainerAppSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * SourceControls_ListByContainer.json + * x-ms-original-file: 2026-07-01/SourceControls_ListByContainer.json */ /** * Sample code: List App's Source Controls. @@ -2515,6 +3037,183 @@ public final class ContainerAppsSourceControlsListByContainerAppSamples { } ``` +### DaprComponentResiliencyPolicies_CreateOrUpdate + +```java +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: 2026-07-01/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: 2026-07-01/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: 2026-07-01/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(); + } +} +``` + +### DaprComponentResiliencyPolicies_Delete + +```java +/** + * Samples for DaprComponentResiliencyPolicies Delete. + */ +public final class DaprComponentResiliencyPoliciesDeleteSamples { + /* + * x-ms-original-file: 2026-07-01/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); + } +} +``` + +### DaprComponentResiliencyPolicies_Get + +```java +/** + * Samples for DaprComponentResiliencyPolicies Get. + */ +public final class DaprComponentResiliencyPoliciesGetSamples { + /* + * x-ms-original-file: 2026-07-01/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); + } +} +``` + +### DaprComponentResiliencyPolicies_List + +```java +/** + * Samples for DaprComponentResiliencyPolicies List. + */ +public final class DaprComponentResiliencyPoliciesListSamples { + /* + * x-ms-original-file: 2026-07-01/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); + } +} +``` + ### DaprComponents_CreateOrUpdate ```java @@ -2528,8 +3227,7 @@ import java.util.Arrays; */ public final class DaprComponentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * DaprComponents_CreateOrUpdate_Secrets.json + * x-ms-original-file: 2026-07-01/DaprComponents_CreateOrUpdate_Secrets.json */ /** * Sample code: Create or update dapr component with secrets. @@ -2554,8 +3252,7 @@ public final class DaprComponentsCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * DaprComponents_CreateOrUpdate_SecretStoreComponent.json + * x-ms-original-file: 2026-07-01/DaprComponents_CreateOrUpdate_SecretStoreComponent.json */ /** * Sample code: Create or update dapr component with secret store component. @@ -2589,9 +3286,7 @@ public final class DaprComponentsCreateOrUpdateSamples { */ public final class DaprComponentsDeleteSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/DaprComponents_Delete. - * json + * x-ms-original-file: 2026-07-01/DaprComponents_Delete.json */ /** * Sample code: Delete dapr component. @@ -2613,8 +3308,7 @@ public final class DaprComponentsDeleteSamples { */ public final class DaprComponentsGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * DaprComponents_Get_SecretStoreComponent.json + * x-ms-original-file: 2026-07-01/DaprComponents_Get_SecretStoreComponent.json */ /** * Sample code: Get Dapr Component with secret store component. @@ -2628,8 +3322,7 @@ public final class DaprComponentsGetSamples { } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * DaprComponents_Get_Secrets.json + * x-ms-original-file: 2026-07-01/DaprComponents_Get_Secrets.json */ /** * Sample code: Get Dapr Component with secrets. @@ -2652,9 +3345,7 @@ public final class DaprComponentsGetSamples { */ public final class DaprComponentsListSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/DaprComponents_List. - * json + * x-ms-original-file: 2026-07-01/DaprComponents_List.json */ /** * Sample code: List Dapr Components. @@ -2675,8 +3366,7 @@ public final class DaprComponentsListSamples { */ public final class DaprComponentsListSecretsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * DaprComponents_ListSecrets.json + * x-ms-original-file: 2026-07-01/DaprComponents_ListSecrets.json */ /** * Sample code: List Container Apps Secrets. @@ -2691,6 +3381,234 @@ public final class DaprComponentsListSecretsSamples { } ``` +### 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 DotNetComponents CreateOrUpdate. + */ +public final class DotNetComponentsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-07-01/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: 2026-07-01/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(); + } +} +``` + +### DotNetComponents_Delete + +```java +/** + * Samples for DotNetComponents Delete. + */ +public final class DotNetComponentsDeleteSamples { + /* + * x-ms-original-file: 2026-07-01/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); + } +} +``` + +### DotNetComponents_Get + +```java +/** + * Samples for DotNetComponents Get. + */ +public final class DotNetComponentsGetSamples { + /* + * x-ms-original-file: 2026-07-01/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: 2026-07-01/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); + } +} +``` + +### DotNetComponents_List + +```java +/** + * Samples for DotNetComponents List. + */ +public final class DotNetComponentsListSamples { + /* + * x-ms-original-file: 2026-07-01/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: 2026-07-01/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); + } +} +``` + +### 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 DotNetComponents Update. + */ +public final class DotNetComponentsUpdateSamples { + /* + * x-ms-original-file: 2026-07-01/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: 2026-07-01/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(); + } +} +``` + +### FunctionsExtension_InvokeFunctionsHost + +```java +/** + * Samples for FunctionsExtension InvokeFunctionsHost. + */ +public final class FunctionsExtensionInvokeFunctionsHostSamples { + /* + * x-ms-original-file: 2026-07-01/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); + } +} +``` + ### HttpRouteConfig_CreateOrUpdate ```java @@ -2709,8 +3627,7 @@ import java.util.Arrays; */ public final class HttpRouteConfigCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * HttpRouteConfig_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01/HttpRouteConfig_CreateOrUpdate.json */ /** * Sample code: Create or Update Http Route. @@ -2728,8 +3645,7 @@ public final class HttpRouteConfigCreateOrUpdateSamples { .withCertificateId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/certificates/certificate-1"))) .withRules(Arrays.asList(new HttpRouteRule() - .withTargets( - Arrays.asList(new HttpRouteTarget().withContainerApp("capp-1").withRevision("capp-1--0000001"))) + .withTargets(Arrays.asList(new HttpRouteTarget().withContainerApp("capp-1").withRevision("rev-1"))) .withRoutes(Arrays .asList(new HttpRoute().withMatch(new HttpRouteMatch().withPath("/v1").withCaseSensitive(true)) .withAction(new HttpRouteAction().withPrefixRewrite("/v1/api")))) @@ -2738,8 +3654,7 @@ public final class HttpRouteConfigCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * HttpRouteConfig_CreateOrUpdate_PathSepPrefix.json + * x-ms-original-file: 2026-07-01/HttpRouteConfig_CreateOrUpdate_PathSepPrefix.json */ /** * Sample code: Create or Update Http Route Path Separated Prefix Rule. @@ -2753,7 +3668,7 @@ public final class HttpRouteConfigCreateOrUpdateSamples { .withExistingManagedEnvironment("examplerg", "testcontainerenv") .withProperties(new HttpRouteConfigProperties().withCustomDomains(Arrays.asList(new CustomDomain() .withName("example.com") - .withBindingType(BindingType.SNI_ENABLED) + .withBindingType(BindingType.DISABLED) .withCertificateId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/certificates/certificate-1"))) .withRules(Arrays.asList(new HttpRouteRule() @@ -2766,8 +3681,7 @@ public final class HttpRouteConfigCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * HttpRouteConfig_CreateOrUpdatePrefix.json + * x-ms-original-file: 2026-07-01/HttpRouteConfig_CreateOrUpdatePrefix.json */ /** * Sample code: Create or Update Http Route Prefix Rule. @@ -2781,7 +3695,7 @@ public final class HttpRouteConfigCreateOrUpdateSamples { .withExistingManagedEnvironment("examplerg", "testcontainerenv") .withProperties(new HttpRouteConfigProperties().withCustomDomains(Arrays.asList(new CustomDomain() .withName("example.com") - .withBindingType(BindingType.SNI_ENABLED) + .withBindingType(BindingType.DISABLED) .withCertificateId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/certificates/certificate-1"))) .withRules(Arrays.asList(new HttpRouteRule() @@ -2803,16 +3717,14 @@ public final class HttpRouteConfigCreateOrUpdateSamples { */ public final class HttpRouteConfigDeleteSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/HttpRouteConfig_Delete. - * json + * x-ms-original-file: 2026-07-01/HttpRouteConfig_Delete.json */ /** - * Sample code: Delete a Http Route Config. + * Sample code: Delete Certificate. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void deleteAHttpRouteConfig(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + public static void deleteCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager.httpRouteConfigs() .delete("examplerg", "testcontainerenv", "httproutefriendlyname", com.azure.core.util.Context.NONE); } @@ -2827,9 +3739,7 @@ public final class HttpRouteConfigDeleteSamples { */ public final class HttpRouteConfigGetSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/HttpRouteConfig_Get. - * json + * x-ms-original-file: 2026-07-01/HttpRouteConfig_Get.json */ /** * Sample code: Get HttpRoute. @@ -2852,15 +3762,14 @@ public final class HttpRouteConfigGetSamples { */ public final class HttpRouteConfigListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * HttpRouteConfig_ListByManagedEnvironment.json + * x-ms-original-file: 2026-07-01/HttpRouteConfig_ListByManagedEnvironment.json */ /** - * Sample code: List Http Route Configs by Managed Environment. + * Sample code: List Managed Http Routes by Managed Environment. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void listHttpRouteConfigsByManagedEnvironment( + public static void listManagedHttpRoutesByManagedEnvironment( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager.httpRouteConfigs().list("examplerg", "testcontainerenv", com.azure.core.util.Context.NONE); } @@ -2886,16 +3795,14 @@ import java.util.Arrays; */ public final class HttpRouteConfigUpdateSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/HttpRouteConfig_Patch. - * json + * x-ms-original-file: 2026-07-01/HttpRouteConfig_Patch.json */ /** - * Sample code: Patch a Http Route Config. + * Sample code: Patch Managed Http Route. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void patchAHttpRouteConfig(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + public static void patchManagedHttpRoute(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { HttpRouteConfig resource = manager.httpRouteConfigs() .getWithResponse("examplerg", "testcontainerenv", "httproutefriendlyname", com.azure.core.util.Context.NONE) .getValue(); @@ -2906,8 +3813,7 @@ public final class HttpRouteConfigUpdateSamples { .withCertificateId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/certificates/certificate-1"))) .withRules(Arrays.asList(new HttpRouteRule() - .withTargets( - Arrays.asList(new HttpRouteTarget().withContainerApp("capp-1").withRevision("capp-1--0000001"))) + .withTargets(Arrays.asList(new HttpRouteTarget().withContainerApp("capp-1").withRevision("rev-1"))) .withRoutes(Arrays .asList(new HttpRoute().withMatch(new HttpRouteMatch().withPath("/v1").withCaseSensitive(true)) .withAction(new HttpRouteAction().withPrefixRewrite("/v1/api")))) @@ -2931,8 +3837,7 @@ import java.util.Arrays; */ public final class JavaComponentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * JavaComponents_CreateOrUpdate_ServiceBind.json + * x-ms-original-file: 2026-07-01/JavaComponents_CreateOrUpdate_ServiceBind.json */ /** * Sample code: Create or Update Java Component with ServiceBinds. @@ -2957,8 +3862,7 @@ public final class JavaComponentsCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * JavaComponents_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01/JavaComponents_CreateOrUpdate.json */ /** * Sample code: Create or Update Java Component. @@ -2989,9 +3893,7 @@ public final class JavaComponentsCreateOrUpdateSamples { */ public final class JavaComponentsDeleteSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/JavaComponents_Delete. - * json + * x-ms-original-file: 2026-07-01/JavaComponents_Delete.json */ /** * Sample code: Delete Java Component. @@ -3013,8 +3915,7 @@ public final class JavaComponentsDeleteSamples { */ public final class JavaComponentsGetSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/JavaComponents_Get.json + * x-ms-original-file: 2026-07-01/JavaComponents_Get.json */ /** * Sample code: Get Java Component. @@ -3027,8 +3928,7 @@ public final class JavaComponentsGetSamples { } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * JavaComponents_Get_ServiceBind.json + * x-ms-original-file: 2026-07-01/JavaComponents_Get_ServiceBind.json */ /** * Sample code: Get Java Component with ServiceBinds. @@ -3051,9 +3951,7 @@ public final class JavaComponentsGetSamples { */ public final class JavaComponentsListSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/JavaComponents_List. - * json + * x-ms-original-file: 2026-07-01/JavaComponents_List.json */ /** * Sample code: List Java Components. @@ -3065,8 +3963,7 @@ public final class JavaComponentsListSamples { } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * JavaComponents_List_ServiceBind.json + * x-ms-original-file: 2026-07-01/JavaComponents_List_ServiceBind.json */ /** * Sample code: List Java Components with ServiceBinds. @@ -3095,9 +3992,7 @@ import java.util.Arrays; */ public final class JavaComponentsUpdateSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/JavaComponents_Patch. - * json + * x-ms-original-file: 2026-07-01/JavaComponents_Patch.json */ /** * Sample code: Patch Java Component. @@ -3119,8 +4014,7 @@ public final class JavaComponentsUpdateSamples { } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * JavaComponents_Patch_ServiceBind.json + * x-ms-original-file: 2026-07-01/JavaComponents_Patch_ServiceBind.json */ /** * Sample code: Patch Java Component with ServiceBinds. @@ -3168,11 +4062,9 @@ 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.StorageType; 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.Volume; import com.azure.resourcemanager.appcontainers.models.VolumeMount; import java.io.IOException; import java.util.Arrays; @@ -3184,8 +4076,49 @@ import java.util.Map; */ public final class JobsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * Job_CreateorUpdate_EventTrigger.json + * x-ms-original-file: 2026-07-01/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") + .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: 2026-07-01/Job_CreateorUpdate_EventTrigger.json */ /** * Sample code: Create or Update Container Apps Job With Event Driven Trigger. @@ -3195,7 +4128,7 @@ 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) @@ -3219,19 +4152,18 @@ public final class JobsCreateOrUpdateSamples { .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/ContainerApps/stable/2025-07-01/examples/Job_CreateorUpdate.json + * x-ms-original-file: 2026-07-01/Job_CreateorUpdate.json */ /** * Sample code: Create or Update Container Apps Job. @@ -3241,7 +4173,7 @@ public final class JobsCreateOrUpdateSamples { public static void createOrUpdateContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager.jobs() - .define("testcontainerappsjob0") + .define("testcontainerAppsJob0") .withRegion("East US") .withExistingResourceGroup("rg") .withIdentity(new ManagedServiceIdentity() @@ -3261,37 +4193,30 @@ public final class JobsCreateOrUpdateSamples { .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") - .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() + .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))))) - .withVolumes(Arrays.asList( - new Volume().withName("azurefile") - .withStorageType(StorageType.AZURE_FILE) - .withStorageName("storage"), - new Volume().withName("nfsazurefile") - .withStorageType(StorageType.NFS_AZURE_FILE) - .withStorageName("nfsStorage")))) + .withPort(8080)) + .withInitialDelaySeconds(5) + .withPeriodSeconds(3) + .withType(Type.LIVENESS)))))) .create(); } @@ -3317,8 +4242,7 @@ public final class JobsCreateOrUpdateSamples { */ public final class JobsDeleteSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Job_Delete.json + * x-ms-original-file: 2026-07-01/Job_Delete.json */ /** * Sample code: Delete Container Apps Job. @@ -3326,7 +4250,7 @@ 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); } } ``` @@ -3339,8 +4263,7 @@ public final class JobsDeleteSamples { */ public final class JobsGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Job_Get.json + * x-ms-original-file: 2026-07-01/Job_Get.json */ /** * Sample code: Get Container Apps Job. @@ -3348,7 +4271,7 @@ 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); } } ``` @@ -3361,8 +4284,7 @@ public final class JobsGetByResourceGroupSamples { */ public final class JobsGetDetectorSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Job_GetDetector.json + * x-ms-original-file: 2026-07-01/Job_GetDetector.json */ /** * Sample code: Get diagnostic data for a Container App Job. @@ -3386,9 +4308,7 @@ public final class JobsGetDetectorSamples { */ public final class JobsListSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Jobs_ListBySubscription - * .json + * x-ms-original-file: 2026-07-01/Jobs_ListBySubscription.json */ /** * Sample code: List Container Apps Jobs by subscription. @@ -3410,8 +4330,7 @@ public final class JobsListSamples { */ public final class JobsListByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * Jobs_ListByResourceGroup.json + * x-ms-original-file: 2026-07-01/Jobs_ListByResourceGroup.json */ /** * Sample code: List Container Apps Jobs by resource group. @@ -3433,8 +4352,7 @@ public final class JobsListByResourceGroupSamples { */ public final class JobsListDetectorsSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Job_ListDetectors.json + * x-ms-original-file: 2026-07-01/Job_ListDetectors.json */ /** * Sample code: Get the list of available diagnostic data for a Container App Job. @@ -3456,8 +4374,7 @@ public final class JobsListDetectorsSamples { */ public final class JobsListSecretsSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Job_ListSecrets.json + * x-ms-original-file: 2026-07-01/Job_ListSecrets.json */ /** * Sample code: List Container Apps Job Secrets. @@ -3466,7 +4383,7 @@ 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); } } ``` @@ -3479,8 +4396,7 @@ public final class JobsListSecretsSamples { */ public final class JobsProxyGetSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Job_ProxyGet.json + * x-ms-original-file: 2026-07-01/Job_ProxyGet.json */ /** * Sample code: Get Container App Job by name. @@ -3489,7 +4405,28 @@ 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", "rootApi", com.azure.core.util.Context.NONE); + } +} +``` + +### Jobs_Resume + +```java +/** + * Samples for Jobs Resume. + */ +public final class JobsResumeSamples { + /* + * x-ms-original-file: 2026-07-01/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); } } ``` @@ -3507,8 +4444,7 @@ import java.util.Arrays; */ public final class JobsStartSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Job_Start.json + * x-ms-original-file: 2026-07-01/Job_Start.json */ /** * Sample code: Run a Container Apps Job. @@ -3517,15 +4453,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); } } @@ -3539,8 +4475,7 @@ public final class JobsStartSamples { */ public final class JobsStopExecutionSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Job_Stop_Execution.json + * x-ms-original-file: 2026-07-01/Job_Stop_Execution.json */ /** * Sample code: Terminate a Container Apps Job. @@ -3549,7 +4484,7 @@ 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); } } ``` @@ -3562,8 +4497,7 @@ public final class JobsStopExecutionSamples { */ public final class JobsStopMultipleExecutionsSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Job_Stop_Multiple.json + * x-ms-original-file: 2026-07-01/Job_Stop_Multiple.json */ /** * Sample code: Terminate Multiple Container Apps Job. @@ -3572,7 +4506,28 @@ 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); + } +} +``` + +### Jobs_Suspend + +```java +/** + * Samples for Jobs Suspend. + */ +public final class JobsSuspendSamples { + /* + * x-ms-original-file: 2026-07-01/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); } } ``` @@ -3600,8 +4555,7 @@ import java.util.Arrays; */ public final class JobsUpdateSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Job_Patch.json + * x-ms-original-file: 2026-07-01/Job_Patch.json */ /** * Sample code: Patch Container Apps Job. @@ -3610,7 +4564,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() @@ -3620,13 +4574,13 @@ public final class JobsUpdateSamples { .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 @@ -3650,8 +4604,7 @@ public final class JobsUpdateSamples { */ public final class JobsExecutionsListSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Job_Executions_Get.json + * x-ms-original-file: 2026-07-01/Job_Executions_Get.json */ /** * Sample code: Get a Container Apps Job Executions. @@ -3660,7 +4613,7 @@ 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); } } ``` @@ -3673,8 +4626,7 @@ public final class JobsExecutionsListSamples { */ public final class LogicAppsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/LogicApps_Create.json + * x-ms-original-file: 2026-07-01/LogicApps_Create.json */ /** * Sample code: Create logic app extension. @@ -3699,8 +4651,7 @@ public final class LogicAppsCreateOrUpdateSamples { */ public final class LogicAppsDeleteSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/LogicApps_Delete.json + * x-ms-original-file: 2026-07-01/LogicApps_Delete.json */ /** * Sample code: Create logic app extension. @@ -3724,8 +4675,7 @@ public final class LogicAppsDeleteSamples { */ public final class LogicAppsGetSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/LogicApps_Get.json + * x-ms-original-file: 2026-07-01/LogicApps_Get.json */ /** * Sample code: Get logic app extension by name. @@ -3748,9 +4698,7 @@ public final class LogicAppsGetSamples { */ public final class LogicAppsGetWorkflowSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/LogicApps_GetWorkflow. - * json + * x-ms-original-file: 2026-07-01/LogicApps_GetWorkflow.json */ /** * Sample code: GET a workflow. @@ -3773,9 +4721,7 @@ public final class LogicAppsGetWorkflowSamples { */ public final class LogicAppsListWorkflowsSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/LogicApps_ListWorkflows - * .json + * x-ms-original-file: 2026-07-01/LogicApps_ListWorkflows.json */ /** * Sample code: List the workflows. @@ -3797,8 +4743,7 @@ public final class LogicAppsListWorkflowsSamples { */ public final class LogicAppsListWorkflowsConnectionsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * LogicApps_ListConnections.json + * x-ms-original-file: 2026-07-01/LogicApps_ListConnections.json */ /** * Sample code: List the Workflows Configuration Connections. @@ -3826,8 +4771,7 @@ import java.util.Arrays; */ public final class MaintenanceConfigurationsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironment_MaintenanceConfigurations_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01/ManagedEnvironment_MaintenanceConfigurations_CreateOrUpdate.json */ /** * Sample code: ManagedEnvironmentMaintenanceConfigurationsCreateOrUpdate. @@ -3854,8 +4798,7 @@ public final class MaintenanceConfigurationsCreateOrUpdateSamples { */ public final class MaintenanceConfigurationsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironment_MaintenanceConfigurations_Delete.json + * x-ms-original-file: 2026-07-01/ManagedEnvironment_MaintenanceConfigurations_Delete.json */ /** * Sample code: ManagedEnvironmentMaintenanceConfigurationsDelete. @@ -3878,8 +4821,7 @@ public final class MaintenanceConfigurationsDeleteSamples { */ public final class MaintenanceConfigurationsGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironment_MaintenanceConfigurations_Get.json + * x-ms-original-file: 2026-07-01/ManagedEnvironment_MaintenanceConfigurations_Get.json */ /** * Sample code: ManagedEnvironmentMaintenanceConfigurationsGet. @@ -3902,8 +4844,7 @@ public final class MaintenanceConfigurationsGetSamples { */ public final class MaintenanceConfigurationsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironment_MaintenanceConfigurations_List.json + * x-ms-original-file: 2026-07-01/ManagedEnvironment_MaintenanceConfigurations_List.json */ /** * Sample code: ManagedEnvironmentMaintenanceConfigurationsList. @@ -3928,8 +4869,7 @@ import com.azure.resourcemanager.appcontainers.models.ManagedCertificateProperti */ public final class ManagedCertificatesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedCertificate_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01/ManagedCertificate_CreateOrUpdate.json */ /** * Sample code: Create or Update Certificate. @@ -3957,8 +4897,7 @@ public final class ManagedCertificatesCreateOrUpdateSamples { */ public final class ManagedCertificatesDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedCertificate_Delete.json + * x-ms-original-file: 2026-07-01/ManagedCertificate_Delete.json */ /** * Sample code: Delete Certificate. @@ -3981,9 +4920,7 @@ public final class ManagedCertificatesDeleteSamples { */ public final class ManagedCertificatesGetSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ManagedCertificate_Get. - * json + * x-ms-original-file: 2026-07-01/ManagedCertificate_Get.json */ /** * Sample code: Get Certificate. @@ -4006,8 +4943,7 @@ public final class ManagedCertificatesGetSamples { */ public final class ManagedCertificatesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedCertificates_ListByManagedEnvironment.json + * x-ms-original-file: 2026-07-01/ManagedCertificates_ListByManagedEnvironment.json */ /** * Sample code: List Managed Certificates by Managed Environment. @@ -4033,8 +4969,7 @@ import java.util.Map; */ public final class ManagedCertificatesUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedCertificates_Patch.json + * x-ms-original-file: 2026-07-01/ManagedCertificates_Patch.json */ /** * Sample code: Patch Managed Certificate. @@ -4072,8 +5007,7 @@ public final class ManagedCertificatesUpdateSamples { */ public final class ManagedEnvironmentDiagnosticsGetDetectorSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironmentDiagnostics_Get.json + * x-ms-original-file: 2026-07-01/ManagedEnvironmentDiagnostics_Get.json */ /** * Sample code: Get diagnostic data for a managed environments. @@ -4097,8 +5031,7 @@ public final class ManagedEnvironmentDiagnosticsGetDetectorSamples { */ public final class ManagedEnvironmentDiagnosticsListDetectorsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironmentDiagnostics_List.json + * x-ms-original-file: 2026-07-01/ManagedEnvironmentDiagnostics_List.json */ /** * Sample code: Get the list of available diagnostic data for a managed environments. @@ -4125,8 +5058,7 @@ import com.azure.resourcemanager.appcontainers.models.PrivateLinkServiceConnecti */ public final class ManagedEnvironmentPrivateEndpointConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironmentPrivateEndpointConnections_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01/ManagedEnvironmentPrivateEndpointConnections_CreateOrUpdate.json */ /** * Sample code: Update a Private Endpoint Connection by Managed Environment. @@ -4155,8 +5087,7 @@ public final class ManagedEnvironmentPrivateEndpointConnectionsCreateOrUpdateSam */ public final class ManagedEnvironmentPrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironmentPrivateEndpointConnections_Delete.json + * x-ms-original-file: 2026-07-01/ManagedEnvironmentPrivateEndpointConnections_Delete.json */ /** * Sample code: Delete a Private Endpoint Connection by Managed Environment. @@ -4179,8 +5110,7 @@ public final class ManagedEnvironmentPrivateEndpointConnectionsDeleteSamples { */ public final class ManagedEnvironmentPrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironmentPrivateEndpointConnections_Get.json + * x-ms-original-file: 2026-07-01/ManagedEnvironmentPrivateEndpointConnections_Get.json */ /** * Sample code: Get a Private Endpoint Connection by Managed Environment. @@ -4203,8 +5133,7 @@ public final class ManagedEnvironmentPrivateEndpointConnectionsGetSamples { */ public final class ManagedEnvironmentPrivateEndpointConnectionsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironmentPrivateEndpointConnections_List.json + * x-ms-original-file: 2026-07-01/ManagedEnvironmentPrivateEndpointConnections_List.json */ /** * Sample code: List Private Endpoint Connections by Managed Environment. @@ -4219,6 +5148,29 @@ public final class ManagedEnvironmentPrivateEndpointConnectionsListSamples { } ``` +### ManagedEnvironmentPrivateLinkResources_Get + +```java +/** + * Samples for ManagedEnvironmentPrivateLinkResources Get. + */ +public final class ManagedEnvironmentPrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: 2026-07-01/ManagedEnvironmentPrivateLinkResources_Get.json + */ + /** + * Sample code: Get a Private Link Resource by Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getAPrivateLinkResourceByManagedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.managedEnvironmentPrivateLinkResources() + .getWithResponse("examplerg", "managedEnv", "managedEnvironments", com.azure.core.util.Context.NONE); + } +} +``` + ### ManagedEnvironmentPrivateLinkResources_List ```java @@ -4227,8 +5179,7 @@ public final class ManagedEnvironmentPrivateEndpointConnectionsListSamples { */ public final class ManagedEnvironmentPrivateLinkResourcesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironmentPrivateLinkResources_List.json + * x-ms-original-file: 2026-07-01/ManagedEnvironmentPrivateLinkResources_List.json */ /** * Sample code: List Private Link Resources by Managed Environment. @@ -4251,8 +5202,7 @@ public final class ManagedEnvironmentPrivateLinkResourcesListSamples { */ public final class ManagedEnvironmentUsagesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironmentUsages_List.json + * x-ms-original-file: 2026-07-01/ManagedEnvironmentUsages_List.json */ /** * Sample code: List managed environment usages. @@ -4266,19 +5216,69 @@ public final class ManagedEnvironmentUsagesListSamples { } ``` +### ManagedEnvironments_CheckMigrationEligibility + +```java +import com.azure.resourcemanager.appcontainers.models.CheckMigrationEligibilityRequest; + +/** + * Samples for ManagedEnvironments CheckMigrationEligibility. + */ +public final class ManagedEnvironmentsCheckMigrationEligibilitySamples { + /* + * x-ms-original-file: 2026-07-01/ManagedEnvironments_CheckMigrationEligibility.json + */ + /** + * Sample code: Check migration eligibility for an eligible managed environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void checkMigrationEligibilityForAnEligibleManagedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.managedEnvironments() + .checkMigrationEligibilityWithResponse("examplerg", "my-environment", + new CheckMigrationEligibilityRequest().withTargetMode("Express"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01/ManagedEnvironments_CheckMigrationEligibility_Ineligible.json + */ + /** + * Sample code: Check migration eligibility for an ineligible managed environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void checkMigrationEligibilityForAnIneligibleManagedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.managedEnvironments() + .checkMigrationEligibilityWithResponse("examplerg", "my-environment", + new CheckMigrationEligibilityRequest().withTargetMode("Express"), com.azure.core.util.Context.NONE); + } +} +``` + ### 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.IngressConfiguration; 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; @@ -4291,8 +5291,7 @@ import java.util.Map; */ public final class ManagedEnvironmentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironments_CustomInfrastructureResourceGroup_Create.json + * x-ms-original-file: 2026-07-01/ManagedEnvironments_CustomInfrastructureResourceGroup_Create.json */ /** * Sample code: Create environment with custom infrastructureResourceGroup. @@ -4334,8 +5333,7 @@ public final class ManagedEnvironmentsCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironments_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01/ManagedEnvironments_CreateOrUpdate.json */ /** * Sample code: Create environments. @@ -4358,6 +5356,24 @@ public final class ManagedEnvironmentsCreateOrUpdateSamples { "/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"))) + .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()) @@ -4409,8 +5425,7 @@ public final class ManagedEnvironmentsCreateOrUpdateSamples { */ public final class ManagedEnvironmentsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironments_Delete.json + * x-ms-original-file: 2026-07-01/ManagedEnvironments_Delete.json */ /** * Sample code: Delete environment by name. @@ -4432,8 +5447,7 @@ public final class ManagedEnvironmentsDeleteSamples { */ public final class ManagedEnvironmentsGetAuthTokenSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironments_GetAuthToken.json + * x-ms-original-file: 2026-07-01/ManagedEnvironments_GetAuthToken.json */ /** * Sample code: Get Managed Environment Auth Token. @@ -4455,9 +5469,7 @@ public final class ManagedEnvironmentsGetAuthTokenSamples { */ public final class ManagedEnvironmentsGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ManagedEnvironments_Get - * .json + * x-ms-original-file: 2026-07-01/ManagedEnvironments_Get.json */ /** * Sample code: Get environments by name. @@ -4479,8 +5491,7 @@ public final class ManagedEnvironmentsGetByResourceGroupSamples { */ public final class ManagedEnvironmentsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironments_ListBySubscription.json + * x-ms-original-file: 2026-07-01/ManagedEnvironments_ListBySubscription.json */ /** * Sample code: List environments by subscription. @@ -4502,8 +5513,7 @@ public final class ManagedEnvironmentsListSamples { */ public final class ManagedEnvironmentsListByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironments_ListByResourceGroup.json + * x-ms-original-file: 2026-07-01/ManagedEnvironments_ListByResourceGroup.json */ /** * Sample code: List environments by resource group. @@ -4525,8 +5535,7 @@ public final class ManagedEnvironmentsListByResourceGroupSamples { */ public final class ManagedEnvironmentsListWorkloadProfileStatesSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironments_ListWorkloadProfileStates.json + * x-ms-original-file: 2026-07-01/ManagedEnvironments_ListWorkloadProfileStates.json */ /** * Sample code: List environments by subscription. @@ -4553,8 +5562,7 @@ import java.util.Map; */ public final class ManagedEnvironmentsUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironments_Patch.json + * x-ms-original-file: 2026-07-01/ManagedEnvironments_Patch.json */ /** * Sample code: Patch Managed Environment. @@ -4591,9 +5599,7 @@ public final class ManagedEnvironmentsUpdateSamples { */ public final class ManagedEnvironmentsDiagnosticsGetRootSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ManagedEnvironments_Get - * .json + * x-ms-original-file: 2026-07-01/ManagedEnvironments_Get1.json */ /** * Sample code: Get environments by name. @@ -4620,8 +5626,7 @@ import com.azure.resourcemanager.appcontainers.models.NfsAzureFileProperties; */ public final class ManagedEnvironmentsStoragesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironmentsStorages_CreateOrUpdate_NfsAzureFile.json + * x-ms-original-file: 2026-07-01/ManagedEnvironmentsStorages_CreateOrUpdate_NfsAzureFile.json */ /** * Sample code: Create or update environments storage for NFS Azure file. @@ -4641,8 +5646,7 @@ public final class ManagedEnvironmentsStoragesCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironmentsStorages_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01/ManagedEnvironmentsStorages_CreateOrUpdate.json */ /** * Sample code: Create or update environments storage. @@ -4672,8 +5676,7 @@ public final class ManagedEnvironmentsStoragesCreateOrUpdateSamples { */ public final class ManagedEnvironmentsStoragesDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironmentsStorages_Delete.json + * x-ms-original-file: 2026-07-01/ManagedEnvironmentsStorages_Delete.json */ /** * Sample code: List environments storages by subscription. @@ -4696,8 +5699,7 @@ public final class ManagedEnvironmentsStoragesDeleteSamples { */ public final class ManagedEnvironmentsStoragesGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironmentsStorages_Get.json + * x-ms-original-file: 2026-07-01/ManagedEnvironmentsStorages_Get.json */ /** * Sample code: get a environments storage. @@ -4711,8 +5713,7 @@ public final class ManagedEnvironmentsStoragesGetSamples { } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironmentsStorages_Get_NfsAzureFile.json + * x-ms-original-file: 2026-07-01/ManagedEnvironmentsStorages_Get_NfsAzureFile.json */ /** * Sample code: get a environments storage for NFS Azure file. @@ -4735,8 +5736,7 @@ public final class ManagedEnvironmentsStoragesGetSamples { */ public final class ManagedEnvironmentsStoragesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ManagedEnvironmentsStorages_List.json + * x-ms-original-file: 2026-07-01/ManagedEnvironmentsStorages_List.json */ /** * Sample code: List environments storages by subscription. @@ -4761,8 +5761,7 @@ import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityReque */ public final class NamespacesCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * Certificates_CheckNameAvailability.json + * x-ms-original-file: 2026-07-01/Certificates_CheckNameAvailability.json */ /** * Sample code: Certificates_CheckNameAvailability. @@ -4779,8 +5778,7 @@ public final class NamespacesCheckNameAvailabilitySamples { } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * ContainerApps_CheckNameAvailability.json + * x-ms-original-file: 2026-07-01/ContainerApps_CheckNameAvailability.json */ /** * Sample code: ContainerApps_CheckNameAvailability. @@ -4805,8 +5803,7 @@ public final class NamespacesCheckNameAvailabilitySamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Operations_List.json + * x-ms-original-file: 2026-07-01/Operations_List.json */ /** * Sample code: List all operations. @@ -4827,8 +5824,7 @@ public final class OperationsListSamples { */ public final class ResourceProviderGetCustomDomainVerificationIdSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/ - * Subscriptions_GetCustomDomainVerificationId.json + * x-ms-original-file: 2026-07-01/Subscriptions_GetCustomDomainVerificationId.json */ /** * Sample code: List all operations. @@ -4849,8 +5845,7 @@ public final class ResourceProviderGetCustomDomainVerificationIdSamples { */ public final class ResourceProviderJobExecutionSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Job_Execution_Get.json + * x-ms-original-file: 2026-07-01/Job_Execution_Get.json */ /** * Sample code: Get a single Job Execution. @@ -4859,7 +5854,162 @@ 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); + } +} +``` + +### SandboxGroups_CreateOrUpdate + +```java +/** + * Samples for SandboxGroups CreateOrUpdate. + */ +public final class SandboxGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-07-01/SandboxGroups_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a SandboxGroup. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + createOrUpdateASandboxGroup(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.sandboxGroups() + .define("testgroup") + .withRegion("East US") + .withExistingResourceGroup("examplerg") + .create(); + } +} +``` + +### SandboxGroups_Delete + +```java +/** + * Samples for SandboxGroups Delete. + */ +public final class SandboxGroupsDeleteSamples { + /* + * x-ms-original-file: 2026-07-01/SandboxGroups_Delete.json + */ + /** + * Sample code: Delete a SandboxGroup. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteASandboxGroup(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.sandboxGroups().delete("examplerg", "testgroup", com.azure.core.util.Context.NONE); + } +} +``` + +### SandboxGroups_GetByResourceGroup + +```java +/** + * Samples for SandboxGroups GetByResourceGroup. + */ +public final class SandboxGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-07-01/SandboxGroups_Get.json + */ + /** + * Sample code: Get a SandboxGroup. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getASandboxGroup(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.sandboxGroups() + .getByResourceGroupWithResponse("examplerg", "testgroup", com.azure.core.util.Context.NONE); + } +} +``` + +### SandboxGroups_List + +```java +/** + * Samples for SandboxGroups List. + */ +public final class SandboxGroupsListSamples { + /* + * x-ms-original-file: 2026-07-01/SandboxGroups_ListBySubscription.json + */ + /** + * Sample code: List SandboxGroups by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listSandboxGroupsBySubscription(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.sandboxGroups().list(com.azure.core.util.Context.NONE); + } +} +``` + +### SandboxGroups_ListByResourceGroup + +```java +/** + * Samples for SandboxGroups ListByResourceGroup. + */ +public final class SandboxGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-07-01/SandboxGroups_ListByResourceGroup.json + */ + /** + * Sample code: List SandboxGroups by resource group. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listSandboxGroupsByResourceGroup(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.sandboxGroups().listByResourceGroup("examplerg", com.azure.core.util.Context.NONE); + } +} +``` + +### SandboxGroups_Update + +```java +import com.azure.resourcemanager.appcontainers.models.SandboxGroupPatch; +import com.azure.resourcemanager.appcontainers.models.SandboxGroupPatchProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SandboxGroups Update. + */ +public final class SandboxGroupsUpdateSamples { + /* + * x-ms-original-file: 2026-07-01/SandboxGroups_Update.json + */ + /** + * Sample code: Update a SandboxGroup. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void updateASandboxGroup(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.sandboxGroups() + .update("examplerg", "testgroup", new SandboxGroupPatch().withTags(mapOf("environment", "test")) + .withProperties(new SandboxGroupPatchProperties().withEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/exampleenv")), + com.azure.core.util.Context.NONE); + } + + // 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; } } ``` @@ -4872,8 +6022,7 @@ public final class ResourceProviderJobExecutionSamples { */ public final class UsagesListSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Usages_List.json + * x-ms-original-file: 2026-07-01/Usages_List.json */ /** * Sample code: List usages. @@ -4886,3 +6035,97 @@ public final class UsagesListSamples { } ``` +### VnetConnections_CreateOrUpdate + +```java +import com.azure.resourcemanager.appcontainers.models.VnetConnectionProperties; + +/** + * Samples for VnetConnections CreateOrUpdate. + */ +public final class VnetConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-07-01/VnetConnections_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a VnetConnection. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + createOrUpdateAVnetConnection(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.vnetConnections() + .define("myVnetConnection") + .withExistingSandboxGroup("myRg", "testgroup") + .withProperties(new VnetConnectionProperties().withSubnetId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet")) + .create(); + } +} +``` + +### VnetConnections_Delete + +```java +/** + * Samples for VnetConnections Delete. + */ +public final class VnetConnectionsDeleteSamples { + /* + * x-ms-original-file: 2026-07-01/VnetConnections_Delete.json + */ + /** + * Sample code: Delete a VnetConnection. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteAVnetConnection(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.vnetConnections().delete("myRg", "testgroup", "myVnetConnection", com.azure.core.util.Context.NONE); + } +} +``` + +### VnetConnections_Get + +```java +/** + * Samples for VnetConnections Get. + */ +public final class VnetConnectionsGetSamples { + /* + * x-ms-original-file: 2026-07-01/VnetConnections_Get.json + */ + /** + * Sample code: Get a VnetConnection. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getAVnetConnection(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.vnetConnections() + .getWithResponse("myRg", "testgroup", "myVnetConnection", com.azure.core.util.Context.NONE); + } +} +``` + +### VnetConnections_ListBySandboxGroup + +```java +/** + * Samples for VnetConnections ListBySandboxGroup. + */ +public final class VnetConnectionsListBySandboxGroupSamples { + /* + * x-ms-original-file: 2026-07-01/VnetConnections_ListBySandboxGroup.json + */ + /** + * Sample code: List VnetConnections by SandboxGroup. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listVnetConnectionsBySandboxGroup(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.vnetConnections().listBySandboxGroup("myRg", "testgroup", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml b/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml index 3841a7d3ae7c..ba9215c1deff 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml @@ -1,9 +1,9 @@ - + 4.0.0 com.azure @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-appcontainers - 1.3.0-beta.1 + 1.3.0 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. Logic app is an extension resource on container app and the extension resource enables logic specific operations on the container app through the APIs listed. Package tag package-2025-07-01. + 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 api-version 2026-07-01. https://github.com/Azure/azure-sdk-for-java 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 9030d4ccf52a..06de7c238bd0 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers; @@ -25,6 +25,7 @@ import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsApiClient; +import com.azure.resourcemanager.appcontainers.implementation.AvailableEnvironmentModesImpl; import com.azure.resourcemanager.appcontainers.implementation.AvailableWorkloadProfilesImpl; import com.azure.resourcemanager.appcontainers.implementation.BillingMetersImpl; import com.azure.resourcemanager.appcontainers.implementation.CertificatesImpl; @@ -32,15 +33,23 @@ import com.azure.resourcemanager.appcontainers.implementation.ConnectedEnvironmentsDaprComponentsImpl; import com.azure.resourcemanager.appcontainers.implementation.ConnectedEnvironmentsImpl; import com.azure.resourcemanager.appcontainers.implementation.ConnectedEnvironmentsStoragesImpl; +import com.azure.resourcemanager.appcontainers.implementation.ContainerAppPrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.appcontainers.implementation.ContainerAppPrivateLinkResourcesImpl; import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsApiClientBuilder; import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsAuthConfigsImpl; import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsDiagnosticsImpl; +import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsFunctionsImpl; import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsImpl; +import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsLabelHistoriesImpl; +import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsRevisionFunctionsImpl; 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.DotNetComponentsImpl; +import com.azure.resourcemanager.appcontainers.implementation.FunctionsExtensionsImpl; import com.azure.resourcemanager.appcontainers.implementation.HttpRouteConfigsImpl; import com.azure.resourcemanager.appcontainers.implementation.JavaComponentsImpl; import com.azure.resourcemanager.appcontainers.implementation.JobsExecutionsImpl; @@ -58,7 +67,10 @@ import com.azure.resourcemanager.appcontainers.implementation.NamespacesImpl; import com.azure.resourcemanager.appcontainers.implementation.OperationsImpl; import com.azure.resourcemanager.appcontainers.implementation.ResourceProvidersImpl; +import com.azure.resourcemanager.appcontainers.implementation.SandboxGroupsImpl; import com.azure.resourcemanager.appcontainers.implementation.UsagesImpl; +import com.azure.resourcemanager.appcontainers.implementation.VnetConnectionsImpl; +import com.azure.resourcemanager.appcontainers.models.AvailableEnvironmentModes; import com.azure.resourcemanager.appcontainers.models.AvailableWorkloadProfiles; import com.azure.resourcemanager.appcontainers.models.BillingMeters; import com.azure.resourcemanager.appcontainers.models.Certificates; @@ -66,14 +78,22 @@ import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentsCertificates; import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentsDaprComponents; import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentsStorages; +import com.azure.resourcemanager.appcontainers.models.ContainerAppPrivateEndpointConnections; +import com.azure.resourcemanager.appcontainers.models.ContainerAppPrivateLinkResources; import com.azure.resourcemanager.appcontainers.models.ContainerApps; import com.azure.resourcemanager.appcontainers.models.ContainerAppsAuthConfigs; import com.azure.resourcemanager.appcontainers.models.ContainerAppsDiagnostics; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsFunctions; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsLabelHistories; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsRevisionFunctions; 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.DotNetComponents; +import com.azure.resourcemanager.appcontainers.models.FunctionsExtensions; import com.azure.resourcemanager.appcontainers.models.HttpRouteConfigs; import com.azure.resourcemanager.appcontainers.models.JavaComponents; import com.azure.resourcemanager.appcontainers.models.Jobs; @@ -91,7 +111,9 @@ import com.azure.resourcemanager.appcontainers.models.Namespaces; import com.azure.resourcemanager.appcontainers.models.Operations; import com.azure.resourcemanager.appcontainers.models.ResourceProviders; +import com.azure.resourcemanager.appcontainers.models.SandboxGroups; import com.azure.resourcemanager.appcontainers.models.Usages; +import com.azure.resourcemanager.appcontainers.models.VnetConnections; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -102,76 +124,99 @@ /** * Entry point to ContainerAppsApiManager. - * Logic app is an extension resource on container app and the extension resource enables logic specific operations on - * the container app through the APIs listed. + * 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 ContainerAppsAuthConfigs containerAppsAuthConfigs; + private ResourceProviders resourceProviders; - private AvailableWorkloadProfiles availableWorkloadProfiles; + private Operations operations; - private BillingMeters billingMeters; + private ContainerAppsSessionPools containerAppsSessionPools; - private ConnectedEnvironments connectedEnvironments; + private SandboxGroups sandboxGroups; - private ConnectedEnvironmentsCertificates connectedEnvironmentsCertificates; + private VnetConnections vnetConnections; - private ConnectedEnvironmentsDaprComponents connectedEnvironmentsDaprComponents; - - private ConnectedEnvironmentsStorages connectedEnvironmentsStorages; + private ContainerAppsSourceControls containerAppsSourceControls; private ContainerApps containerApps; + private ContainerAppsFunctions containerAppsFunctions; + private ContainerAppsRevisions containerAppsRevisions; - private ContainerAppsRevisionReplicas containerAppsRevisionReplicas; + private FunctionsExtensions functionsExtensions; - private ContainerAppsDiagnostics containerAppsDiagnostics; + private ContainerAppsLabelHistories containerAppsLabelHistories; - private ManagedEnvironmentDiagnostics managedEnvironmentDiagnostics; + private ContainerAppsRevisionReplicas containerAppsRevisionReplicas; - private ManagedEnvironmentsDiagnostics managedEnvironmentsDiagnostics; + private DotNetComponents dotNetComponents; - private Jobs jobs; + private JavaComponents javaComponents; - private Operations operations; + private LogicApps logicApps; - private JavaComponents javaComponents; + private ContainerAppsAuthConfigs containerAppsAuthConfigs; - private JobsExecutions jobsExecutions; + private ConnectedEnvironments connectedEnvironments; - private ResourceProviders resourceProviders; + private Certificates certificates; private ManagedEnvironments managedEnvironments; - private Certificates certificates; + private ConnectedEnvironmentsDaprComponents connectedEnvironmentsDaprComponents; + + private DaprComponents daprComponents; + + private ConnectedEnvironmentsStorages connectedEnvironmentsStorages; private ManagedCertificates managedCertificates; - private Namespaces namespaces; + private ContainerAppPrivateEndpointConnections containerAppPrivateEndpointConnections; - private ManagedEnvironmentPrivateEndpointConnections managedEnvironmentPrivateEndpointConnections; + private ContainerAppPrivateLinkResources containerAppPrivateLinkResources; private ManagedEnvironmentPrivateLinkResources managedEnvironmentPrivateLinkResources; - private DaprComponents daprComponents; - - private HttpRouteConfigs httpRouteConfigs; + private DaprComponentResiliencyPolicies daprComponentResiliencyPolicies; private MaintenanceConfigurations maintenanceConfigurations; private ManagedEnvironmentsStorages managedEnvironmentsStorages; - private ContainerAppsSessionPools containerAppsSessionPools; + private Jobs jobs; - private ContainerAppsSourceControls containerAppsSourceControls; + private ContainerAppsDiagnostics containerAppsDiagnostics; + + private ManagedEnvironmentsDiagnostics managedEnvironmentsDiagnostics; + + private ContainerAppsRevisionFunctions containerAppsRevisionFunctions; + + private ConnectedEnvironmentsCertificates connectedEnvironmentsCertificates; + + private Namespaces namespaces; + + private ManagedEnvironmentPrivateEndpointConnections managedEnvironmentPrivateEndpointConnections; + + private HttpRouteConfigs httpRouteConfigs; + + private JobsExecutions jobsExecutions; + + private ManagedEnvironmentDiagnostics managedEnvironmentDiagnostics; + + private AvailableWorkloadProfiles availableWorkloadProfiles; + + private AvailableEnvironmentModes availableEnvironmentModes; + + private BillingMeters billingMeters; private Usages usages; private ManagedEnvironmentUsages managedEnvironmentUsages; - private LogicApps logicApps; - private final ContainerAppsApiClient clientObject; private ContainerAppsApiManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -388,92 +433,77 @@ public ContainerAppsApiManager authenticate(TokenCredential credential, AzurePro } /** - * Gets the resource collection API of ContainerAppsAuthConfigs. It manages AuthConfig. - * - * @return Resource collection API of ContainerAppsAuthConfigs. - */ - public ContainerAppsAuthConfigs containerAppsAuthConfigs() { - if (this.containerAppsAuthConfigs == null) { - this.containerAppsAuthConfigs - = new ContainerAppsAuthConfigsImpl(clientObject.getContainerAppsAuthConfigs(), this); - } - return containerAppsAuthConfigs; - } - - /** - * Gets the resource collection API of AvailableWorkloadProfiles. + * Gets the resource collection API of ResourceProviders. * - * @return Resource collection API of AvailableWorkloadProfiles. + * @return Resource collection API of ResourceProviders. */ - public AvailableWorkloadProfiles availableWorkloadProfiles() { - if (this.availableWorkloadProfiles == null) { - this.availableWorkloadProfiles - = new AvailableWorkloadProfilesImpl(clientObject.getAvailableWorkloadProfiles(), this); + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); } - return availableWorkloadProfiles; + return resourceProviders; } /** - * Gets the resource collection API of BillingMeters. + * Gets the resource collection API of Operations. * - * @return Resource collection API of BillingMeters. + * @return Resource collection API of Operations. */ - public BillingMeters billingMeters() { - if (this.billingMeters == null) { - this.billingMeters = new BillingMetersImpl(clientObject.getBillingMeters(), this); + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); } - return billingMeters; + return operations; } /** - * Gets the resource collection API of ConnectedEnvironments. It manages ConnectedEnvironment. + * Gets the resource collection API of ContainerAppsSessionPools. It manages SessionPool. * - * @return Resource collection API of ConnectedEnvironments. + * @return Resource collection API of ContainerAppsSessionPools. */ - public ConnectedEnvironments connectedEnvironments() { - if (this.connectedEnvironments == null) { - this.connectedEnvironments = new ConnectedEnvironmentsImpl(clientObject.getConnectedEnvironments(), this); + public ContainerAppsSessionPools containerAppsSessionPools() { + if (this.containerAppsSessionPools == null) { + this.containerAppsSessionPools + = new ContainerAppsSessionPoolsImpl(clientObject.getContainerAppsSessionPools(), this); } - return connectedEnvironments; + return containerAppsSessionPools; } /** - * Gets the resource collection API of ConnectedEnvironmentsCertificates. It manages Certificate. + * Gets the resource collection API of SandboxGroups. It manages SandboxGroup. * - * @return Resource collection API of ConnectedEnvironmentsCertificates. + * @return Resource collection API of SandboxGroups. */ - public ConnectedEnvironmentsCertificates connectedEnvironmentsCertificates() { - if (this.connectedEnvironmentsCertificates == null) { - this.connectedEnvironmentsCertificates - = new ConnectedEnvironmentsCertificatesImpl(clientObject.getConnectedEnvironmentsCertificates(), this); + public SandboxGroups sandboxGroups() { + if (this.sandboxGroups == null) { + this.sandboxGroups = new SandboxGroupsImpl(clientObject.getSandboxGroups(), this); } - return connectedEnvironmentsCertificates; + return sandboxGroups; } /** - * Gets the resource collection API of ConnectedEnvironmentsDaprComponents. It manages DaprComponent. + * Gets the resource collection API of VnetConnections. It manages VnetConnection. * - * @return Resource collection API of ConnectedEnvironmentsDaprComponents. + * @return Resource collection API of VnetConnections. */ - public ConnectedEnvironmentsDaprComponents connectedEnvironmentsDaprComponents() { - if (this.connectedEnvironmentsDaprComponents == null) { - this.connectedEnvironmentsDaprComponents = new ConnectedEnvironmentsDaprComponentsImpl( - clientObject.getConnectedEnvironmentsDaprComponents(), this); + public VnetConnections vnetConnections() { + if (this.vnetConnections == null) { + this.vnetConnections = new VnetConnectionsImpl(clientObject.getVnetConnections(), this); } - return connectedEnvironmentsDaprComponents; + return vnetConnections; } /** - * Gets the resource collection API of ConnectedEnvironmentsStorages. It manages ConnectedEnvironmentStorage. + * Gets the resource collection API of ContainerAppsSourceControls. It manages SourceControl. * - * @return Resource collection API of ConnectedEnvironmentsStorages. + * @return Resource collection API of ContainerAppsSourceControls. */ - public ConnectedEnvironmentsStorages connectedEnvironmentsStorages() { - if (this.connectedEnvironmentsStorages == null) { - this.connectedEnvironmentsStorages - = new ConnectedEnvironmentsStoragesImpl(clientObject.getConnectedEnvironmentsStorages(), this); + public ContainerAppsSourceControls containerAppsSourceControls() { + if (this.containerAppsSourceControls == null) { + this.containerAppsSourceControls + = new ContainerAppsSourceControlsImpl(clientObject.getContainerAppsSourceControls(), this); } - return connectedEnvironmentsStorages; + return containerAppsSourceControls; } /** @@ -488,6 +518,19 @@ public ContainerApps containerApps() { return containerApps; } + /** + * Gets the resource collection API of ContainerAppsFunctions. + * + * @return Resource collection API of ContainerAppsFunctions. + */ + public ContainerAppsFunctions containerAppsFunctions() { + if (this.containerAppsFunctions == null) { + this.containerAppsFunctions + = new ContainerAppsFunctionsImpl(clientObject.getContainerAppsFunctions(), this); + } + return containerAppsFunctions; + } + /** * Gets the resource collection API of ContainerAppsRevisions. * @@ -501,6 +544,31 @@ public ContainerAppsRevisions containerAppsRevisions() { return containerAppsRevisions; } + /** + * 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 ContainerAppsLabelHistories. + * + * @return Resource collection API of ContainerAppsLabelHistories. + */ + public ContainerAppsLabelHistories containerAppsLabelHistories() { + if (this.containerAppsLabelHistories == null) { + this.containerAppsLabelHistories + = new ContainerAppsLabelHistoriesImpl(clientObject.getContainerAppsLabelHistories(), this); + } + return containerAppsLabelHistories; + } + /** * Gets the resource collection API of ContainerAppsRevisionReplicas. * @@ -515,126 +583,126 @@ public ContainerAppsRevisionReplicas containerAppsRevisionReplicas() { } /** - * Gets the resource collection API of ContainerAppsDiagnostics. + * Gets the resource collection API of DotNetComponents. It manages DotNetComponent. * - * @return Resource collection API of ContainerAppsDiagnostics. + * @return Resource collection API of DotNetComponents. */ - public ContainerAppsDiagnostics containerAppsDiagnostics() { - if (this.containerAppsDiagnostics == null) { - this.containerAppsDiagnostics - = new ContainerAppsDiagnosticsImpl(clientObject.getContainerAppsDiagnostics(), this); + public DotNetComponents dotNetComponents() { + if (this.dotNetComponents == null) { + this.dotNetComponents = new DotNetComponentsImpl(clientObject.getDotNetComponents(), this); } - return containerAppsDiagnostics; + return dotNetComponents; } /** - * Gets the resource collection API of ManagedEnvironmentDiagnostics. + * Gets the resource collection API of JavaComponents. It manages JavaComponent. * - * @return Resource collection API of ManagedEnvironmentDiagnostics. + * @return Resource collection API of JavaComponents. */ - public ManagedEnvironmentDiagnostics managedEnvironmentDiagnostics() { - if (this.managedEnvironmentDiagnostics == null) { - this.managedEnvironmentDiagnostics - = new ManagedEnvironmentDiagnosticsImpl(clientObject.getManagedEnvironmentDiagnostics(), this); + public JavaComponents javaComponents() { + if (this.javaComponents == null) { + this.javaComponents = new JavaComponentsImpl(clientObject.getJavaComponents(), this); } - return managedEnvironmentDiagnostics; + return javaComponents; } /** - * Gets the resource collection API of ManagedEnvironmentsDiagnostics. + * Gets the resource collection API of LogicApps. It manages LogicApp. * - * @return Resource collection API of ManagedEnvironmentsDiagnostics. + * @return Resource collection API of LogicApps. */ - public ManagedEnvironmentsDiagnostics managedEnvironmentsDiagnostics() { - if (this.managedEnvironmentsDiagnostics == null) { - this.managedEnvironmentsDiagnostics - = new ManagedEnvironmentsDiagnosticsImpl(clientObject.getManagedEnvironmentsDiagnostics(), this); + public LogicApps logicApps() { + if (this.logicApps == null) { + this.logicApps = new LogicAppsImpl(clientObject.getLogicApps(), this); } - return managedEnvironmentsDiagnostics; + return logicApps; } /** - * Gets the resource collection API of Jobs. It manages Job. + * Gets the resource collection API of ContainerAppsAuthConfigs. It manages AuthConfig. * - * @return Resource collection API of Jobs. + * @return Resource collection API of ContainerAppsAuthConfigs. */ - public Jobs jobs() { - if (this.jobs == null) { - this.jobs = new JobsImpl(clientObject.getJobs(), this); + public ContainerAppsAuthConfigs containerAppsAuthConfigs() { + if (this.containerAppsAuthConfigs == null) { + this.containerAppsAuthConfigs + = new ContainerAppsAuthConfigsImpl(clientObject.getContainerAppsAuthConfigs(), this); } - return jobs; + return containerAppsAuthConfigs; } /** - * Gets the resource collection API of Operations. + * Gets the resource collection API of ConnectedEnvironments. It manages ConnectedEnvironment. * - * @return Resource collection API of Operations. + * @return Resource collection API of ConnectedEnvironments. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); + public ConnectedEnvironments connectedEnvironments() { + if (this.connectedEnvironments == null) { + this.connectedEnvironments = new ConnectedEnvironmentsImpl(clientObject.getConnectedEnvironments(), this); } - return operations; + return connectedEnvironments; } /** - * Gets the resource collection API of JavaComponents. It manages JavaComponent. + * Gets the resource collection API of Certificates. * - * @return Resource collection API of JavaComponents. + * @return Resource collection API of Certificates. */ - public JavaComponents javaComponents() { - if (this.javaComponents == null) { - this.javaComponents = new JavaComponentsImpl(clientObject.getJavaComponents(), this); + public Certificates certificates() { + if (this.certificates == null) { + this.certificates = new CertificatesImpl(clientObject.getCertificates(), this); } - return javaComponents; + return certificates; } /** - * Gets the resource collection API of JobsExecutions. + * Gets the resource collection API of ManagedEnvironments. It manages ManagedEnvironment. * - * @return Resource collection API of JobsExecutions. + * @return Resource collection API of ManagedEnvironments. */ - public JobsExecutions jobsExecutions() { - if (this.jobsExecutions == null) { - this.jobsExecutions = new JobsExecutionsImpl(clientObject.getJobsExecutions(), this); + public ManagedEnvironments managedEnvironments() { + if (this.managedEnvironments == null) { + this.managedEnvironments = new ManagedEnvironmentsImpl(clientObject.getManagedEnvironments(), this); } - return jobsExecutions; + return managedEnvironments; } /** - * Gets the resource collection API of ResourceProviders. + * Gets the resource collection API of ConnectedEnvironmentsDaprComponents. It manages DaprComponent. * - * @return Resource collection API of ResourceProviders. + * @return Resource collection API of ConnectedEnvironmentsDaprComponents. */ - public ResourceProviders resourceProviders() { - if (this.resourceProviders == null) { - this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + public ConnectedEnvironmentsDaprComponents connectedEnvironmentsDaprComponents() { + if (this.connectedEnvironmentsDaprComponents == null) { + this.connectedEnvironmentsDaprComponents = new ConnectedEnvironmentsDaprComponentsImpl( + clientObject.getConnectedEnvironmentsDaprComponents(), this); } - return resourceProviders; + return connectedEnvironmentsDaprComponents; } /** - * Gets the resource collection API of ManagedEnvironments. It manages ManagedEnvironment. + * Gets the resource collection API of DaprComponents. * - * @return Resource collection API of ManagedEnvironments. + * @return Resource collection API of DaprComponents. */ - public ManagedEnvironments managedEnvironments() { - if (this.managedEnvironments == null) { - this.managedEnvironments = new ManagedEnvironmentsImpl(clientObject.getManagedEnvironments(), this); + public DaprComponents daprComponents() { + if (this.daprComponents == null) { + this.daprComponents = new DaprComponentsImpl(clientObject.getDaprComponents(), this); } - return managedEnvironments; + return daprComponents; } /** - * Gets the resource collection API of Certificates. + * Gets the resource collection API of ConnectedEnvironmentsStorages. It manages ConnectedEnvironmentStorage. * - * @return Resource collection API of Certificates. + * @return Resource collection API of ConnectedEnvironmentsStorages. */ - public Certificates certificates() { - if (this.certificates == null) { - this.certificates = new CertificatesImpl(clientObject.getCertificates(), this); + public ConnectedEnvironmentsStorages connectedEnvironmentsStorages() { + if (this.connectedEnvironmentsStorages == null) { + this.connectedEnvironmentsStorages + = new ConnectedEnvironmentsStoragesImpl(clientObject.getConnectedEnvironmentsStorages(), this); } - return certificates; + return connectedEnvironmentsStorages; } /** @@ -650,29 +718,29 @@ public ManagedCertificates managedCertificates() { } /** - * Gets the resource collection API of Namespaces. + * Gets the resource collection API of ContainerAppPrivateEndpointConnections. * - * @return Resource collection API of Namespaces. + * @return Resource collection API of ContainerAppPrivateEndpointConnections. */ - public Namespaces namespaces() { - if (this.namespaces == null) { - this.namespaces = new NamespacesImpl(clientObject.getNamespaces(), this); + public ContainerAppPrivateEndpointConnections containerAppPrivateEndpointConnections() { + if (this.containerAppPrivateEndpointConnections == null) { + this.containerAppPrivateEndpointConnections = new ContainerAppPrivateEndpointConnectionsImpl( + clientObject.getContainerAppPrivateEndpointConnections(), this); } - return namespaces; + return containerAppPrivateEndpointConnections; } /** - * Gets the resource collection API of ManagedEnvironmentPrivateEndpointConnections. It manages - * PrivateEndpointConnection. + * Gets the resource collection API of ContainerAppPrivateLinkResources. * - * @return Resource collection API of ManagedEnvironmentPrivateEndpointConnections. + * @return Resource collection API of ContainerAppPrivateLinkResources. */ - public ManagedEnvironmentPrivateEndpointConnections managedEnvironmentPrivateEndpointConnections() { - if (this.managedEnvironmentPrivateEndpointConnections == null) { - this.managedEnvironmentPrivateEndpointConnections = new ManagedEnvironmentPrivateEndpointConnectionsImpl( - clientObject.getManagedEnvironmentPrivateEndpointConnections(), this); + public ContainerAppPrivateLinkResources containerAppPrivateLinkResources() { + if (this.containerAppPrivateLinkResources == null) { + this.containerAppPrivateLinkResources + = new ContainerAppPrivateLinkResourcesImpl(clientObject.getContainerAppPrivateLinkResources(), this); } - return managedEnvironmentPrivateEndpointConnections; + return containerAppPrivateLinkResources; } /** @@ -689,27 +757,16 @@ public ManagedEnvironmentPrivateLinkResources managedEnvironmentPrivateLinkResou } /** - * Gets the resource collection API of DaprComponents. - * - * @return Resource collection API of DaprComponents. - */ - public DaprComponents daprComponents() { - if (this.daprComponents == null) { - this.daprComponents = new DaprComponentsImpl(clientObject.getDaprComponents(), this); - } - return daprComponents; - } - - /** - * Gets the resource collection API of HttpRouteConfigs. It manages HttpRouteConfig. + * Gets the resource collection API of DaprComponentResiliencyPolicies. It manages DaprComponentResiliencyPolicy. * - * @return Resource collection API of HttpRouteConfigs. + * @return Resource collection API of DaprComponentResiliencyPolicies. */ - public HttpRouteConfigs httpRouteConfigs() { - if (this.httpRouteConfigs == null) { - this.httpRouteConfigs = new HttpRouteConfigsImpl(clientObject.getHttpRouteConfigs(), this); + public DaprComponentResiliencyPolicies daprComponentResiliencyPolicies() { + if (this.daprComponentResiliencyPolicies == null) { + this.daprComponentResiliencyPolicies + = new DaprComponentResiliencyPoliciesImpl(clientObject.getDaprComponentResiliencyPolicies(), this); } - return httpRouteConfigs; + return daprComponentResiliencyPolicies; } /** @@ -739,29 +796,168 @@ public ManagedEnvironmentsStorages managedEnvironmentsStorages() { } /** - * Gets the resource collection API of ContainerAppsSessionPools. It manages SessionPool. + * Gets the resource collection API of Jobs. It manages Job. * - * @return Resource collection API of ContainerAppsSessionPools. + * @return Resource collection API of Jobs. */ - public ContainerAppsSessionPools containerAppsSessionPools() { - if (this.containerAppsSessionPools == null) { - this.containerAppsSessionPools - = new ContainerAppsSessionPoolsImpl(clientObject.getContainerAppsSessionPools(), this); + public Jobs jobs() { + if (this.jobs == null) { + this.jobs = new JobsImpl(clientObject.getJobs(), this); } - return containerAppsSessionPools; + return jobs; } /** - * Gets the resource collection API of ContainerAppsSourceControls. It manages SourceControl. + * Gets the resource collection API of ContainerAppsDiagnostics. * - * @return Resource collection API of ContainerAppsSourceControls. + * @return Resource collection API of ContainerAppsDiagnostics. */ - public ContainerAppsSourceControls containerAppsSourceControls() { - if (this.containerAppsSourceControls == null) { - this.containerAppsSourceControls - = new ContainerAppsSourceControlsImpl(clientObject.getContainerAppsSourceControls(), this); + public ContainerAppsDiagnostics containerAppsDiagnostics() { + if (this.containerAppsDiagnostics == null) { + this.containerAppsDiagnostics + = new ContainerAppsDiagnosticsImpl(clientObject.getContainerAppsDiagnostics(), this); } - return containerAppsSourceControls; + return containerAppsDiagnostics; + } + + /** + * Gets the resource collection API of ManagedEnvironmentsDiagnostics. + * + * @return Resource collection API of ManagedEnvironmentsDiagnostics. + */ + public ManagedEnvironmentsDiagnostics managedEnvironmentsDiagnostics() { + if (this.managedEnvironmentsDiagnostics == null) { + this.managedEnvironmentsDiagnostics + = new ManagedEnvironmentsDiagnosticsImpl(clientObject.getManagedEnvironmentsDiagnostics(), this); + } + return managedEnvironmentsDiagnostics; + } + + /** + * Gets the resource collection API of ContainerAppsRevisionFunctions. + * + * @return Resource collection API of ContainerAppsRevisionFunctions. + */ + public ContainerAppsRevisionFunctions containerAppsRevisionFunctions() { + if (this.containerAppsRevisionFunctions == null) { + this.containerAppsRevisionFunctions + = new ContainerAppsRevisionFunctionsImpl(clientObject.getContainerAppsRevisionFunctions(), this); + } + return containerAppsRevisionFunctions; + } + + /** + * Gets the resource collection API of ConnectedEnvironmentsCertificates. It manages Certificate. + * + * @return Resource collection API of ConnectedEnvironmentsCertificates. + */ + public ConnectedEnvironmentsCertificates connectedEnvironmentsCertificates() { + if (this.connectedEnvironmentsCertificates == null) { + this.connectedEnvironmentsCertificates + = new ConnectedEnvironmentsCertificatesImpl(clientObject.getConnectedEnvironmentsCertificates(), this); + } + return connectedEnvironmentsCertificates; + } + + /** + * Gets the resource collection API of Namespaces. + * + * @return Resource collection API of Namespaces. + */ + public Namespaces namespaces() { + if (this.namespaces == null) { + this.namespaces = new NamespacesImpl(clientObject.getNamespaces(), this); + } + 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 HttpRouteConfigs. It manages HttpRouteConfig. + * + * @return Resource collection API of HttpRouteConfigs. + */ + public HttpRouteConfigs httpRouteConfigs() { + if (this.httpRouteConfigs == null) { + this.httpRouteConfigs = new HttpRouteConfigsImpl(clientObject.getHttpRouteConfigs(), this); + } + return httpRouteConfigs; + } + + /** + * Gets the resource collection API of JobsExecutions. + * + * @return Resource collection API of JobsExecutions. + */ + public JobsExecutions jobsExecutions() { + if (this.jobsExecutions == null) { + this.jobsExecutions = new JobsExecutionsImpl(clientObject.getJobsExecutions(), this); + } + return jobsExecutions; + } + + /** + * Gets the resource collection API of ManagedEnvironmentDiagnostics. + * + * @return Resource collection API of ManagedEnvironmentDiagnostics. + */ + public ManagedEnvironmentDiagnostics managedEnvironmentDiagnostics() { + if (this.managedEnvironmentDiagnostics == null) { + this.managedEnvironmentDiagnostics + = new ManagedEnvironmentDiagnosticsImpl(clientObject.getManagedEnvironmentDiagnostics(), this); + } + return managedEnvironmentDiagnostics; + } + + /** + * Gets the resource collection API of AvailableWorkloadProfiles. + * + * @return Resource collection API of AvailableWorkloadProfiles. + */ + public AvailableWorkloadProfiles availableWorkloadProfiles() { + if (this.availableWorkloadProfiles == null) { + this.availableWorkloadProfiles + = new AvailableWorkloadProfilesImpl(clientObject.getAvailableWorkloadProfiles(), this); + } + return availableWorkloadProfiles; + } + + /** + * Gets the resource collection API of AvailableEnvironmentModes. + * + * @return Resource collection API of AvailableEnvironmentModes. + */ + public AvailableEnvironmentModes availableEnvironmentModes() { + if (this.availableEnvironmentModes == null) { + this.availableEnvironmentModes + = new AvailableEnvironmentModesImpl(clientObject.getAvailableEnvironmentModes(), this); + } + return availableEnvironmentModes; + } + + /** + * Gets the resource collection API of BillingMeters. + * + * @return Resource collection API of BillingMeters. + */ + public BillingMeters billingMeters() { + if (this.billingMeters == null) { + this.billingMeters = new BillingMetersImpl(clientObject.getBillingMeters(), this); + } + return billingMeters; } /** @@ -789,18 +985,6 @@ public ManagedEnvironmentUsages managedEnvironmentUsages() { return managedEnvironmentUsages; } - /** - * 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 wrapped service client ContainerAppsApiClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/AvailableEnvironmentModesClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/AvailableEnvironmentModesClient.java new file mode 100644 index 000000000000..29cffb805d3e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/AvailableEnvironmentModesClient.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.AvailableEnvironmentModeInner; + +/** + * An instance of this class provides access to all the operations defined in AvailableEnvironmentModesClient. + */ +public interface AvailableEnvironmentModesClient { + /** + * Get available environment modes by location. + * + * Gets the environment modes available to a subscription in a location. + * + * @param location The name of the Azure region. + * @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 available environment modes by location. + * + * Gets the environment modes available to a subscription in a location as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * Get available environment modes by location. + * + * Gets the environment modes available to a subscription in a location. + * + * @param location The name of the Azure region. + * @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 available environment modes by location. + * + * Gets the environment modes available to a subscription in a location as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/AvailableWorkloadProfilesClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/AvailableWorkloadProfilesClient.java index 07b54b046db8..4a2e68fb8ab2 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/AvailableWorkloadProfilesClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/AvailableWorkloadProfilesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -19,11 +19,13 @@ public interface AvailableWorkloadProfilesClient { * * Get all available workload profiles for a location. * - * @param location The name of Azure region. + * @param location The name of the Azure region. * @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 all available workload profiles for a location as paginated response with {@link PagedIterable}. + * @return available workload profiles by location. + * + * Get all available workload profiles for a location as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable get(String location); @@ -33,12 +35,14 @@ public interface AvailableWorkloadProfilesClient { * * Get all available workload profiles for a location. * - * @param location The name of Azure region. + * @param location The name of the Azure region. * @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 all available workload profiles for a location as paginated response with {@link PagedIterable}. + * @return available workload profiles by location. + * + * Get all available workload profiles for a location as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable get(String location, Context context); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/BillingMetersClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/BillingMetersClient.java index 114cdeccd72f..3f30f4b6a66d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/BillingMetersClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/BillingMetersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -19,13 +19,15 @@ public interface BillingMetersClient { * * Get all billingMeters for a location. * - * @param location The name of Azure region. + * @param location The name of the Azure region. * @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 all billingMeters for a location along with {@link Response}. + * @return billing meters by location. + * + * Get all billingMeters for a location along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String location, Context context); @@ -35,12 +37,14 @@ public interface BillingMetersClient { * * Get all billingMeters for a location. * - * @param location The name of Azure region. + * @param location The name of the Azure region. * @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 all billingMeters for a location. + * @return billing meters by location. + * + * Get all billingMeters for a location. */ @ServiceMethod(returns = ReturnType.SINGLE) BillingMeterCollectionInner get(String location); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/CertificatesClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/CertificatesClient.java index 5963e2aaa823..aa6c69797146 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/CertificatesClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/CertificatesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -17,99 +17,104 @@ */ public interface CertificatesClient { /** - * Get the Certificates in a given managed environment. + * Get the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. + * @param certificateName Name of the Certificate. + * @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 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 Certificates in a given managed environment as paginated response with {@link PagedIterable}. + * @return the specified Certificate along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String environmentName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String environmentName, String certificateName, + Context context); /** - * Get the Certificates in a given managed environment. + * Get the specified Certificate. * * @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. + * @param certificateName Name of the Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. + * @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 Certificates in a given managed environment as paginated response with {@link PagedIterable}. + * @return the specified Certificate. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String environmentName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + CertificateInner get(String resourceGroupName, String environmentName, String certificateName); /** - * Get the specified Certificate. + * Create or Update a Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Certificate to be created or updated. * @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 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 specified Certificate along with {@link Response}. + * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String environmentName, String certificateName, - Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, + String certificateName, CertificateInner certificateEnvelope, Context context); /** - * Get the specified Certificate. + * Create or Update a Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. + * @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 specified Certificate. + * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment. */ @ServiceMethod(returns = ReturnType.SINGLE) - CertificateInner get(String resourceGroupName, String environmentName, String certificateName); + CertificateInner createOrUpdate(String resourceGroupName, String environmentName, String certificateName); /** - * Create or Update a Certificate. + * Update properties of a certificate + * + * Patches a certificate. Currently only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. - * @param certificateEnvelope Certificate to be created or updated. + * @param certificateEnvelope Properties of a certificate that need to be updated. * @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 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 certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, - String certificateName, CertificateInner certificateEnvelope, Context context); + Response updateWithResponse(String resourceGroupName, String environmentName, + String certificateName, CertificatePatch certificateEnvelope, Context context); /** - * Create or Update a Certificate. + * Update properties of a certificate + * + * Patches a certificate. Currently only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Properties of a certificate that need to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. + * @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 certificate used for Custom Domain bindings of Container Apps in a Managed Environment. */ @ServiceMethod(returns = ReturnType.SINGLE) - CertificateInner createOrUpdate(String resourceGroupName, String environmentName, String certificateName); + CertificateInner update(String resourceGroupName, String environmentName, String certificateName, + CertificatePatch certificateEnvelope); /** * Deletes the specified Certificate. @@ -119,8 +124,7 @@ Response createOrUpdateWithResponse(String resourceGroupName, * @param certificateName Name of the Certificate. * @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 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 Response}. */ @@ -135,50 +139,36 @@ Response deleteWithResponse(String resourceGroupName, String environmentNa * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. + * @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 certificateName); /** - * Update properties of a certificate - * - * Patches a certificate. Currently only patching of tags is supported. + * Get the Certificates in 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 certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need to be updated. - * @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 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 certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with - * {@link Response}. + * @return the Certificates in a given managed environment as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String environmentName, - String certificateName, CertificatePatch certificateEnvelope, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName); /** - * Update properties of a certificate - * - * Patches a certificate. Currently only patching of tags is supported. + * Get the Certificates in 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 certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need to be updated. + * @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 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 certificate used for Custom Domain bindings of Container Apps in a Managed Environment. + * @return the Certificates in a given managed environment as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - CertificateInner update(String resourceGroupName, String environmentName, String certificateName, - CertificatePatch certificateEnvelope); + @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/ConnectedEnvironmentsCertificatesClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ConnectedEnvironmentsCertificatesClient.java index 1ecbffea37fb..9ae1c82b1fac 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ConnectedEnvironmentsCertificatesClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ConnectedEnvironmentsCertificatesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -18,33 +18,6 @@ * An instance of this class provides access to all the operations defined in ConnectedEnvironmentsCertificatesClient. */ public interface ConnectedEnvironmentsCertificatesClient { - /** - * Get the Certificates in a given connected environment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Connected 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 Certificates in a given connected environment as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String connectedEnvironmentName); - - /** - * Get the Certificates in a given connected environment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Connected 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 Certificates in a given connected environment as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String connectedEnvironmentName, Context context); - /** * Get the specified Certificate. * @@ -141,136 +114,163 @@ CertificateInner createOrUpdate(String resourceGroupName, String connectedEnviro CertificateInner certificateEnvelope, Context context); /** - * Deletes the specified Certificate. + * Update properties of a certificate + * + * Patches a certificate. Currently only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Properties of a certificate that need 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 long-running operation. + * @return the {@link SyncPoller} for polling of certificate used for Custom Domain bindings of Container Apps in a + * Managed Environment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String connectedEnvironmentName, - String certificateName); + SyncPoller, CertificateInner> beginUpdate(String resourceGroupName, + String connectedEnvironmentName, String certificateName, CertificatePatch certificateEnvelope); /** - * Deletes the specified Certificate. + * Update properties of a certificate + * + * Patches a certificate. Currently only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Properties of a certificate that need 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 long-running operation. + * @return the {@link SyncPoller} for polling of certificate used for Custom Domain bindings of Container Apps in a + * Managed Environment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String connectedEnvironmentName, - String certificateName, Context context); + SyncPoller, CertificateInner> beginUpdate(String resourceGroupName, + String connectedEnvironmentName, String certificateName, CertificatePatch certificateEnvelope, Context context); /** - * Deletes the specified Certificate. + * Update properties of a certificate + * + * Patches a certificate. Currently only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Properties of a certificate that need 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 certificate used for Custom Domain bindings of Container Apps in a Managed Environment. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String connectedEnvironmentName, String certificateName); + CertificateInner update(String resourceGroupName, String connectedEnvironmentName, String certificateName, + CertificatePatch certificateEnvelope); /** - * Deletes the specified Certificate. + * Update properties of a certificate + * + * Patches a certificate. Currently only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Properties of a certificate that need 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 certificate used for Custom Domain bindings of Container Apps in a Managed Environment. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String connectedEnvironmentName, String certificateName, Context context); + CertificateInner update(String resourceGroupName, String connectedEnvironmentName, String certificateName, + CertificatePatch certificateEnvelope, Context context); /** - * Update properties of a certificate - * - * Patches a certificate. Currently only patching of tags is supported. + * Deletes the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need 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 certificate used for Custom Domain bindings of Container Apps in a - * Managed Environment. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CertificateInner> beginUpdate(String resourceGroupName, - String connectedEnvironmentName, String certificateName, CertificatePatch certificateEnvelope); + SyncPoller, Void> beginDelete(String resourceGroupName, String connectedEnvironmentName, + String certificateName); /** - * Update properties of a certificate - * - * Patches a certificate. Currently only patching of tags is supported. + * Deletes the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need 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 certificate used for Custom Domain bindings of Container Apps in a - * Managed Environment. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CertificateInner> beginUpdate(String resourceGroupName, - String connectedEnvironmentName, String certificateName, CertificatePatch certificateEnvelope, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String connectedEnvironmentName, + String certificateName, Context context); /** - * Update properties of a certificate - * - * Patches a certificate. Currently only patching of tags is supported. + * Deletes the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need 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 certificate used for Custom Domain bindings of Container Apps in a Managed Environment. */ @ServiceMethod(returns = ReturnType.SINGLE) - CertificateInner update(String resourceGroupName, String connectedEnvironmentName, String certificateName, - CertificatePatch certificateEnvelope); + void delete(String resourceGroupName, String connectedEnvironmentName, String certificateName); /** - * Update properties of a certificate - * - * Patches a certificate. Currently only patching of tags is supported. + * Deletes the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need 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 certificate used for Custom Domain bindings of Container Apps in a Managed Environment. */ @ServiceMethod(returns = ReturnType.SINGLE) - CertificateInner update(String resourceGroupName, String connectedEnvironmentName, String certificateName, - CertificatePatch certificateEnvelope, Context context); + void delete(String resourceGroupName, String connectedEnvironmentName, String certificateName, Context context); + + /** + * Get the Certificates in a given connected environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the Connected 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 Certificates in a given connected environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String connectedEnvironmentName); + + /** + * Get the Certificates in a given connected environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the Connected 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 Certificates in a given connected environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String connectedEnvironmentName, Context context); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ConnectedEnvironmentsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ConnectedEnvironmentsClient.java index b6785c779d26..0f9509fe05b4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ConnectedEnvironmentsClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ConnectedEnvironmentsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -20,57 +20,6 @@ * An instance of this class provides access to all the operations defined in ConnectedEnvironmentsClient. */ public interface ConnectedEnvironmentsClient { - /** - * Get all connectedEnvironments for a 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 all connectedEnvironments for a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get all connectedEnvironments for a 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 all connectedEnvironments for a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Get all connectedEnvironments in a 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.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 all connectedEnvironments in a resource group as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Get all connectedEnvironments in a 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.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 all connectedEnvironments in a resource group as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - /** * Get the properties of an connectedEnvironment. * @@ -170,6 +119,44 @@ ConnectedEnvironmentInner createOrUpdate(String resourceGroupName, String connec ConnectedEnvironmentInner createOrUpdate(String resourceGroupName, String connectedEnvironmentName, ConnectedEnvironmentInner environmentEnvelope, Context context); + /** + * Update connected Environment's properties. + * + * Patches a Managed Environment. Only patching of tags is supported currently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connectedEnvironment. + * @param environmentEnvelope Configuration details of the connectedEnvironment. + * @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 an environment for Kubernetes cluster specialized for web workloads by Azure App Service along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String connectedEnvironmentName, + ConnectedEnvironmentPatchResource environmentEnvelope, Context context); + + /** + * Update connected Environment's properties. + * + * Patches a Managed Environment. Only patching of tags is supported currently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connectedEnvironment. + * @param environmentEnvelope Configuration details of the connectedEnvironment. + * @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 an environment for Kubernetes cluster specialized for web workloads by Azure App Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectedEnvironmentInner update(String resourceGroupName, String connectedEnvironmentName, + ConnectedEnvironmentPatchResource environmentEnvelope); + /** * Delete an connectedEnvironment. * @@ -228,42 +215,55 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String void delete(String resourceGroupName, String connectedEnvironmentName, Context context); /** - * Update connected Environment's properties. + * Get all connectedEnvironments in a resource group. * - * Patches a Managed Environment. Only patching of tags is supported currently. + * @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 all connectedEnvironments in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get all connectedEnvironments in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connectedEnvironment. - * @param environmentEnvelope Configuration details of the connectedEnvironment. * @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 an environment for Kubernetes cluster specialized for web workloads by Azure App Service along with - * {@link Response}. + * @return all connectedEnvironments in a resource group as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String connectedEnvironmentName, - ConnectedEnvironmentPatchResource environmentEnvelope, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Update connected Environment's properties. + * Get all connectedEnvironments for a subscription. * - * Patches a Managed Environment. Only patching of tags is supported currently. + * @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 all connectedEnvironments for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get all connectedEnvironments for a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connectedEnvironment. - * @param environmentEnvelope Configuration details of the connectedEnvironment. + * @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 an environment for Kubernetes cluster specialized for web workloads by Azure App Service. + * @return all connectedEnvironments for a subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectedEnvironmentInner update(String resourceGroupName, String connectedEnvironmentName, - ConnectedEnvironmentPatchResource environmentEnvelope); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); /** * Checks the resource connectedEnvironmentName availability. @@ -271,7 +271,7 @@ ConnectedEnvironmentInner update(String resourceGroupName, String connectedEnvir * Checks if resource connectedEnvironmentName is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Managed Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param checkNameAvailabilityRequest The check connectedEnvironmentName availability request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -290,7 +290,7 @@ Response checkNameAvailabilityWithResponse(S * Checks if resource connectedEnvironmentName is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Managed Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param checkNameAvailabilityRequest The check connectedEnvironmentName availability request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ConnectedEnvironmentsDaprComponentsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ConnectedEnvironmentsDaprComponentsClient.java index 86c56ba45058..0df1eb436995 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ConnectedEnvironmentsDaprComponentsClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ConnectedEnvironmentsDaprComponentsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -18,35 +18,6 @@ * An instance of this class provides access to all the operations defined in ConnectedEnvironmentsDaprComponentsClient. */ public interface ConnectedEnvironmentsDaprComponentsClient { - /** - * Get the Dapr Components for a connected environment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected 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 Components for a connected environment as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String connectedEnvironmentName); - - /** - * Get the Dapr Components for a connected environment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected 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 Components for a connected environment as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String connectedEnvironmentName, Context context); - /** * Get a dapr component. * @@ -85,7 +56,7 @@ Response getWithResponse(String resourceGroupName, String co * Creates or updates a Dapr Component in a connected environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param componentName Name of the Dapr Component. * @param daprComponentEnvelope Configuration details of the Dapr Component. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -103,7 +74,7 @@ SyncPoller, DaprComponentInner> beginCreateOrUpda * Creates or updates a Dapr Component in a connected environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param componentName Name of the Dapr Component. * @param daprComponentEnvelope Configuration details of the Dapr Component. * @param context The context to associate with this operation. @@ -123,7 +94,7 @@ SyncPoller, DaprComponentInner> beginCreateOrUpda * Creates or updates a Dapr Component in a connected environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param componentName Name of the Dapr Component. * @param daprComponentEnvelope Configuration details of the Dapr Component. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -141,7 +112,7 @@ DaprComponentInner createOrUpdate(String resourceGroupName, String connectedEnvi * Creates or updates a Dapr Component in a connected environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param componentName Name of the Dapr Component. * @param daprComponentEnvelope Configuration details of the Dapr Component. * @param context The context to associate with this operation. @@ -220,6 +191,35 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String connectedEnvironmentName, String componentName, Context context); + /** + * Get the Dapr Components for a connected environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connected 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 Components for a connected environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String connectedEnvironmentName); + + /** + * Get the Dapr Components for a connected environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connected 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 Components for a connected environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String connectedEnvironmentName, Context context); + /** * List secrets for a dapr component. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ConnectedEnvironmentsStoragesClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ConnectedEnvironmentsStoragesClient.java index f90afb1cd96e..e1823b7b3355 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ConnectedEnvironmentsStoragesClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ConnectedEnvironmentsStoragesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -17,41 +17,11 @@ * An instance of this class provides access to all the operations defined in ConnectedEnvironmentsStoragesClient. */ public interface ConnectedEnvironmentsStoragesClient { - /** - * Get all storages for a connectedEnvironment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the 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 all storages for a connectedEnvironment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String resourceGroupName, - String connectedEnvironmentName, Context context); - - /** - * Get all storages for a connectedEnvironment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the 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 all storages for a connectedEnvironment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectedEnvironmentStoragesCollectionInner list(String resourceGroupName, String connectedEnvironmentName); - /** * Get storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -68,7 +38,7 @@ Response getWithResponse(String resourceGroupN * Get storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request @@ -83,7 +53,7 @@ Response getWithResponse(String resourceGroupN * Create or update storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param storageEnvelope Configuration details of storage. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -100,7 +70,7 @@ SyncPoller, ConnectedEnvironmentSto * Create or update storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param storageEnvelope Configuration details of storage. * @param context The context to associate with this operation. @@ -118,7 +88,7 @@ SyncPoller, ConnectedEnvironmentSto * Create or update storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param storageEnvelope Configuration details of storage. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -134,7 +104,7 @@ ConnectedEnvironmentStorageInner createOrUpdate(String resourceGroupName, String * Create or update storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param storageEnvelope Configuration details of storage. * @param context The context to associate with this operation. @@ -151,7 +121,7 @@ ConnectedEnvironmentStorageInner createOrUpdate(String resourceGroupName, String * Delete storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -166,7 +136,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * Delete storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -182,7 +152,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * Delete storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -195,7 +165,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * Delete storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -204,4 +174,34 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String connectedEnvironmentName, String storageName, Context context); + + /** + * Get all storages for a connectedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connectedEnvironment. + * @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 all storages for a connectedEnvironment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, + String connectedEnvironmentName, Context context); + + /** + * Get all storages for a connectedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connectedEnvironment. + * @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 all storages for a connectedEnvironment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectedEnvironmentStoragesCollectionInner list(String resourceGroupName, String connectedEnvironmentName); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppPrivateEndpointConnectionsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppPrivateEndpointConnectionsClient.java new file mode 100644 index 000000000000..c19c6ba2878b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppPrivateEndpointConnectionsClient.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 + * ContainerAppPrivateEndpointConnectionsClient. + */ +public interface ContainerAppPrivateEndpointConnectionsClient { + /** + * Get a private endpoint connection for a given Container App. + * + * Gets the details of a private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 Container App. + * + * Gets the details of a private endpoint connection associated with a Container App along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String containerAppName, + String privateEndpointConnectionName, Context context); + + /** + * Get a private endpoint connection for a given Container App. + * + * Gets the details of a private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 Container App. + * + * Gets the details of a private endpoint connection associated with a Container App. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get(String resourceGroupName, String containerAppName, + String privateEndpointConnectionName); + + /** + * Update the state of a private endpoint connection for a given Container App. + * + * Creates a private endpoint connection or updates its connection state 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 privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 containerAppName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnectionEnvelope); + + /** + * Update the state of a private endpoint connection for a given Container App. + * + * Creates a private endpoint connection or updates its connection state 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 privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 containerAppName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, Context context); + + /** + * Update the state of a private endpoint connection for a given Container App. + * + * Creates a private endpoint connection or updates its connection state 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 privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 containerAppName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope); + + /** + * Update the state of a private endpoint connection for a given Container App. + * + * Creates a private endpoint connection or updates its connection state 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 privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 containerAppName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, + Context context); + + /** + * Delete a private endpoint connection for a given Container App. + * + * Deletes the specified private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 privateEndpointConnectionName); + + /** + * Delete a private endpoint connection for a given Container App. + * + * Deletes the specified private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 privateEndpointConnectionName, Context context); + + /** + * Delete a private endpoint connection for a given Container App. + * + * Deletes the specified private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 privateEndpointConnectionName); + + /** + * Delete a private endpoint connection for a given Container App. + * + * Deletes the specified private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 privateEndpointConnectionName, + Context context); + + /** + * List private endpoint connections for a given Container App. + * + * Lists all private endpoint connections associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @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 PrivateEndpointConnection list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String containerAppName); + + /** + * List private endpoint connections for a given Container App. + * + * Lists all private endpoint connections associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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.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 PrivateEndpointConnection 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/ContainerAppPrivateLinkResourcesClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppPrivateLinkResourcesClient.java new file mode 100644 index 000000000000..711d3eb087bc --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppPrivateLinkResourcesClient.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.PrivateLinkResourceInner; + +/** + * An instance of this class provides access to all the operations defined in ContainerAppPrivateLinkResourcesClient. + */ +public interface ContainerAppPrivateLinkResourcesClient { + /** + * List private link resources for a given Container App. + * + * Lists the private link resources supported by a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @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 link resources for a managed environment as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String containerAppName); + + /** + * List private link resources for a given Container App. + * + * Lists the private link resources supported by a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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.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 link resources for a managed environment as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String containerAppName, Context context); + + /** + * Get a private link resource for a given Container App. + * + * Gets the details of a private link resource supported by a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateLinkResourceName The name of the private link 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 link resource for a given Container App. + * + * Gets the details of a private link resource supported by a Container App along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String containerAppName, + String privateLinkResourceName, Context context); + + /** + * Get a private link resource for a given Container App. + * + * Gets the details of a private link resource supported by a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateLinkResourceName The name of the private link 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 link resource for a given Container App. + * + * Gets the details of a private link resource supported by a Container App. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner get(String resourceGroupName, String containerAppName, String privateLinkResourceName); +} 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 ecbb56d2e988..8ee8abdc89f7 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -12,26 +12,26 @@ */ public interface ContainerAppsApiClient { /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * @@ -47,60 +47,60 @@ public interface ContainerAppsApiClient { Duration getDefaultPollInterval(); /** - * Gets the ContainerAppsAuthConfigsClient object to access its operations. + * Gets the ResourceProvidersClient object to access its operations. * - * @return the ContainerAppsAuthConfigsClient object. + * @return the ResourceProvidersClient object. */ - ContainerAppsAuthConfigsClient getContainerAppsAuthConfigs(); + ResourceProvidersClient getResourceProviders(); /** - * Gets the AvailableWorkloadProfilesClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the AvailableWorkloadProfilesClient object. + * @return the OperationsClient object. */ - AvailableWorkloadProfilesClient getAvailableWorkloadProfiles(); + OperationsClient getOperations(); /** - * Gets the BillingMetersClient object to access its operations. + * Gets the ContainerAppsSessionPoolsClient object to access its operations. * - * @return the BillingMetersClient object. + * @return the ContainerAppsSessionPoolsClient object. */ - BillingMetersClient getBillingMeters(); + ContainerAppsSessionPoolsClient getContainerAppsSessionPools(); /** - * Gets the ConnectedEnvironmentsClient object to access its operations. + * Gets the SandboxGroupsClient object to access its operations. * - * @return the ConnectedEnvironmentsClient object. + * @return the SandboxGroupsClient object. */ - ConnectedEnvironmentsClient getConnectedEnvironments(); + SandboxGroupsClient getSandboxGroups(); /** - * Gets the ConnectedEnvironmentsCertificatesClient object to access its operations. + * Gets the VnetConnectionsClient object to access its operations. * - * @return the ConnectedEnvironmentsCertificatesClient object. + * @return the VnetConnectionsClient object. */ - ConnectedEnvironmentsCertificatesClient getConnectedEnvironmentsCertificates(); + VnetConnectionsClient getVnetConnections(); /** - * Gets the ConnectedEnvironmentsDaprComponentsClient object to access its operations. + * Gets the ContainerAppsSourceControlsClient object to access its operations. * - * @return the ConnectedEnvironmentsDaprComponentsClient object. + * @return the ContainerAppsSourceControlsClient object. */ - ConnectedEnvironmentsDaprComponentsClient getConnectedEnvironmentsDaprComponents(); + ContainerAppsSourceControlsClient getContainerAppsSourceControls(); /** - * Gets the ConnectedEnvironmentsStoragesClient object to access its operations. + * Gets the ContainerAppsClient object to access its operations. * - * @return the ConnectedEnvironmentsStoragesClient object. + * @return the ContainerAppsClient object. */ - ConnectedEnvironmentsStoragesClient getConnectedEnvironmentsStorages(); + ContainerAppsClient getContainerApps(); /** - * Gets the ContainerAppsClient object to access its operations. + * Gets the ContainerAppsFunctionsClient object to access its operations. * - * @return the ContainerAppsClient object. + * @return the ContainerAppsFunctionsClient object. */ - ContainerAppsClient getContainerApps(); + ContainerAppsFunctionsClient getContainerAppsFunctions(); /** * Gets the ContainerAppsRevisionsClient object to access its operations. @@ -110,67 +110,67 @@ public interface ContainerAppsApiClient { ContainerAppsRevisionsClient getContainerAppsRevisions(); /** - * Gets the ContainerAppsRevisionReplicasClient object to access its operations. + * Gets the FunctionsExtensionsClient object to access its operations. * - * @return the ContainerAppsRevisionReplicasClient object. + * @return the FunctionsExtensionsClient object. */ - ContainerAppsRevisionReplicasClient getContainerAppsRevisionReplicas(); + FunctionsExtensionsClient getFunctionsExtensions(); /** - * Gets the ContainerAppsDiagnosticsClient object to access its operations. + * Gets the ContainerAppsLabelHistoriesClient object to access its operations. * - * @return the ContainerAppsDiagnosticsClient object. + * @return the ContainerAppsLabelHistoriesClient object. */ - ContainerAppsDiagnosticsClient getContainerAppsDiagnostics(); + ContainerAppsLabelHistoriesClient getContainerAppsLabelHistories(); /** - * Gets the ManagedEnvironmentDiagnosticsClient object to access its operations. + * Gets the ContainerAppsRevisionReplicasClient object to access its operations. * - * @return the ManagedEnvironmentDiagnosticsClient object. + * @return the ContainerAppsRevisionReplicasClient object. */ - ManagedEnvironmentDiagnosticsClient getManagedEnvironmentDiagnostics(); + ContainerAppsRevisionReplicasClient getContainerAppsRevisionReplicas(); /** - * Gets the ManagedEnvironmentsDiagnosticsClient object to access its operations. + * Gets the DotNetComponentsClient object to access its operations. * - * @return the ManagedEnvironmentsDiagnosticsClient object. + * @return the DotNetComponentsClient object. */ - ManagedEnvironmentsDiagnosticsClient getManagedEnvironmentsDiagnostics(); + DotNetComponentsClient getDotNetComponents(); /** - * Gets the JobsClient object to access its operations. + * Gets the JavaComponentsClient object to access its operations. * - * @return the JobsClient object. + * @return the JavaComponentsClient object. */ - JobsClient getJobs(); + JavaComponentsClient getJavaComponents(); /** - * Gets the OperationsClient object to access its operations. + * Gets the LogicAppsClient object to access its operations. * - * @return the OperationsClient object. + * @return the LogicAppsClient object. */ - OperationsClient getOperations(); + LogicAppsClient getLogicApps(); /** - * Gets the JavaComponentsClient object to access its operations. + * Gets the ContainerAppsAuthConfigsClient object to access its operations. * - * @return the JavaComponentsClient object. + * @return the ContainerAppsAuthConfigsClient object. */ - JavaComponentsClient getJavaComponents(); + ContainerAppsAuthConfigsClient getContainerAppsAuthConfigs(); /** - * Gets the JobsExecutionsClient object to access its operations. + * Gets the ConnectedEnvironmentsClient object to access its operations. * - * @return the JobsExecutionsClient object. + * @return the ConnectedEnvironmentsClient object. */ - JobsExecutionsClient getJobsExecutions(); + ConnectedEnvironmentsClient getConnectedEnvironments(); /** - * Gets the ResourceProvidersClient object to access its operations. + * Gets the CertificatesClient object to access its operations. * - * @return the ResourceProvidersClient object. + * @return the CertificatesClient object. */ - ResourceProvidersClient getResourceProviders(); + CertificatesClient getCertificates(); /** * Gets the ManagedEnvironmentsClient object to access its operations. @@ -180,11 +180,25 @@ public interface ContainerAppsApiClient { ManagedEnvironmentsClient getManagedEnvironments(); /** - * Gets the CertificatesClient object to access its operations. + * Gets the ConnectedEnvironmentsDaprComponentsClient object to access its operations. * - * @return the CertificatesClient object. + * @return the ConnectedEnvironmentsDaprComponentsClient object. */ - CertificatesClient getCertificates(); + ConnectedEnvironmentsDaprComponentsClient getConnectedEnvironmentsDaprComponents(); + + /** + * Gets the DaprComponentsClient object to access its operations. + * + * @return the DaprComponentsClient object. + */ + DaprComponentsClient getDaprComponents(); + + /** + * Gets the ConnectedEnvironmentsStoragesClient object to access its operations. + * + * @return the ConnectedEnvironmentsStoragesClient object. + */ + ConnectedEnvironmentsStoragesClient getConnectedEnvironmentsStorages(); /** * Gets the ManagedCertificatesClient object to access its operations. @@ -194,18 +208,18 @@ public interface ContainerAppsApiClient { ManagedCertificatesClient getManagedCertificates(); /** - * Gets the NamespacesClient object to access its operations. + * Gets the ContainerAppPrivateEndpointConnectionsClient object to access its operations. * - * @return the NamespacesClient object. + * @return the ContainerAppPrivateEndpointConnectionsClient object. */ - NamespacesClient getNamespaces(); + ContainerAppPrivateEndpointConnectionsClient getContainerAppPrivateEndpointConnections(); /** - * Gets the ManagedEnvironmentPrivateEndpointConnectionsClient object to access its operations. + * Gets the ContainerAppPrivateLinkResourcesClient object to access its operations. * - * @return the ManagedEnvironmentPrivateEndpointConnectionsClient object. + * @return the ContainerAppPrivateLinkResourcesClient object. */ - ManagedEnvironmentPrivateEndpointConnectionsClient getManagedEnvironmentPrivateEndpointConnections(); + ContainerAppPrivateLinkResourcesClient getContainerAppPrivateLinkResources(); /** * Gets the ManagedEnvironmentPrivateLinkResourcesClient object to access its operations. @@ -215,11 +229,74 @@ public interface ContainerAppsApiClient { ManagedEnvironmentPrivateLinkResourcesClient getManagedEnvironmentPrivateLinkResources(); /** - * Gets the DaprComponentsClient object to access its operations. + * Gets the DaprComponentResiliencyPoliciesClient object to access its operations. * - * @return the DaprComponentsClient object. + * @return the DaprComponentResiliencyPoliciesClient object. */ - DaprComponentsClient getDaprComponents(); + DaprComponentResiliencyPoliciesClient getDaprComponentResiliencyPolicies(); + + /** + * Gets the MaintenanceConfigurationsClient object to access its operations. + * + * @return the MaintenanceConfigurationsClient object. + */ + MaintenanceConfigurationsClient getMaintenanceConfigurations(); + + /** + * Gets the ManagedEnvironmentsStoragesClient object to access its operations. + * + * @return the ManagedEnvironmentsStoragesClient object. + */ + ManagedEnvironmentsStoragesClient getManagedEnvironmentsStorages(); + + /** + * Gets the JobsClient object to access its operations. + * + * @return the JobsClient object. + */ + JobsClient getJobs(); + + /** + * Gets the ContainerAppsDiagnosticsClient object to access its operations. + * + * @return the ContainerAppsDiagnosticsClient object. + */ + ContainerAppsDiagnosticsClient getContainerAppsDiagnostics(); + + /** + * Gets the ManagedEnvironmentsDiagnosticsClient object to access its operations. + * + * @return the ManagedEnvironmentsDiagnosticsClient object. + */ + ManagedEnvironmentsDiagnosticsClient getManagedEnvironmentsDiagnostics(); + + /** + * Gets the ContainerAppsRevisionFunctionsClient object to access its operations. + * + * @return the ContainerAppsRevisionFunctionsClient object. + */ + ContainerAppsRevisionFunctionsClient getContainerAppsRevisionFunctions(); + + /** + * Gets the ConnectedEnvironmentsCertificatesClient object to access its operations. + * + * @return the ConnectedEnvironmentsCertificatesClient object. + */ + ConnectedEnvironmentsCertificatesClient getConnectedEnvironmentsCertificates(); + + /** + * Gets the NamespacesClient object to access its operations. + * + * @return the NamespacesClient object. + */ + NamespacesClient getNamespaces(); + + /** + * Gets the ManagedEnvironmentPrivateEndpointConnectionsClient object to access its operations. + * + * @return the ManagedEnvironmentPrivateEndpointConnectionsClient object. + */ + ManagedEnvironmentPrivateEndpointConnectionsClient getManagedEnvironmentPrivateEndpointConnections(); /** * Gets the HttpRouteConfigsClient object to access its operations. @@ -229,32 +306,39 @@ public interface ContainerAppsApiClient { HttpRouteConfigsClient getHttpRouteConfigs(); /** - * Gets the MaintenanceConfigurationsClient object to access its operations. + * Gets the JobsExecutionsClient object to access its operations. * - * @return the MaintenanceConfigurationsClient object. + * @return the JobsExecutionsClient object. */ - MaintenanceConfigurationsClient getMaintenanceConfigurations(); + JobsExecutionsClient getJobsExecutions(); /** - * Gets the ManagedEnvironmentsStoragesClient object to access its operations. + * Gets the ManagedEnvironmentDiagnosticsClient object to access its operations. * - * @return the ManagedEnvironmentsStoragesClient object. + * @return the ManagedEnvironmentDiagnosticsClient object. */ - ManagedEnvironmentsStoragesClient getManagedEnvironmentsStorages(); + ManagedEnvironmentDiagnosticsClient getManagedEnvironmentDiagnostics(); /** - * Gets the ContainerAppsSessionPoolsClient object to access its operations. + * Gets the AvailableWorkloadProfilesClient object to access its operations. * - * @return the ContainerAppsSessionPoolsClient object. + * @return the AvailableWorkloadProfilesClient object. */ - ContainerAppsSessionPoolsClient getContainerAppsSessionPools(); + AvailableWorkloadProfilesClient getAvailableWorkloadProfiles(); /** - * Gets the ContainerAppsSourceControlsClient object to access its operations. + * Gets the AvailableEnvironmentModesClient object to access its operations. * - * @return the ContainerAppsSourceControlsClient object. + * @return the AvailableEnvironmentModesClient object. */ - ContainerAppsSourceControlsClient getContainerAppsSourceControls(); + AvailableEnvironmentModesClient getAvailableEnvironmentModes(); + + /** + * Gets the BillingMetersClient object to access its operations. + * + * @return the BillingMetersClient object. + */ + BillingMetersClient getBillingMeters(); /** * Gets the UsagesClient object to access its operations. @@ -269,11 +353,4 @@ public interface ContainerAppsApiClient { * @return the ManagedEnvironmentUsagesClient object. */ ManagedEnvironmentUsagesClient getManagedEnvironmentUsages(); - - /** - * Gets the LogicAppsClient object to access its operations. - * - * @return the LogicAppsClient object. - */ - LogicAppsClient getLogicApps(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsAuthConfigsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsAuthConfigsClient.java index c28af17f98d3..2fa996ff7ac4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsAuthConfigsClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsAuthConfigsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -15,36 +15,6 @@ * An instance of this class provides access to all the operations defined in ContainerAppsAuthConfigsClient. */ public interface ContainerAppsAuthConfigsClient { - /** - * Get the Container App AuthConfigs in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName 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 the Container App AuthConfigs in a given resource group as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByContainerApp(String resourceGroupName, String containerAppName); - - /** - * Get the Container App AuthConfigs in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName 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 the Container App AuthConfigs in a given resource group as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, - Context context); - /** * Get a AuthConfig of a Container App. * @@ -143,4 +113,34 @@ Response deleteWithResponse(String resourceGroupName, String containerAppN */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String containerAppName, String authConfigName); + + /** + * Get the Container App AuthConfigs in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the Container App AuthConfigs in a given resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByContainerApp(String resourceGroupName, String containerAppName); + + /** + * Get the Container App AuthConfigs in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the Container App AuthConfigs in a given resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, + Context context); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsClient.java index 83db692d17af..f4ec3e4ea898 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -21,105 +21,124 @@ */ public interface ContainerAppsClient { /** - * Get the Container Apps in a given subscription. + * Get the properties of a Container App. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Container Apps in a given subscription as paginated response with {@link PagedIterable}. + * @return the properties of a Container App along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String containerAppName, + Context context); /** - * Get the Container Apps in a given subscription. + * Get the properties of a Container App. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Container Apps in a given subscription as paginated response with {@link PagedIterable}. + * @return the properties of a Container App. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerAppInner getByResourceGroup(String resourceGroupName, String containerAppName); /** - * Get the Container Apps in a given resource group. + * Create or update a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. * @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 Container Apps in a given resource group as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of container App. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerAppInner> beginCreateOrUpdate(String resourceGroupName, + String containerAppName, ContainerAppInner containerAppEnvelope); /** - * Get the Container Apps in a given resource group. + * Create or update a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. * @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 Container Apps in a given resource group as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of container App. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerAppInner> beginCreateOrUpdate(String resourceGroupName, + String containerAppName, ContainerAppInner containerAppEnvelope, Context context); /** - * Get the properties of a Container App. + * Create or update a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param context The context to associate with this operation. + * @param containerAppEnvelope Properties used to create a container app. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on - * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a Container App along with {@link Response}. + * @return container App. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String containerAppName, - Context context); + ContainerAppInner createOrUpdate(String resourceGroupName, String containerAppName, + ContainerAppInner containerAppEnvelope); /** - * Get the properties of a Container App. + * Create or update a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on - * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a Container App. + * @return container App. */ @ServiceMethod(returns = ReturnType.SINGLE) - ContainerAppInner getByResourceGroup(String resourceGroupName, String containerAppName); + ContainerAppInner createOrUpdate(String resourceGroupName, String containerAppName, + ContainerAppInner containerAppEnvelope, Context context); /** - * Create or update a Container App. + * Update properties of a Container App + * + * Patches a Container App using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties used to create a container app. + * @param containerAppEnvelope Properties of a Container App that need 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 container App. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ContainerAppInner> beginCreateOrUpdate(String resourceGroupName, + SyncPoller, ContainerAppInner> beginUpdate(String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope); /** - * Create or update a Container App. + * Update properties of a Container App + * + * Patches a Container App using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties used to create a container app. + * @param containerAppEnvelope Properties of a Container App that need 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. @@ -127,30 +146,33 @@ SyncPoller, ContainerAppInner> beginCreateOrUpdate * @return the {@link SyncPoller} for polling of container App. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ContainerAppInner> beginCreateOrUpdate(String resourceGroupName, + SyncPoller, ContainerAppInner> beginUpdate(String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope, Context context); /** - * Create or update a Container App. + * Update properties of a Container App + * + * Patches a Container App using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties used to create a container app. + * @param containerAppEnvelope Properties of a Container App that need 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 container App. */ @ServiceMethod(returns = ReturnType.SINGLE) - ContainerAppInner createOrUpdate(String resourceGroupName, String containerAppName, - ContainerAppInner containerAppEnvelope); + ContainerAppInner update(String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope); /** - * Create or update a Container App. + * Update properties of a Container App + * + * Patches a Container App using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties used to create a container app. + * @param containerAppEnvelope Properties of a Container App that need 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. @@ -158,8 +180,8 @@ ContainerAppInner createOrUpdate(String resourceGroupName, String containerAppNa * @return container App. */ @ServiceMethod(returns = ReturnType.SINGLE) - ContainerAppInner createOrUpdate(String resourceGroupName, String containerAppName, - ContainerAppInner containerAppEnvelope, Context context); + ContainerAppInner update(String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope, + Context context); /** * Delete a Container App. @@ -214,73 +236,51 @@ ContainerAppInner createOrUpdate(String resourceGroupName, String containerAppNa void delete(String resourceGroupName, String containerAppName, Context context); /** - * Update properties of a Container App - * - * Patches a Container App using JSON Merge Patch. + * Get the Container Apps in a given resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties of a Container App that need 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 container App. + * @return the Container Apps in a given resource group as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ContainerAppInner> beginUpdate(String resourceGroupName, - String containerAppName, ContainerAppInner containerAppEnvelope); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Update properties of a Container App - * - * Patches a Container App using JSON Merge Patch. + * Get the Container Apps in a given resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties of a Container App that need 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 container App. + * @return the Container Apps in a given resource group as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ContainerAppInner> beginUpdate(String resourceGroupName, - String containerAppName, ContainerAppInner containerAppEnvelope, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Update properties of a Container App - * - * Patches a Container App using JSON Merge Patch. + * Get the Container Apps in a given subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties of a Container App that need 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 container App. + * @return the Container Apps in a given subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ContainerAppInner update(String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Update properties of a Container App - * - * Patches a Container App using JSON Merge Patch. + * Get the Container Apps in a given subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties of a Container App that need 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 container App. + * @return the Container Apps in a given subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ContainerAppInner update(String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); /** * Analyzes a custom hostname for a Container App. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsDiagnosticsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsDiagnosticsClient.java index 6460fb251e7a..bf20747fa5d3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsDiagnosticsClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsDiagnosticsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -18,159 +18,167 @@ */ public interface ContainerAppsDiagnosticsClient { /** - * Get the list of diagnostics for a given Container App. + * Get a revision of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which detector info is needed. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the detector. + * @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 list of diagnostics for a given Container App as paginated response with {@link PagedIterable}. + * @return a revision of a Container App along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDetectors(String resourceGroupName, String containerAppName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getRevisionWithResponse(String resourceGroupName, String containerAppName, + String revisionName, Context context); /** - * Get the list of diagnostics for a given Container App. + * Get a revision of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which detector info is needed. - * @param context The context to associate with this operation. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the detector. * @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 list of diagnostics for a given Container App as paginated response with {@link PagedIterable}. + * @return a revision of a Container App. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDetectors(String resourceGroupName, String containerAppName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + RevisionInner getRevision(String resourceGroupName, String containerAppName, String revisionName); /** - * Get a diagnostics result of a Container App. + * Get the Revisions for a given Container App. + * + * A synchronous resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param detectorName Name of the Container App Detector. - * @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 diagnostics result of a Container App along with {@link Response}. + * @return the Revisions for a given Container App. + * + * A synchronous resource action as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getDetectorWithResponse(String resourceGroupName, String containerAppName, - String detectorName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRevisions(String resourceGroupName, String containerAppName); /** - * Get a diagnostics result of a Container App. + * Get the Revisions for a given Container App. + * + * A synchronous resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param detectorName Name of the Container App Detector. + * @param filter The filter to apply on the operation. + * @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 diagnostics result of a Container App. + * @return the Revisions for a given Container App. + * + * A synchronous resource action as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiagnosticsInner getDetector(String resourceGroupName, String containerAppName, String detectorName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRevisions(String resourceGroupName, String containerAppName, String filter, + Context context); /** - * Get the Revisions for a given Container App. + * Get the properties of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. + * @param containerAppName 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Revisions for a given Container App as paginated response with {@link PagedIterable}. + * @return the properties of a Container App along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listRevisions(String resourceGroupName, String containerAppName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getRootWithResponse(String resourceGroupName, String containerAppName, Context context); /** - * Get the Revisions for a given Container App. + * Get the properties of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. + * @param containerAppName 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Revisions for a given Container App as paginated response with {@link PagedIterable}. + * @return the properties of a Container App. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listRevisions(String resourceGroupName, String containerAppName, String filter, - Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerAppInner getRoot(String resourceGroupName, String containerAppName); /** - * Get a revision of a Container App. + * Get the list of diagnostics for a given 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. - * @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 revision of a Container App along with {@link Response}. + * @return the list of diagnostics for a given Container App as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getRevisionWithResponse(String resourceGroupName, String containerAppName, - String revisionName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDetectors(String resourceGroupName, String containerAppName); /** - * Get a revision of a Container App. + * Get the list of diagnostics for a given 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. + * @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 revision of a Container App. + * @return the list of diagnostics for a given Container App as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - RevisionInner getRevision(String resourceGroupName, String containerAppName, String revisionName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDetectors(String resourceGroupName, String containerAppName, Context context); /** - * Get the properties of a Container App. + * Get a diagnostics result of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. + * @param detectorName Name of the detector. * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on - * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a Container App along with {@link Response}. + * @return a diagnostics result of a Container App along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getRootWithResponse(String resourceGroupName, String containerAppName, Context context); + Response getDetectorWithResponse(String resourceGroupName, String containerAppName, + String detectorName, Context context); /** - * Get the properties of a Container App. + * Get a diagnostics result of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. + * @param detectorName Name of the detector. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on - * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a Container App. + * @return a diagnostics result of a Container App. */ @ServiceMethod(returns = ReturnType.SINGLE) - ContainerAppInner getRoot(String resourceGroupName, String containerAppName); + DiagnosticsInner getDetector(String resourceGroupName, String containerAppName, String detectorName); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsFunctionsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsFunctionsClient.java new file mode 100644 index 000000000000..44a1a80a6680 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsFunctionsClient.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ContainerAppsFunctionInner; + +/** + * An instance of this class provides access to all the operations defined in ContainerAppsFunctionsClient. + */ +public interface ContainerAppsFunctionsClient { + /** + * Get a specific function of a Container App from the latest Revision. + * + * Gets the details of a specific function from the latest Container App revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param functionName Name of the Function. + * @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 specific function of a Container App from the latest Revision. + * + * Gets the details of a specific function from the latest Container App revision along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String containerAppName, + String functionName, Context context); + + /** + * Get a specific function of a Container App from the latest Revision. + * + * Gets the details of a specific function from the latest Container App revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param functionName Name of the Function. + * @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 specific function of a Container App from the latest Revision. + * + * Gets the details of a specific function from the latest Container App revision. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerAppsFunctionInner get(String resourceGroupName, String containerAppName, String functionName); + + /** + * List the functions for a given Container App from the latest Revision. + * + * Lists the functions available in the latest revision of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 container App Functions collection ARM resource as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String containerAppName); + + /** + * List the functions for a given Container App from the latest Revision. + * + * Lists the functions available in the latest revision of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 container App Functions collection ARM resource 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/ContainerAppsLabelHistoriesClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsLabelHistoriesClient.java new file mode 100644 index 000000000000..f8557d93f5c5 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsLabelHistoriesClient.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.LabelHistoryInner; + +/** + * An instance of this class provides access to all the operations defined in ContainerAppsLabelHistoriesClient. + */ +public interface ContainerAppsLabelHistoriesClient { + /** + * Get the history of a label. + * + * Gets the revision history associated with a Container App label. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param labelName Name of the label. + * @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 history of a label. + * + * Gets the revision history associated with a Container App label along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getLabelHistoryWithResponse(String resourceGroupName, String containerAppName, + String labelName, Context context); + + /** + * Get the history of a label. + * + * Gets the revision history associated with a Container App label. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param labelName Name of the label. + * @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 history of a label. + * + * Gets the revision history associated with a Container App label. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LabelHistoryInner getLabelHistory(String resourceGroupName, String containerAppName, String labelName); + + /** + * Delete the history of a label. + * + * Deletes the revision history associated with a Container App label. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param labelName Name of the label. + * @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 deleteLabelHistoryWithResponse(String resourceGroupName, String containerAppName, String labelName, + Context context); + + /** + * Delete the history of a label. + * + * Deletes the revision history associated with a Container App label. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param labelName Name of the label. + * @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 deleteLabelHistory(String resourceGroupName, String containerAppName, String labelName); + + /** + * Get the Label History for a given Container App. + * + * Lists the label revision histories for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the Label History for a given Container App. + * + * Lists the label revision histories for a Container App as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listLabelHistory(String resourceGroupName, String containerAppName); + + /** + * Get the Label History for a given Container App. + * + * Lists the label revision histories 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 filter The filter to apply on the operation. + * @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 Label History for a given Container App. + * + * Lists the label revision histories for a Container App as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listLabelHistory(String resourceGroupName, String containerAppName, String filter, + Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsRevisionFunctionsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsRevisionFunctionsClient.java new file mode 100644 index 000000000000..871a8e1eb2da --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsRevisionFunctionsClient.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ContainerAppsFunctionInner; + +/** + * An instance of this class provides access to all the operations defined in ContainerAppsRevisionFunctionsClient. + */ +public interface ContainerAppsRevisionFunctionsClient { + /** + * Get a specific function of a Container App Revision. + * + * Gets the details of a specific function in a Container App revision. + * + * @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. + * @param functionName Name of the Function. + * @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 specific function of a Container App Revision. + * + * Gets the details of a specific function in a Container App revision along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String containerAppName, + String revisionName, String functionName, Context context); + + /** + * Get a specific function of a Container App Revision. + * + * Gets the details of a specific function in a Container App revision. + * + * @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. + * @param functionName Name of the Function. + * @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 specific function of a Container App Revision. + * + * Gets the details of a specific function in a Container App revision. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerAppsFunctionInner get(String resourceGroupName, String containerAppName, String revisionName, + String functionName); + + /** + * List the functions for a given Container App Revision. + * + * Lists the functions available in a specific Container App revision. + * + * @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. + * @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 Functions collection ARM resource as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String containerAppName, + String revisionName); + + /** + * List the functions for a given Container App Revision. + * + * Lists the functions available in a specific Container App revision. + * + * @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. + * @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 Functions collection ARM resource as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String containerAppName, + String revisionName, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsRevisionReplicasClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsRevisionReplicasClient.java index 05a7e08c569a..e7c8e2c49207 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsRevisionReplicasClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsRevisionReplicasClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsRevisionsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsRevisionsClient.java index c8079e70967d..98baabf040d3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsRevisionsClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsRevisionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -16,67 +16,67 @@ */ public interface ContainerAppsRevisionsClient { /** - * Get the Revisions for a given Container App. + * Get a revision of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. + * @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 Revisions for a given Container App as paginated response with {@link PagedIterable}. + * @return a revision of a Container App along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listRevisions(String resourceGroupName, String containerAppName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getRevisionWithResponse(String resourceGroupName, String containerAppName, + String revisionName, Context context); /** - * Get the Revisions for a given Container App. + * Get a revision of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. * @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 Revisions for a given Container App as paginated response with {@link PagedIterable}. + * @return a revision of a Container App. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listRevisions(String resourceGroupName, String containerAppName, String filter, - Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + RevisionInner getRevision(String resourceGroupName, String containerAppName, String revisionName); /** - * Get a revision of a Container App. + * Get the Revisions for a given 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. - * @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 revision of a Container App along with {@link Response}. + * @return the Revisions for a given Container App as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getRevisionWithResponse(String resourceGroupName, String containerAppName, - String revisionName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRevisions(String resourceGroupName, String containerAppName); /** - * Get a revision of a Container App. + * Get the Revisions for a given 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. + * @param filter The filter to apply on the operation. + * @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 revision of a Container App. + * @return the Revisions for a given Container App as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - RevisionInner getRevision(String resourceGroupName, String containerAppName, String revisionName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRevisions(String resourceGroupName, String containerAppName, String filter, + Context context); /** * Activates a revision for a Container App. 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 index f9893672ae57..da2140632d9f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -18,55 +18,6 @@ * 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.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 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.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 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.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 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.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 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. * @@ -294,4 +245,53 @@ SessionPoolInner update(String resourceGroupName, String sessionPoolName, */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String sessionPoolName, 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.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 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.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 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 session pools in a given subscription. + * + * @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 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.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 session pools in a given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(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 1d972a062004..5d626dc554d5 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -17,38 +17,6 @@ * An instance of this class provides access to all the operations defined in ContainerAppsSourceControlsClient. */ public interface ContainerAppsSourceControlsClient { - /** - * Get the Container App SourceControls in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName 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 the Container App SourceControls in a given resource group as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByContainerApp(String resourceGroupName, String containerAppName); - - /** - * Get the Container App SourceControls in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName 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 the Container App SourceControls in a given resource group as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, - Context context); - /** * Get a SourceControl of a Container App. * @@ -212,4 +180,36 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String containerAppName, String sourceControlName, Context context); + + /** + * Get the Container App SourceControls in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the Container App SourceControls in a given resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByContainerApp(String resourceGroupName, String containerAppName); + + /** + * Get the Container App SourceControls in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the Container App SourceControls in a given resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, + 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 000000000000..aa2ea10550f4 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/DaprComponentResiliencyPoliciesClient.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 a Dapr component resiliency policy. + * + * Gets the details of 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 a Dapr component resiliency policy. + * + * Gets the details of a resiliency policy for a Dapr component 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. + * + * Gets the details of 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. + * @return a Dapr component resiliency policy. + * + * Gets the details of a resiliency policy for a Dapr component. + */ + @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); + + /** + * Get the resiliency policies for a Dapr component. + * + * Lists the resiliency policies configured 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. + * + * Lists the resiliency policies configured 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. + * + * Lists the resiliency policies configured 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. + * + * Lists the resiliency policies configured for a Dapr component as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName, + String componentName, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/DaprComponentsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/DaprComponentsClient.java index cac5b28a2004..ad9b6bbab61c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/DaprComponentsClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/DaprComponentsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -16,35 +16,6 @@ * An instance of this class provides access to all the operations defined in DaprComponentsClient. */ public interface DaprComponentsClient { - /** - * Get the Dapr 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.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 Components for a managed environment as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String environmentName); - - /** - * Get the Dapr 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.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 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 dapr component. * @@ -151,6 +122,35 @@ Response deleteWithResponse(String resourceGroupName, String environmentNa @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String environmentName, String componentName); + /** + * Get the Dapr 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.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 Components for a managed environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName); + + /** + * Get the Dapr 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.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 Components for a managed environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName, Context context); + /** * List secrets for a dapr component. * 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 000000000000..e8c227c1f6c1 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/DotNetComponentsClient.java @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 a .NET Component. + * + * Gets the details of 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 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. + * + * Gets the details of a .NET component in a managed environment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String environmentName, String name, + Context context); + + /** + * Get a .NET Component. + * + * Gets the details of 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. + * @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. + * + * Gets the details of a .NET component in a managed environment. + */ + @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. + * + * Deletes a .NET component 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 .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. + * + * Deletes a .NET component 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 .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. + * + * Deletes a .NET component 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 .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. + * + * Deletes a .NET component 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 .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); + + /** + * Get the .NET Components for a managed environment. + * + * Lists the .NET components in 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. + * + * Lists the .NET components in 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. + * + * Lists the .NET components 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 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. + * + * Lists the .NET components in a managed environment 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/FunctionsExtensionsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/FunctionsExtensionsClient.java new file mode 100644 index 000000000000..450faecca7bb --- /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) TypeSpec 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. + * @param functionAppName Name of the Function. + * @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 sequence of textual characters 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. + * @param functionAppName Name of the Function. + * @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 sequence of textual characters. + */ + @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/HttpRouteConfigsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/HttpRouteConfigsClient.java index f08503b25603..c3f42f0f967f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/HttpRouteConfigsClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/HttpRouteConfigsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -20,15 +20,19 @@ public interface HttpRouteConfigsClient { /** * Get the specified Http Route Config. * + * Get the specified Managed Http Route Config. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. - * @param httpRouteName Name of the Http Route Config Resource. + * @param environmentName Name of the managed environment. + * @param httpRouteName Name of the Http Route Config. * @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 specified Http Route Config along with {@link Response}. + * @return the specified Http Route Config. + * + * Get the specified Managed Http Route Config along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String resourceGroupName, String environmentName, @@ -37,14 +41,18 @@ Response getWithResponse(String resourceGroupName, String /** * Get the specified Http Route Config. * + * Get the specified Managed Http Route Config. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. - * @param httpRouteName Name of the Http Route Config Resource. + * @param environmentName Name of the managed environment. + * @param httpRouteName Name of the Http Route Config. * @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 specified Http Route Config. + * + * Get the specified Managed Http Route Config. */ @ServiceMethod(returns = ReturnType.SINGLE) HttpRouteConfigInner get(String resourceGroupName, String environmentName, String httpRouteName); @@ -53,9 +61,9 @@ Response getWithResponse(String resourceGroupName, String * Create or Update a Http Route Config. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. - * @param httpRouteName Name of the Http Route Config Resource. - * @param httpRouteConfigEnvelope Http Route Config to be created or updated. + * @param environmentName Name of the managed environment. + * @param httpRouteName Name of the Http Route Config. + * @param httpRouteConfigEnvelope Http Route config to be created or updated. * @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 @@ -72,8 +80,8 @@ Response createOrUpdateWithResponse(String resourceGroupNa * Create or Update a Http Route Config. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. - * @param httpRouteName Name of the Http Route Config Resource. + * @param environmentName Name of the managed environment. + * @param httpRouteName Name of the Http Route Config. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. @@ -86,10 +94,10 @@ Response createOrUpdateWithResponse(String resourceGroupNa /** * Update tags of a Http Route Config object * - * Patches a Http Route Config resource. Only patching of tags is supported. + * Patches an http route config resource. Only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param httpRouteName Name of the Http Route Config Resource. * @param httpRouteConfigEnvelope Properties of http route config that need to be updated. * @param context The context to associate with this operation. @@ -107,10 +115,10 @@ Response updateWithResponse(String resourceGroupName, Stri /** * Update tags of a Http Route Config object * - * Patches a Http Route Config resource. Only patching of tags is supported. + * Patches an http route config resource. Only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param httpRouteName Name of the Http Route Config Resource. * @param httpRouteConfigEnvelope Properties of http route config that need to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -126,8 +134,10 @@ HttpRouteConfigInner update(String resourceGroupName, String environmentName, St /** * Deletes the specified Http Route Config. * + * Deletes the specified Managed Http Route. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param httpRouteName Name of the Http Route Config Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -141,8 +151,10 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Deletes the specified Http Route Config. * + * Deletes the specified Managed Http Route. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param httpRouteName Name of the Http Route Config Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -157,8 +169,10 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Deletes the specified Http Route Config. * + * Deletes the specified Managed Http Route. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param httpRouteName Name of the Http Route Config Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -170,8 +184,10 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Deletes the specified Http Route Config. * + * Deletes the specified Managed Http Route. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param httpRouteName Name of the Http Route Config Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -184,8 +200,10 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List the Http Route Configs in a given managed environment. * + * Get the Managed Http Routes in 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 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. @@ -198,8 +216,10 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List the Http Route Configs in a given managed environment. * + * Get the Managed Http Routes in 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 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 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 index 5b033c37f9e8..66b82657b2b1 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -17,38 +17,11 @@ * 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 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. @@ -64,7 +37,7 @@ Response getWithResponse(String resourceGroupName, String en * 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 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. @@ -80,7 +53,7 @@ Response getWithResponse(String resourceGroupName, String en * 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 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. @@ -98,7 +71,7 @@ SyncPoller, JavaComponentInner> beginCreateOrUpda * 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 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. @@ -117,7 +90,7 @@ SyncPoller, JavaComponentInner> beginCreateOrUpda * 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 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. @@ -135,7 +108,7 @@ JavaComponentInner createOrUpdate(String resourceGroupName, String environmentNa * 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 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. @@ -154,7 +127,7 @@ JavaComponentInner createOrUpdate(String resourceGroupName, String environmentNa * 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 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. @@ -172,7 +145,7 @@ SyncPoller, JavaComponentInner> beginUpdate(Strin * 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 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. @@ -191,7 +164,7 @@ SyncPoller, JavaComponentInner> beginUpdate(Strin * 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 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. @@ -209,7 +182,7 @@ JavaComponentInner update(String resourceGroupName, String environmentName, Stri * 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 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. @@ -228,7 +201,7 @@ JavaComponentInner update(String resourceGroupName, String environmentName, Stri * 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 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. @@ -244,7 +217,7 @@ JavaComponentInner update(String resourceGroupName, String environmentName, Stri * 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 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. @@ -262,7 +235,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * 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 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. @@ -277,7 +250,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * 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 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. @@ -286,4 +259,31 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String environmentName, String name, 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 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); } 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 e7a0a11a7835..a7a51f152cc1 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -24,9 +24,22 @@ */ public interface JobsClient { /** - * Get the list of diagnostics for a given Container App Job. + * Get the properties of a Container Apps Job. * - * Get the list of diagnostics for a Container App Job. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job 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 the properties of a Container Apps Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String jobName, Context context); + + /** + * Get the properties of a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. @@ -34,118 +47,202 @@ public interface JobsClient { * @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 list of diagnostics for a Container App Job as paginated response with {@link PagedIterable}. + * @return the properties of a Container Apps Job. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDetectors(String resourceGroupName, String jobName); + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner getByResourceGroup(String resourceGroupName, String jobName); /** - * Get the list of diagnostics for a given Container App Job. + * Create or Update a Container Apps Job. * - * Get the list of diagnostics for a Container App Job. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param jobEnvelope Properties used to create a container apps 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 {@link SyncPoller} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobInner> beginCreateOrUpdate(String resourceGroupName, String jobName, + JobInner jobEnvelope); + + /** + * Create or Update a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. + * @param jobEnvelope Properties used to create a container apps 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 * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of diagnostics for a Container App Job as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of container App Job. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDetectors(String resourceGroupName, String jobName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobInner> beginCreateOrUpdate(String resourceGroupName, String jobName, + JobInner jobEnvelope, Context context); /** - * Get the diagnostics data for a given Container App Job. + * Create or Update a Container Apps Job. * - * Get the diagnostics data for a Container App Job. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param jobEnvelope Properties used to create a container apps 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 container App Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner createOrUpdate(String resourceGroupName, String jobName, JobInner jobEnvelope); + + /** + * Create or Update a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param detectorName Name of the Container App Job detector. + * @param jobEnvelope Properties used to create a container apps 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 * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the diagnostics data for a Container App Job along with {@link Response}. + * @return container App Job. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getDetectorWithResponse(String resourceGroupName, String jobName, String detectorName, - Context context); + JobInner createOrUpdate(String resourceGroupName, String jobName, JobInner jobEnvelope, Context context); /** - * Get the diagnostics data for a given Container App Job. + * Update properties of a Container Apps Job * - * Get the diagnostics data for a Container App Job. + * Patches a Container Apps Job using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param detectorName Name of the Container App Job detector. + * @param jobEnvelope Properties used to create a container apps 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 diagnostics data for a Container App Job. + * @return the {@link SyncPoller} for polling of container App Job. */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiagnosticsInner getDetector(String resourceGroupName, String jobName, String detectorName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobInner> beginUpdate(String resourceGroupName, String jobName, + JobPatchProperties jobEnvelope); /** - * Get the properties of a Container App Job. + * Update properties of a Container Apps Job + * + * Patches a Container Apps Job using JSON Merge Patch. * * @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 jobEnvelope Properties used to create a container apps 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 * 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 along with {@link Response}. + * @return the {@link SyncPoller} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobInner> beginUpdate(String resourceGroupName, String jobName, + JobPatchProperties jobEnvelope, Context context); + + /** + * Update properties of a Container Apps Job + * + * Patches a Container Apps Job using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param jobEnvelope Properties used to create a container apps 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 container App Job. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response proxyGetWithResponse(String resourceGroupName, String jobName, String apiName, Context context); + JobInner update(String resourceGroupName, String jobName, JobPatchProperties jobEnvelope); /** - * Get the properties of a Container App Job. + * Update properties of a Container Apps Job + * + * Patches a Container Apps Job using JSON Merge Patch. * * @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 jobEnvelope Properties used to create a container apps 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 * 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. + * @return container App Job. */ @ServiceMethod(returns = ReturnType.SINGLE) - JobInner proxyGet(String resourceGroupName, String jobName, String apiName); + JobInner update(String resourceGroupName, String jobName, JobPatchProperties jobEnvelope, Context context); /** - * Get the Container Apps Jobs in a given subscription. + * Delete a Container Apps Job. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job 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 the Container Apps Jobs in a given subscription as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String jobName); /** - * Get the Container Apps Jobs in a given subscription. + * Delete a Container Apps Job. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job 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 the Container Apps Jobs in a given subscription as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String jobName, Context context); + + /** + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String jobName); + + /** + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String jobName, Context context); /** * Get the Container Apps Jobs in a given resource group. @@ -175,100 +272,94 @@ Response getDetectorWithResponse(String resourceGroupName, Str PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Get the properties of a Container Apps Job. + * Get the Container Apps Jobs in a given subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job 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 the properties of a Container Apps Job along with {@link Response}. + * @return the Container Apps Jobs in a given subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String jobName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Get the properties of a Container Apps Job. + * Get the Container Apps Jobs in a given subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job 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 the properties of a Container Apps Job. + * @return the Container Apps Jobs in a given subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - JobInner getByResourceGroup(String resourceGroupName, String jobName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); /** - * Create or Update a Container Apps Job. + * Start a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps 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 {@link SyncPoller} for polling of container App Job. + * @return the {@link SyncPoller} for polling of container App's Job execution name. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, JobInner> beginCreateOrUpdate(String resourceGroupName, String jobName, - JobInner jobEnvelope); + SyncPoller, JobExecutionBaseInner> beginStart(String resourceGroupName, + String jobName); /** - * Create or Update a Container Apps Job. + * Start a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps job. + * @param template Properties used to start a job execution. * @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 Job. + * @return the {@link SyncPoller} for polling of container App's Job execution name. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, JobInner> beginCreateOrUpdate(String resourceGroupName, String jobName, - JobInner jobEnvelope, Context context); + SyncPoller, JobExecutionBaseInner> beginStart(String resourceGroupName, + String jobName, JobExecutionTemplate template, Context context); /** - * Create or Update a Container Apps Job. + * Start a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps 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 container App Job. + * @return container App's Job execution name. */ @ServiceMethod(returns = ReturnType.SINGLE) - JobInner createOrUpdate(String resourceGroupName, String jobName, JobInner jobEnvelope); + JobExecutionBaseInner start(String resourceGroupName, String jobName); /** - * Create or Update a Container Apps Job. + * Start a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps job. + * @param template Properties used to start a job execution. * @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 Job. + * @return container App's Job execution name. */ @ServiceMethod(returns = ReturnType.SINGLE) - JobInner createOrUpdate(String resourceGroupName, String jobName, JobInner jobEnvelope, Context context); + JobExecutionBaseInner start(String resourceGroupName, String jobName, JobExecutionTemplate template, + Context context); /** - * Delete a Container Apps Job. + * Terminates execution of a running container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. @@ -276,13 +367,14 @@ SyncPoller, JobInner> beginCreateOrUpdate(String resourceGr * @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. + * @return the {@link SyncPoller} for polling of container App executions collection ARM resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String jobName); + SyncPoller, ContainerAppJobExecutionsInner> + beginStopMultipleExecutions(String resourceGroupName, String jobName); /** - * Delete a Container Apps Job. + * Terminates execution of a running container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. @@ -291,13 +383,14 @@ SyncPoller, JobInner> beginCreateOrUpdate(String resourceGr * @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. + * @return the {@link SyncPoller} for polling of container App executions collection ARM resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String jobName, Context context); + SyncPoller, ContainerAppJobExecutionsInner> + beginStopMultipleExecutions(String resourceGroupName, String jobName, Context context); /** - * Delete a Container Apps Job. + * Terminates execution of a running container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. @@ -305,12 +398,13 @@ SyncPoller, JobInner> beginCreateOrUpdate(String resourceGr * @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 executions collection ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String jobName); + ContainerAppJobExecutionsInner stopMultipleExecutions(String resourceGroupName, String jobName); /** - * Delete a Container Apps Job. + * Terminates execution of a running container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. @@ -319,144 +413,164 @@ SyncPoller, JobInner> beginCreateOrUpdate(String resourceGr * @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 executions collection ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String jobName, Context context); + ContainerAppJobExecutionsInner stopMultipleExecutions(String resourceGroupName, String jobName, Context context); /** - * Update properties of a Container Apps Job + * List secrets for a container apps job. * - * Patches a Container Apps Job using JSON Merge Patch. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job 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 container Apps Job Secrets Collection ARM resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSecretsWithResponse(String resourceGroupName, String jobName, + Context context); + + /** + * List secrets for a container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps 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 container Apps Job Secrets Collection ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobSecretsCollectionInner listSecrets(String resourceGroupName, String jobName); + + /** + * Resumes a suspended job + * + * Resumes execution for a suspended Container Apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @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> beginUpdate(String resourceGroupName, String jobName, - JobPatchProperties jobEnvelope); + SyncPoller, JobInner> beginResume(String resourceGroupName, String jobName); /** - * Update properties of a Container Apps Job + * Resumes a suspended job * - * Patches a Container Apps Job using JSON Merge Patch. + * Resumes execution for a suspended Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps 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 - * is rejected by server. + * @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> beginUpdate(String resourceGroupName, String jobName, - JobPatchProperties jobEnvelope, Context context); + SyncPoller, JobInner> beginResume(String resourceGroupName, String jobName, Context context); /** - * Update properties of a Container Apps Job + * Resumes a suspended job * - * Patches a Container Apps Job using JSON Merge Patch. + * Resumes execution for a suspended Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps 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 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 update(String resourceGroupName, String jobName, JobPatchProperties jobEnvelope); + JobInner resume(String resourceGroupName, String jobName); /** - * Update properties of a Container Apps Job + * Resumes a suspended job * - * Patches a Container Apps Job using JSON Merge Patch. + * Resumes execution for a suspended Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps 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 - * is rejected by server. + * @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 update(String resourceGroupName, String jobName, JobPatchProperties jobEnvelope, Context context); + JobInner resume(String resourceGroupName, String jobName, Context context); /** - * Start a Container Apps Job. + * Suspends a job + * + * Suspends execution for a running Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 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's Job execution name. + * @return the {@link SyncPoller} for polling of container App Job. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, JobExecutionBaseInner> beginStart(String resourceGroupName, - String jobName); + SyncPoller, JobInner> beginSuspend(String resourceGroupName, String jobName); /** - * Start a Container Apps Job. + * Suspends a job + * + * Suspends execution for a running Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param template Properties used to start a job execution. * @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 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's Job execution name. + * @return the {@link SyncPoller} for polling of container App Job. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, JobExecutionBaseInner> beginStart(String resourceGroupName, - String jobName, JobExecutionTemplate template, Context context); + SyncPoller, JobInner> beginSuspend(String resourceGroupName, String jobName, Context context); /** - * Start a Container Apps Job. + * Suspends a job + * + * Suspends execution for a running Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 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's Job execution name. + * @return container App Job. */ @ServiceMethod(returns = ReturnType.SINGLE) - JobExecutionBaseInner start(String resourceGroupName, String jobName); + JobInner suspend(String resourceGroupName, String jobName); /** - * Start a Container Apps Job. + * Suspends a job + * + * Suspends execution for a running Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param template Properties used to start a job execution. * @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 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's Job execution name. + * @return container App Job. */ @ServiceMethod(returns = ReturnType.SINGLE) - JobExecutionBaseInner start(String resourceGroupName, String jobName, JobExecutionTemplate template, - Context context); + JobInner suspend(String resourceGroupName, String jobName, Context context); /** * Terminates execution of a running container apps job. @@ -521,92 +635,118 @@ SyncPoller, Void> beginStopExecution(String resourceGroupName, void stopExecution(String resourceGroupName, String jobName, String jobExecutionName, Context context); /** - * Terminates execution of a running container apps job. + * Get the properties of a Container App Job. + * + * Get the properties for a given 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 * 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 executions collection ARM resource. + * @return the properties of a Container App Job. + * + * Get the properties for a given Container App Job along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ContainerAppJobExecutionsInner> - beginStopMultipleExecutions(String resourceGroupName, String jobName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response proxyGetWithResponse(String resourceGroupName, String jobName, String apiName, Context context); /** - * Terminates execution of a running container apps job. + * Get the properties of a Container App Job. + * + * Get the properties for a given Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param context The context to associate with this operation. + * @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 {@link SyncPoller} for polling of container App executions collection ARM resource. + * @return the properties of a Container App Job. + * + * Get the properties for a given Container App Job. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ContainerAppJobExecutionsInner> - beginStopMultipleExecutions(String resourceGroupName, String jobName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner proxyGet(String resourceGroupName, String jobName, String apiName); /** - * Terminates execution of a running container apps job. + * Get the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. + * @param jobName Name of the 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 container App executions collection ARM resource. + * @return the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ContainerAppJobExecutionsInner stopMultipleExecutions(String resourceGroupName, String jobName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDetectors(String resourceGroupName, String jobName); /** - * Terminates execution of a running container apps job. + * Get the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. + * @param jobName Name of the 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 * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container App executions collection ARM resource. + * @return the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ContainerAppJobExecutionsInner stopMultipleExecutions(String resourceGroupName, String jobName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDetectors(String resourceGroupName, String jobName, Context context); /** - * List secrets for a container apps job. + * Get the diagnostics data for a given Container App Job. + * + * Get the diagnostics data for a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. + * @param jobName Name of the Container App Job. + * @param detectorName 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 * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container Apps Job Secrets Collection ARM resource along with {@link Response}. + * @return the diagnostics data for a given Container App Job. + * + * Get the diagnostics data for a Container App Job along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listSecretsWithResponse(String resourceGroupName, String jobName, + Response getDetectorWithResponse(String resourceGroupName, String jobName, String detectorName, Context context); /** - * List secrets for a container apps job. + * Get the diagnostics data for a given Container App Job. + * + * Get the diagnostics data for a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. + * @param jobName Name of the Container App Job. + * @param detectorName 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 container Apps Job Secrets Collection ARM resource. + * @return the diagnostics data for a given Container App Job. + * + * Get the diagnostics data for a Container App Job. */ @ServiceMethod(returns = ReturnType.SINGLE) - JobSecretsCollectionInner listSecrets(String resourceGroupName, String jobName); + DiagnosticsInner getDetector(String resourceGroupName, String jobName, String detectorName); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/JobsExecutionsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/JobsExecutionsClient.java index d9c95e6f4a71..bbaaf4e857df 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/JobsExecutionsClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/JobsExecutionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; 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 index 60e6003f4f4f..b7ce16b9d9a8 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -21,7 +21,7 @@ public interface LogicAppsClient { * * @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. + * @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 @@ -38,7 +38,7 @@ 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 logicAppName Name of the Logic 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. @@ -53,8 +53,8 @@ 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 logicAppName Name of the Logic App. - * @param resource Logic app resource properties. + * @param logicAppName Name of the Logic App, the extension resource. + * @param resource Resource create parameters. * @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 @@ -71,7 +71,7 @@ Response createOrUpdateWithResponse(String resourceGroupName, Str * * @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. + * @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. @@ -86,7 +86,7 @@ Response createOrUpdateWithResponse(String resourceGroupName, Str * * @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. + * @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 @@ -103,7 +103,7 @@ Response deleteWithResponse(String resourceGroupName, String containerAppN * * @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. + * @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. @@ -113,44 +113,44 @@ Response deleteWithResponse(String resourceGroupName, String containerAppN void delete(String resourceGroupName, String containerAppName, String logicAppName); /** - * List the workflows for a logic app. + * 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. + * @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}. + * @return logic app's connections along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWorkflows(String resourceGroupName, String containerAppName, - String logicAppName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWorkflowsConnectionsWithResponse(String resourceGroupName, + String containerAppName, String logicAppName, Context context); /** - * List the workflows for a logic app. + * 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. - * @param context The context to associate with this operation. + * @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}. + * @return logic app's connections. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listWorkflows(String resourceGroupName, String containerAppName, - String logicAppName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + WorkflowEnvelopeInner listWorkflowsConnections(String resourceGroupName, String containerAppName, + String logicAppName); /** * 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. + * @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. @@ -168,7 +168,7 @@ Response getWorkflowWithResponse(String resourceGroupName * * @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. + * @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 @@ -181,35 +181,35 @@ WorkflowEnvelopeInner getWorkflow(String resourceGroupName, String containerAppN String workflowName); /** - * Gets logic app's connections. + * 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. - * @param context The context to associate with this operation. + * @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 along with {@link Response}. + * @return collection of workflow information elements as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWorkflowsConnectionsWithResponse(String resourceGroupName, - String containerAppName, String logicAppName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + String logicAppName); /** - * Gets logic app's connections. + * 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. + * @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. + * @return collection of workflow information elements as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkflowEnvelopeInner listWorkflowsConnections(String resourceGroupName, String containerAppName, - String logicAppName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + String logicAppName, Context context); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/MaintenanceConfigurationsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/MaintenanceConfigurationsClient.java index 3716e00e44ae..5a0db7cf1bde 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/MaintenanceConfigurationsClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/MaintenanceConfigurationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -16,41 +16,41 @@ */ public interface MaintenanceConfigurationsClient { /** - * Gets all maintenance configurations in the specified Managed Environment. + * Gets the maintenance configuration of a ManagedEnvironment . * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. + * @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 all maintenance configurations in the specified Managed Environment as paginated response with - * {@link PagedIterable}. + * @return the maintenance configuration of a ManagedEnvironment along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String environmentName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String environmentName, + String configName, Context context); /** - * Gets all maintenance configurations in the specified Managed Environment. + * Gets the maintenance configuration of a ManagedEnvironment . * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param context The context to associate with this operation. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. * @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 all maintenance configurations in the specified Managed Environment as paginated response with - * {@link PagedIterable}. + * @return the maintenance configuration of a ManagedEnvironment. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String environmentName, - Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + MaintenanceConfigurationResourceInner get(String resourceGroupName, String environmentName, String configName); /** * Create or update the maintenance configuration for Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. * @param maintenanceConfigurationEnvelope Parameters to set the maintenance configuration for ManagedEnvironment . * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -67,8 +67,8 @@ Response createOrUpdateWithResponse(Strin * Create or update the maintenance configuration for Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. * @param maintenanceConfigurationEnvelope Parameters to set the maintenance configuration for ManagedEnvironment . * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -83,8 +83,8 @@ MaintenanceConfigurationResourceInner createOrUpdate(String resourceGroupName, S * Deletes the maintenance configuration of a ManagedEnvironment . * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. * @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. @@ -99,8 +99,8 @@ Response deleteWithResponse(String resourceGroupName, String environmentNa * Deletes the maintenance configuration of a ManagedEnvironment . * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. * @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. @@ -109,32 +109,32 @@ Response deleteWithResponse(String resourceGroupName, String environmentNa void delete(String resourceGroupName, String environmentName, String configName); /** - * Gets the maintenance configuration of a ManagedEnvironment . + * Gets all maintenance configurations in the specified Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. - * @param context The context to associate with this operation. + * @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 maintenance configuration of a ManagedEnvironment along with {@link Response}. + * @return all maintenance configurations in the specified Managed Environment as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String environmentName, - String configName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName); /** - * Gets the maintenance configuration of a ManagedEnvironment . + * Gets all maintenance configurations in the specified Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. + * @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 maintenance configuration of a ManagedEnvironment. + * @return all maintenance configurations in the specified Managed Environment as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - MaintenanceConfigurationResourceInner get(String resourceGroupName, String environmentName, String configName); + @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/ManagedCertificatesClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedCertificatesClient.java index 37406c086470..3e7659a62d4e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedCertificatesClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedCertificatesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -22,12 +22,11 @@ public interface ManagedCertificatesClient { * Get the specified Managed Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. * @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 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 specified Managed Certificate along with {@link Response}. */ @@ -39,11 +38,10 @@ Response getWithResponse(String resourceGroupName, Stri * Get the specified Managed Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. + * @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 specified Managed Certificate. */ @@ -57,8 +55,7 @@ Response getWithResponse(String resourceGroupName, Stri * @param environmentName Name of the Managed Environment. * @param managedCertificateName Name of the Managed Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on * status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -78,8 +75,7 @@ Response getWithResponse(String resourceGroupName, Stri * @param managedCertificateEnvelope Managed Certificate to be created or updated. * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on * status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -98,8 +94,7 @@ SyncPoller, ManagedCertificateInner> beginCr * @param environmentName Name of the Managed Environment. * @param managedCertificateName Name of the Managed Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on * status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -118,8 +113,7 @@ ManagedCertificateInner createOrUpdate(String resourceGroupName, String environm * @param managedCertificateEnvelope Managed Certificate to be created or updated. * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on * status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -130,84 +124,79 @@ ManagedCertificateInner createOrUpdate(String resourceGroupName, String environm String managedCertificateName, ManagedCertificateInner managedCertificateEnvelope, Context context); /** - * Deletes the specified Managed Certificate. + * Update tags of a managed certificate + * + * Patches a managed certificate. Oly patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Properties of a managed certificate that need to be updated. * @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 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 Response}. + * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String environmentName, String managedCertificateName, - Context context); + Response updateWithResponse(String resourceGroupName, String environmentName, + String managedCertificateName, ManagedCertificatePatch managedCertificateEnvelope, Context context); /** - * Deletes the specified Managed Certificate. + * Update tags of a managed certificate + * + * Patches a managed certificate. Oly patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Properties of a managed certificate that need to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. + * @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 managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String environmentName, String managedCertificateName); + ManagedCertificateInner update(String resourceGroupName, String environmentName, String managedCertificateName, + ManagedCertificatePatch managedCertificateEnvelope); /** - * Update tags of a managed certificate - * - * Patches a managed certificate. Oly patching of tags is supported. + * Deletes the specified Managed Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. - * @param managedCertificateEnvelope Properties of a managed certificate that need to be updated. * @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 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 managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment along - * with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String environmentName, - String managedCertificateName, ManagedCertificatePatch managedCertificateEnvelope, Context context); + Response deleteWithResponse(String resourceGroupName, String environmentName, String managedCertificateName, + Context context); /** - * Update tags of a managed certificate - * - * Patches a managed certificate. Oly patching of tags is supported. + * Deletes the specified Managed Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. - * @param managedCertificateEnvelope Properties of a managed certificate that need to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. + * @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 managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment. */ @ServiceMethod(returns = ReturnType.SINGLE) - ManagedCertificateInner update(String resourceGroupName, String environmentName, String managedCertificateName, - ManagedCertificatePatch managedCertificateEnvelope); + void delete(String resourceGroupName, String environmentName, String managedCertificateName); /** * Get the Managed Certificates in 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 environmentName Name of the 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 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 Managed Certificates in a given managed environment as paginated response with {@link PagedIterable}. */ @@ -218,11 +207,10 @@ ManagedCertificateInner update(String resourceGroupName, String environmentName, * Get the Managed Certificates in 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 environmentName Name of the 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 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 Managed Certificates in a given managed environment as paginated response with {@link PagedIterable}. */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentDiagnosticsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentDiagnosticsClient.java index 9969602d4353..94e6d4222178 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentDiagnosticsClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentDiagnosticsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -21,14 +21,15 @@ public interface ManagedEnvironmentDiagnosticsClient { * Get the list of diagnostics for a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. + * @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 list of diagnostics for a Managed Environment used to host container apps along with - * {@link Response}. + * @return the list of diagnostics for a given Managed Environment. + * + * Get the list of diagnostics for a Managed Environment used to host container apps along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listDetectorsWithResponse(String resourceGroupName, String environmentName, @@ -40,12 +41,14 @@ Response listDetectorsWithResponse(String resourceGr * Get the list of diagnostics for a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. + * @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 list of diagnostics for a Managed Environment used to host container apps. + * @return the list of diagnostics for a given Managed Environment. + * + * Get the list of diagnostics for a Managed Environment used to host container apps. */ @ServiceMethod(returns = ReturnType.SINGLE) DiagnosticsCollectionInner listDetectors(String resourceGroupName, String environmentName); @@ -56,14 +59,16 @@ Response listDetectorsWithResponse(String resourceGr * Get the diagnostics data for a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param detectorName Name of the Managed Environment detector. + * @param environmentName Name of the Managed Environment. + * @param detectorName Name of the detector. * @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 diagnostics data for a Managed Environment used to host container apps along with {@link Response}. + * @return the diagnostics data for a given Managed Environment. + * + * Get the diagnostics data for a Managed Environment used to host container apps along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getDetectorWithResponse(String resourceGroupName, String environmentName, @@ -75,13 +80,15 @@ Response getDetectorWithResponse(String resourceGroupName, Str * Get the diagnostics data for a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param detectorName Name of the Managed Environment detector. + * @param environmentName Name of the Managed Environment. + * @param detectorName Name of the detector. * @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 diagnostics data for a Managed Environment used to host container apps. + * @return the diagnostics data for a given Managed Environment. + * + * Get the diagnostics data for a Managed Environment used to host container apps. */ @ServiceMethod(returns = ReturnType.SINGLE) DiagnosticsInner getDetector(String resourceGroupName, String environmentName, String detectorName); 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 index 37a4ed33fe03..1c859466c3a7 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -18,43 +18,12 @@ * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -69,9 +38,8 @@ Response getWithResponse(String resourceGroupNam * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -85,9 +53,8 @@ PrivateEndpointConnectionInner get(String resourceGroupName, String environmentN * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -103,9 +70,8 @@ SyncPoller, PrivateEndpointConnection * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -122,9 +88,8 @@ SyncPoller, PrivateEndpointConnection * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -139,9 +104,8 @@ PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String e * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -158,9 +122,8 @@ PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String e * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -174,9 +137,8 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -191,9 +153,8 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -205,9 +166,8 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -216,4 +176,34 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String environmentName, String privateEndpointConnectionName, 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 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 PrivateEndpointConnection list operation 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 the response of a PrivateEndpointConnection list operation 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/ManagedEnvironmentPrivateLinkResourcesClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentPrivateLinkResourcesClient.java index 7235c21740e7..8d1268565306 100644 --- 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 @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.PrivateLinkResourceInner; @@ -19,11 +20,12 @@ 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. + * @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}. + * @return list of private link resources for a managed environment as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String environmentName); @@ -32,13 +34,52 @@ 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. + * @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}. + * @return list of private link resources for a managed environment as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String environmentName, Context context); + + /** + * Get a private link resource for a given managed environment. + * + * Gets the details of a private link resource supported by a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the managed environment. + * @param privateLinkResourceName The name of the private link 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 link resource for a given managed environment. + * + * Gets the details of a private link resource supported by a managed environment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String environmentName, + String privateLinkResourceName, Context context); + + /** + * Get a private link resource for a given managed environment. + * + * Gets the details of a private link resource supported by a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the managed environment. + * @param privateLinkResourceName The name of the private link 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 link resource for a given managed environment. + * + * Gets the details of a private link resource supported by a managed environment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner get(String resourceGroupName, String environmentName, String privateLinkResourceName); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentUsagesClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentUsagesClient.java index 3d9e05a007a2..74a3fdfc00d2 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentUsagesClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentUsagesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentsClient.java index 115d58555ac3..b284a22d52c5 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentsClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -11,179 +11,190 @@ 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.CheckMigrationEligibilityResponseInner; import com.azure.resourcemanager.appcontainers.fluent.models.EnvironmentAuthTokenInner; import com.azure.resourcemanager.appcontainers.fluent.models.ManagedEnvironmentInner; import com.azure.resourcemanager.appcontainers.fluent.models.WorkloadProfileStatesInner; +import com.azure.resourcemanager.appcontainers.models.CheckMigrationEligibilityRequest; /** * An instance of this class provides access to all the operations defined in ManagedEnvironmentsClient. */ public interface ManagedEnvironmentsClient { /** - * Get all Environments for a subscription. + * Get the properties of a Managed Environment. * - * Get all Managed Environments for a subscription. + * Get the properties of a Managed Environment used to host container apps. * - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the 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 all Managed Environments for a subscription as paginated response with {@link PagedIterable}. + * @return the properties of a Managed Environment. + * + * Get the properties of a Managed Environment used to host container apps along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String environmentName, + Context context); /** - * Get all Environments for a subscription. + * Get the properties of a Managed Environment. * - * Get all Managed Environments for a subscription. + * Get the properties of a Managed Environment used to host container apps. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the 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 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 all Managed Environments for a subscription as paginated response with {@link PagedIterable}. + * @return the properties of a Managed Environment. + * + * Get the properties of a Managed Environment used to host container apps. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedEnvironmentInner getByResourceGroup(String resourceGroupName, String environmentName); /** - * Get all the Environments in a resource group. + * Creates or updates a Managed Environment. * - * Get all the Managed Environments in a resource group. + * Creates or updates a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Environment. + * @param environmentEnvelope Configuration details of the 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 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 all the Managed Environments in a resource group as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of an environment for hosting container apps. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedEnvironmentInner> beginCreateOrUpdate( + String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope); /** - * Get all the Environments in a resource group. + * Creates or updates a Managed Environment. * - * Get all the Managed Environments in a resource group. + * Creates or updates a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Environment. + * @param environmentEnvelope Configuration details of the 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 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 all the Managed Environments in a resource group as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of an environment for hosting container apps. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedEnvironmentInner> beginCreateOrUpdate( + String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope, Context context); /** - * Get the properties of a Managed Environment. + * Creates or updates a Managed Environment. * - * Get the properties of a Managed Environment used to host container apps. + * Creates or updates a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. - * @param context The context to associate with this operation. + * @param environmentEnvelope Configuration details of the 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 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 properties of a Managed Environment used to host container apps along with {@link Response}. + * @return an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String environmentName, - Context context); + ManagedEnvironmentInner createOrUpdate(String resourceGroupName, String environmentName, + ManagedEnvironmentInner environmentEnvelope); /** - * Get the properties of a Managed Environment. + * Creates or updates a Managed Environment. * - * Get the properties of a Managed Environment used to host container apps. + * Creates or updates a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. + * @param environmentEnvelope Configuration details of the 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 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 properties of a Managed Environment used to host container apps. + * @return an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - ManagedEnvironmentInner getByResourceGroup(String resourceGroupName, String environmentName); + ManagedEnvironmentInner createOrUpdate(String resourceGroupName, String environmentName, + ManagedEnvironmentInner environmentEnvelope, Context context); /** - * Creates or updates a Managed Environment. + * Update Managed Environment's properties. * - * Creates or updates a Managed Environment used to host container apps. + * Patches a Managed Environment using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. * @param environmentEnvelope Configuration details of the 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 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 an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ManagedEnvironmentInner> beginCreateOrUpdate( - String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope); + SyncPoller, ManagedEnvironmentInner> beginUpdate(String resourceGroupName, + String environmentName, ManagedEnvironmentInner environmentEnvelope); /** - * Creates or updates a Managed Environment. + * Update Managed Environment's properties. * - * Creates or updates a Managed Environment used to host container apps. + * Patches a Managed Environment using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. * @param environmentEnvelope Configuration details of the 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 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 an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ManagedEnvironmentInner> beginCreateOrUpdate( - String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope, Context context); + SyncPoller, ManagedEnvironmentInner> beginUpdate(String resourceGroupName, + String environmentName, ManagedEnvironmentInner environmentEnvelope, Context context); /** - * Creates or updates a Managed Environment. + * Update Managed Environment's properties. * - * Creates or updates a Managed Environment used to host container apps. + * Patches a Managed Environment using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. * @param environmentEnvelope Configuration details of the 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 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 an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - ManagedEnvironmentInner createOrUpdate(String resourceGroupName, String environmentName, + ManagedEnvironmentInner update(String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope); /** - * Creates or updates a Managed Environment. + * Update Managed Environment's properties. * - * Creates or updates a Managed Environment used to host container apps. + * Patches a Managed Environment using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. * @param environmentEnvelope Configuration details of the 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 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 an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - ManagedEnvironmentInner createOrUpdate(String resourceGroupName, String environmentName, + ManagedEnvironmentInner update(String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope, Context context); /** @@ -194,8 +205,7 @@ ManagedEnvironmentInner createOrUpdate(String resourceGroupName, String environm * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the 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 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. */ @@ -211,8 +221,7 @@ ManagedEnvironmentInner createOrUpdate(String resourceGroupName, String environm * @param environmentName Name of the 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 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. */ @@ -227,8 +236,7 @@ ManagedEnvironmentInner createOrUpdate(String resourceGroupName, String environm * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the 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 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) @@ -243,86 +251,74 @@ ManagedEnvironmentInner createOrUpdate(String resourceGroupName, String environm * @param environmentName Name of the 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 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, Context context); /** - * Update Managed Environment's properties. + * Get all the Environments in a resource group. * - * Patches a Managed Environment using JSON Merge Patch. + * Get all the Managed Environments in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param environmentEnvelope Configuration details of the 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 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 an environment for hosting container apps. + * @return all the Environments in a resource group. + * + * Get all the Managed Environments in a resource group as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ManagedEnvironmentInner> beginUpdate(String resourceGroupName, - String environmentName, ManagedEnvironmentInner environmentEnvelope); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Update Managed Environment's properties. + * Get all the Environments in a resource group. * - * Patches a Managed Environment using JSON Merge Patch. + * Get all the Managed Environments in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param environmentEnvelope Configuration details of the 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 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 an environment for hosting container apps. + * @return all the Environments in a resource group. + * + * Get all the Managed Environments in a resource group as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ManagedEnvironmentInner> beginUpdate(String resourceGroupName, - String environmentName, ManagedEnvironmentInner environmentEnvelope, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Update Managed Environment's properties. + * Get all Environments for a subscription. * - * Patches a Managed Environment using JSON Merge Patch. + * Get all Managed Environments for a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param environmentEnvelope Configuration details of the 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 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 an environment for hosting container apps. + * @return all Environments for a subscription. + * + * Get all Managed Environments for a subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedEnvironmentInner update(String resourceGroupName, String environmentName, - ManagedEnvironmentInner environmentEnvelope); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Update Managed Environment's properties. + * Get all Environments for a subscription. * - * Patches a Managed Environment using JSON Merge Patch. + * Get all Managed Environments for a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param environmentEnvelope Configuration details of the 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 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 an environment for hosting container apps. + * @return all Environments for a subscription. + * + * Get all Managed Environments for a subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedEnvironmentInner update(String resourceGroupName, String environmentName, - ManagedEnvironmentInner environmentEnvelope, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); /** * Get auth token for a managed environment @@ -330,13 +326,14 @@ ManagedEnvironmentInner update(String resourceGroupName, String environmentName, * Checks if resource name is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the 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 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 environment Auth Token along with {@link Response}. + * @return auth token for a managed environment + * + * Checks if resource name is available along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getAuthTokenWithResponse(String resourceGroupName, String environmentName, @@ -348,12 +345,13 @@ Response getAuthTokenWithResponse(String resourceGrou * Checks if resource name is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the 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 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 environment Auth Token. + * @return auth token for a managed environment + * + * Checks if resource name is available. */ @ServiceMethod(returns = ReturnType.SINGLE) EnvironmentAuthTokenInner getAuthToken(String resourceGroupName, String environmentName); @@ -364,12 +362,13 @@ Response getAuthTokenWithResponse(String resourceGrou * Get all workload Profile States 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 environmentName Name of the 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 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 all workload Profile States for a Managed Environment as paginated response with {@link PagedIterable}. + * @return all workload Profile States for a Managed Environment.. + * + * Get all workload Profile States for a Managed Environment as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listWorkloadProfileStates(String resourceGroupName, @@ -381,15 +380,49 @@ PagedIterable listWorkloadProfileStates(String resou * Get all workload Profile States 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 environmentName Name of the 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 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 all workload Profile States for a Managed Environment as paginated response with {@link PagedIterable}. + * @return all workload Profile States for a Managed Environment.. + * + * Get all workload Profile States for a Managed Environment as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listWorkloadProfileStates(String resourceGroupName, String environmentName, Context context); + + /** + * Checks whether a Managed Environment can be migrated to a target mode. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Environment. + * @param body The migration eligibility check request. + * @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 result of a read-only managed environment migration eligibility check along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkMigrationEligibilityWithResponse(String resourceGroupName, + String environmentName, CheckMigrationEligibilityRequest body, Context context); + + /** + * Checks whether a Managed Environment can be migrated to a target mode. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Environment. + * @param body The migration eligibility check request. + * @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 result of a read-only managed environment migration eligibility check. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckMigrationEligibilityResponseInner checkMigrationEligibility(String resourceGroupName, String environmentName, + CheckMigrationEligibilityRequest body); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentsDiagnosticsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentsDiagnosticsClient.java index 1b4c03b2060d..40c1abf755cf 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentsDiagnosticsClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentsDiagnosticsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -26,7 +26,9 @@ public interface ManagedEnvironmentsDiagnosticsClient { * @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 Managed Environment used to host container apps along with {@link Response}. + * @return the properties of a Managed Environment. + * + * Get the properties of a Managed Environment used to host container apps along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getRootWithResponse(String resourceGroupName, String environmentName, @@ -43,7 +45,9 @@ Response getRootWithResponse(String resourceGroupName, * @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 Managed Environment used to host container apps. + * @return the properties of a Managed Environment. + * + * Get the properties of a Managed Environment used to host container apps. */ @ServiceMethod(returns = ReturnType.SINGLE) ManagedEnvironmentInner getRoot(String resourceGroupName, String environmentName); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentsStoragesClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentsStoragesClient.java index d3f52ead4a63..b0f3d6636689 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentsStoragesClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentsStoragesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -15,36 +15,6 @@ * An instance of this class provides access to all the operations defined in ManagedEnvironmentsStoragesClient. */ public interface ManagedEnvironmentsStoragesClient { - /** - * Get all storages for a managedEnvironment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the 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 all storages for a managedEnvironment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String resourceGroupName, - String environmentName, Context context); - - /** - * Get all storages for a managedEnvironment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the 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 all storages for a managedEnvironment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedEnvironmentStoragesCollectionInner list(String resourceGroupName, String environmentName); - /** * Get storage for a managedEnvironment. * @@ -142,4 +112,34 @@ Response deleteWithResponse(String resourceGroupName, String environmentNa */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String environmentName, String storageName); + + /** + * Get all storages for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the 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 all storages for a managedEnvironment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, + String environmentName, Context context); + + /** + * Get all storages for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the 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 all storages for a managedEnvironment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedEnvironmentStoragesCollectionInner list(String resourceGroupName, String environmentName); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/NamespacesClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/NamespacesClient.java index df0db6b1e37e..23054104c68f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/NamespacesClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/NamespacesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -21,12 +21,11 @@ public interface NamespacesClient { * Checks if resource name is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param checkNameAvailabilityRequest The check name availability request. * @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 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 check availability result along with {@link Response}. */ @@ -40,11 +39,10 @@ Response checkNameAvailabilityWithResponse(S * Checks if resource name is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param checkNameAvailabilityRequest The check name availability request. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. + * @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 check availability result. */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/OperationsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/OperationsClient.java index e421fd4a6c0a..12d03ed24967 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/OperationsClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/OperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ResourceProvidersClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ResourceProvidersClient.java index 752dab23418d..d413a944c618 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ResourceProvidersClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ResourceProvidersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -15,58 +15,58 @@ */ public interface ResourceProvidersClient { /** - * Get details of a single job execution. + * Get the verification id of a subscription used for verifying custom domains. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. - * @param jobExecutionName Job execution 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 details of a single job execution along with {@link Response}. + * @return the verification id of a subscription used for verifying custom domains along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response jobExecutionWithResponse(String resourceGroupName, String jobName, - String jobExecutionName, Context context); + Response getCustomDomainVerificationIdWithResponse(Context context); /** - * Get details of a single job execution. + * Get the verification id of a subscription used for verifying custom domains. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. - * @param jobExecutionName Job execution 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 details of a single job execution. + * @return the verification id of a subscription used for verifying custom domains. */ @ServiceMethod(returns = ReturnType.SINGLE) - JobExecutionInner jobExecution(String resourceGroupName, String jobName, String jobExecutionName); + String getCustomDomainVerificationId(); /** - * Get the verification id of a subscription used for verifying custom domains. + * Get details of a single job execution. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param jobExecutionName Job execution 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 the verification id of a subscription used for verifying custom domains along with {@link Response}. + * @return details of a single job execution along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getCustomDomainVerificationIdWithResponse(Context context); + Response jobExecutionWithResponse(String resourceGroupName, String jobName, + String jobExecutionName, Context context); /** - * Get the verification id of a subscription used for verifying custom domains. + * Get details of a single job execution. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param jobExecutionName Job execution 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 the verification id of a subscription used for verifying custom domains. + * @return details of a single job execution. */ @ServiceMethod(returns = ReturnType.SINGLE) - String getCustomDomainVerificationId(); + JobExecutionInner jobExecution(String resourceGroupName, String jobName, String jobExecutionName); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/SandboxGroupsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/SandboxGroupsClient.java new file mode 100644 index 000000000000..18b31caac0a4 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/SandboxGroupsClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.SandboxGroupInner; +import com.azure.resourcemanager.appcontainers.models.SandboxGroupPatch; + +/** + * An instance of this class provides access to all the operations defined in SandboxGroupsClient. + */ +public interface SandboxGroupsClient { + /** + * Get the properties of a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @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 properties of a SandboxGroup along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String sandboxGroupName, + Context context); + + /** + * Get the properties of a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @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 properties of a SandboxGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SandboxGroupInner getByResourceGroup(String resourceGroupName, String sandboxGroupName); + + /** + * Create or update a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param resource 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 a SandboxGroup resource, representing a group of sandboxes that + * share configuration defaults and quotas. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SandboxGroupInner> beginCreateOrUpdate(String resourceGroupName, + String sandboxGroupName, SandboxGroupInner resource); + + /** + * Create or update a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param resource 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 a SandboxGroup resource, representing a group of sandboxes that + * share configuration defaults and quotas. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SandboxGroupInner> beginCreateOrUpdate(String resourceGroupName, + String sandboxGroupName, SandboxGroupInner resource, Context context); + + /** + * Create or update a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param resource 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 a SandboxGroup resource, representing a group of sandboxes that share configuration defaults and quotas. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SandboxGroupInner createOrUpdate(String resourceGroupName, String sandboxGroupName, SandboxGroupInner resource); + + /** + * Create or update a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param resource 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 a SandboxGroup resource, representing a group of sandboxes that share configuration defaults and quotas. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SandboxGroupInner createOrUpdate(String resourceGroupName, String sandboxGroupName, SandboxGroupInner resource, + Context context); + + /** + * Patches a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param properties 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 a SandboxGroup resource, representing a group of sandboxes that + * share configuration defaults and quotas. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpdate(String resourceGroupName, String sandboxGroupName, + SandboxGroupPatch properties); + + /** + * Patches a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param properties 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 a SandboxGroup resource, representing a group of sandboxes that + * share configuration defaults and quotas. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpdate(String resourceGroupName, String sandboxGroupName, + SandboxGroupPatch properties, Context context); + + /** + * Patches a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param properties 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void update(String resourceGroupName, String sandboxGroupName, SandboxGroupPatch properties); + + /** + * Patches a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param properties 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void update(String resourceGroupName, String sandboxGroupName, SandboxGroupPatch properties, Context context); + + /** + * Delete a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @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 sandboxGroupName); + + /** + * Delete a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @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 sandboxGroupName, Context context); + + /** + * Delete a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @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 sandboxGroupName); + + /** + * Delete a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @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 sandboxGroupName, Context context); + + /** + * Get all SandboxGroups in a 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 all SandboxGroups in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get all SandboxGroups in a 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 all SandboxGroups in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get all SandboxGroups for a subscription. + * + * @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 all SandboxGroups for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get all SandboxGroups for a subscription. + * + * @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 all SandboxGroups for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/UsagesClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/UsagesClient.java index d57572384b32..ba65110a92a6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/UsagesClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/UsagesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent; @@ -23,7 +23,7 @@ public interface UsagesClient { * @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 paginated response with {@link PagedIterable}. + * @return paged collection of Usage items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String location); @@ -38,7 +38,7 @@ public interface UsagesClient { * @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 paginated response with {@link PagedIterable}. + * @return paged collection of Usage items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String location, Context context); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/VnetConnectionsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/VnetConnectionsClient.java new file mode 100644 index 000000000000..0889801c645e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/VnetConnectionsClient.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.VnetConnectionInner; + +/** + * An instance of this class provides access to all the operations defined in VnetConnectionsClient. + */ +public interface VnetConnectionsClient { + /** + * Get the properties of a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @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 properties of a VnetConnection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String sandboxGroupName, + String vnetConnectionName, Context context); + + /** + * Get the properties of a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @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 properties of a VnetConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VnetConnectionInner get(String resourceGroupName, String sandboxGroupName, String vnetConnectionName); + + /** + * Create or update a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @param resource 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 a virtual network connection associated with a SandboxGroup along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String sandboxGroupName, + String vnetConnectionName, VnetConnectionInner resource, Context context); + + /** + * Create or update a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @param resource 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 a virtual network connection associated with a SandboxGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VnetConnectionInner createOrUpdate(String resourceGroupName, String sandboxGroupName, String vnetConnectionName, + VnetConnectionInner resource); + + /** + * Delete a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @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 sandboxGroupName, + String vnetConnectionName); + + /** + * Delete a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @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 sandboxGroupName, + String vnetConnectionName, Context context); + + /** + * Delete a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @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 sandboxGroupName, String vnetConnectionName); + + /** + * Delete a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @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 sandboxGroupName, String vnetConnectionName, Context context); + + /** + * List all VnetConnections in the specified SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @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 VnetConnection list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySandboxGroup(String resourceGroupName, String sandboxGroupName); + + /** + * List all VnetConnections in the specified SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @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 VnetConnection list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySandboxGroup(String resourceGroupName, String sandboxGroupName, + Context context); +} 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 5272539ad16f..ec953192a835 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -252,17 +252,6 @@ public AuthConfigInner withEncryptionSettings(EncryptionSettings encryptionSetti return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AuthConfigProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AuthConfigProperties.java index 8cf1dcb0353c..cd19a24a7203 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AuthConfigProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AuthConfigProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -194,32 +194,6 @@ public AuthConfigProperties withEncryptionSettings(EncryptionSettings encryption return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (platform() != null) { - platform().validate(); - } - if (globalValidation() != null) { - globalValidation().validate(); - } - if (identityProviders() != null) { - identityProviders().validate(); - } - if (login() != null) { - login().validate(); - } - if (httpSettings() != null) { - httpSettings().validate(); - } - if (encryptionSettings() != null) { - encryptionSettings().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AvailableEnvironmentModeInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AvailableEnvironmentModeInner.java new file mode 100644 index 000000000000..0baafa62bf9f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AvailableEnvironmentModeInner.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.AvailableEnvironmentModeProperties; +import java.io.IOException; + +/** + * An environment mode available to the subscription. + */ +@Immutable +public final class AvailableEnvironmentModeInner extends ProxyResource { + /* + * The Azure region in which the environment mode is available. + */ + private String location; + + /* + * The environment mode details. + */ + private AvailableEnvironmentModeProperties 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 AvailableEnvironmentModeInner class. + */ + private AvailableEnvironmentModeInner() { + } + + /** + * Get the location property: The Azure region in which the environment mode is available. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the properties property: The environment mode details. + * + * @return the properties value. + */ + public AvailableEnvironmentModeProperties 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailableEnvironmentModeInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableEnvironmentModeInner 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 AvailableEnvironmentModeInner. + */ + public static AvailableEnvironmentModeInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailableEnvironmentModeInner deserializedAvailableEnvironmentModeInner + = new AvailableEnvironmentModeInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAvailableEnvironmentModeInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAvailableEnvironmentModeInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAvailableEnvironmentModeInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedAvailableEnvironmentModeInner.location = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAvailableEnvironmentModeInner.properties + = AvailableEnvironmentModeProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAvailableEnvironmentModeInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableEnvironmentModeInner; + }); + } +} 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 4b7558ab82a2..fbd3700e913c 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -16,7 +16,7 @@ /** * A workload profile with specific hardware configure to run container apps. */ -@Fluent +@Immutable public final class AvailableWorkloadProfileInner extends ProxyResource { /* * Region of the workload profile. @@ -51,7 +51,7 @@ public final class AvailableWorkloadProfileInner extends ProxyResource { /** * Creates an instance of AvailableWorkloadProfileInner class. */ - public AvailableWorkloadProfileInner() { + private AvailableWorkloadProfileInner() { } /** @@ -63,17 +63,6 @@ public String location() { return this.location; } - /** - * Set the location property: Region of the workload profile. - * - * @param location the location value to set. - * @return the AvailableWorkloadProfileInner object itself. - */ - public AvailableWorkloadProfileInner withLocation(String location) { - this.location = location; - return this; - } - /** * Get the properties property: Revision resource specific properties. * @@ -83,17 +72,6 @@ public AvailableWorkloadProfileProperties properties() { return this.properties; } - /** - * Set the properties property: Revision resource specific properties. - * - * @param properties the properties value to set. - * @return the AvailableWorkloadProfileInner object itself. - */ - public AvailableWorkloadProfileInner withProperties(AvailableWorkloadProfileProperties properties) { - this.properties = properties; - return this; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -133,17 +111,6 @@ 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} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BillingMeterCollectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BillingMeterCollectionInner.java index b6befebdd3fa..230f7c444220 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BillingMeterCollectionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BillingMeterCollectionInner.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +16,7 @@ /** * Collection of billing meters. */ -@Fluent +@Immutable public final class BillingMeterCollectionInner implements JsonSerializable { /* * Collection of billing meters. @@ -27,7 +26,7 @@ public final class BillingMeterCollectionInner implements JsonSerializable value() { return this.value; } - /** - * Set the value property: Collection of billing meters. - * - * @param value the value value to set. - * @return the BillingMeterCollectionInner object itself. - */ - public BillingMeterCollectionInner withValue(List value) { - this.value = value; - 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 BillingMeterCollectionInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(BillingMeterCollectionInner.class); - /** * {@inheritDoc} */ 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 7d3c6768dd29..0e36948086c1 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -127,17 +127,6 @@ public CertificateInner withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CheckMigrationEligibilityResponseInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CheckMigrationEligibilityResponseInner.java new file mode 100644 index 000000000000..ed15f145b779 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CheckMigrationEligibilityResponseInner.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.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 com.azure.resourcemanager.appcontainers.models.MigrationEligibilityFailureReason; +import java.io.IOException; +import java.util.List; + +/** + * Result of a read-only managed environment migration eligibility check. + */ +@Immutable +public final class CheckMigrationEligibilityResponseInner + implements JsonSerializable { + /* + * Whether the managed environment can migrate to the requested target mode. + */ + private boolean isEligible; + + /* + * The name of the managed environment that was checked. + */ + private String environmentName; + + /* + * The current mode of the managed environment. + */ + private String currentMode; + + /* + * The requested target mode. + */ + private String targetMode; + + /* + * The blocking reasons preventing migration. Empty when the managed environment is eligible. + */ + private List failureReasons; + + /** + * Creates an instance of CheckMigrationEligibilityResponseInner class. + */ + private CheckMigrationEligibilityResponseInner() { + } + + /** + * Get the isEligible property: Whether the managed environment can migrate to the requested target mode. + * + * @return the isEligible value. + */ + public boolean isEligible() { + return this.isEligible; + } + + /** + * Get the environmentName property: The name of the managed environment that was checked. + * + * @return the environmentName value. + */ + public String environmentName() { + return this.environmentName; + } + + /** + * Get the currentMode property: The current mode of the managed environment. + * + * @return the currentMode value. + */ + public String currentMode() { + return this.currentMode; + } + + /** + * Get the targetMode property: The requested target mode. + * + * @return the targetMode value. + */ + public String targetMode() { + return this.targetMode; + } + + /** + * Get the failureReasons property: The blocking reasons preventing migration. Empty when the managed environment is + * eligible. + * + * @return the failureReasons value. + */ + public List failureReasons() { + return this.failureReasons; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("isEligible", this.isEligible); + jsonWriter.writeStringField("environmentName", this.environmentName); + jsonWriter.writeStringField("currentMode", this.currentMode); + jsonWriter.writeStringField("targetMode", this.targetMode); + jsonWriter.writeArrayField("failureReasons", this.failureReasons, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckMigrationEligibilityResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckMigrationEligibilityResponseInner 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 CheckMigrationEligibilityResponseInner. + */ + public static CheckMigrationEligibilityResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckMigrationEligibilityResponseInner deserializedCheckMigrationEligibilityResponseInner + = new CheckMigrationEligibilityResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isEligible".equals(fieldName)) { + deserializedCheckMigrationEligibilityResponseInner.isEligible = reader.getBoolean(); + } else if ("environmentName".equals(fieldName)) { + deserializedCheckMigrationEligibilityResponseInner.environmentName = reader.getString(); + } else if ("currentMode".equals(fieldName)) { + deserializedCheckMigrationEligibilityResponseInner.currentMode = reader.getString(); + } else if ("targetMode".equals(fieldName)) { + deserializedCheckMigrationEligibilityResponseInner.targetMode = reader.getString(); + } else if ("failureReasons".equals(fieldName)) { + List failureReasons + = reader.readArray(reader1 -> MigrationEligibilityFailureReason.fromJson(reader1)); + deserializedCheckMigrationEligibilityResponseInner.failureReasons = failureReasons; + } else { + reader.skipChildren(); + } + } + + return deserializedCheckMigrationEligibilityResponseInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CheckNameAvailabilityResponseInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CheckNameAvailabilityResponseInner.java index 56fc0492ebf6..333090a278c4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CheckNameAvailabilityResponseInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CheckNameAvailabilityResponseInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The check availability result. */ -@Fluent +@Immutable public final class CheckNameAvailabilityResponseInner implements JsonSerializable { /* * Indicates if the resource name is available. @@ -28,14 +28,14 @@ public final class CheckNameAvailabilityResponseInner implements JsonSerializabl private CheckNameAvailabilityReason reason; /* - * Detailed reason why the given name is available. + * Detailed reason why the given name is not available. */ private String message; /** * Creates an instance of CheckNameAvailabilityResponseInner class. */ - public CheckNameAvailabilityResponseInner() { + private CheckNameAvailabilityResponseInner() { } /** @@ -47,17 +47,6 @@ public Boolean nameAvailable() { return this.nameAvailable; } - /** - * Set the nameAvailable property: Indicates if the resource name is available. - * - * @param nameAvailable the nameAvailable value to set. - * @return the CheckNameAvailabilityResponseInner object itself. - */ - public CheckNameAvailabilityResponseInner withNameAvailable(Boolean nameAvailable) { - this.nameAvailable = nameAvailable; - return this; - } - /** * Get the reason property: The reason why the given name is not available. * @@ -68,18 +57,7 @@ public CheckNameAvailabilityReason reason() { } /** - * Set the reason property: The reason why the given name is not available. - * - * @param reason the reason value to set. - * @return the CheckNameAvailabilityResponseInner object itself. - */ - public CheckNameAvailabilityResponseInner withReason(CheckNameAvailabilityReason reason) { - this.reason = reason; - return this; - } - - /** - * Get the message property: Detailed reason why the given name is available. + * Get the message property: Detailed reason why the given name is not available. * * @return the message value. */ @@ -87,25 +65,6 @@ public String message() { return this.message; } - /** - * Set the message property: Detailed reason why the given name is available. - * - * @param message the message value to set. - * @return the CheckNameAvailabilityResponseInner object itself. - */ - public CheckNameAvailabilityResponseInner withMessage(String message) { - this.message = message; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 df547fc71373..78bb4708d0b6 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -22,14 +22,14 @@ @Fluent public final class ConnectedEnvironmentInner extends Resource { /* - * The complex type of the extended location. + * ConnectedEnvironment resource specific properties */ - private ExtendedLocation extendedLocation; + private ConnectedEnvironmentProperties innerProperties; /* - * ConnectedEnvironment resource specific properties + * The complex type of the extended location. */ - private ConnectedEnvironmentProperties innerProperties; + private ExtendedLocation extendedLocation; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -57,6 +57,15 @@ public final class ConnectedEnvironmentInner extends Resource { public ConnectedEnvironmentInner() { } + /** + * Get the innerProperties property: ConnectedEnvironment resource specific properties. + * + * @return the innerProperties value. + */ + private ConnectedEnvironmentProperties innerProperties() { + return this.innerProperties; + } + /** * Get the extendedLocation property: The complex type of the extended location. * @@ -77,15 +86,6 @@ public ConnectedEnvironmentInner withExtendedLocation(ExtendedLocation extendedL return this; } - /** - * Get the innerProperties property: ConnectedEnvironment resource specific properties. - * - * @return the innerProperties value. - */ - private ConnectedEnvironmentProperties innerProperties() { - return this.innerProperties; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -242,20 +242,6 @@ public CustomDomainConfiguration customDomainConfiguration() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (extendedLocation() != null) { - extendedLocation().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -264,8 +250,8 @@ 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("properties", this.innerProperties); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); return jsonWriter.writeEndObject(); } @@ -296,11 +282,11 @@ public static ConnectedEnvironmentInner fromJson(JsonReader jsonReader) throws I } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedConnectedEnvironmentInner.withTags(tags); - } else if ("extendedLocation".equals(fieldName)) { - deserializedConnectedEnvironmentInner.extendedLocation = ExtendedLocation.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedConnectedEnvironmentInner.innerProperties = ConnectedEnvironmentProperties.fromJson(reader); + } else if ("extendedLocation".equals(fieldName)) { + deserializedConnectedEnvironmentInner.extendedLocation = ExtendedLocation.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedConnectedEnvironmentInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentProperties.java index b05be5ed6c4a..88828dd573be 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -144,17 +144,6 @@ public CustomDomainConfiguration customDomainConfiguration() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (customDomainConfiguration() != null) { - customDomainConfiguration().validate(); - } - } - /** * {@inheritDoc} */ 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 b65ffd691147..d0f42f525e39 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -108,17 +108,6 @@ 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} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentStoragesCollectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentStoragesCollectionInner.java index 167013bff41c..b83576fd0f02 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentStoragesCollectionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentStoragesCollectionInner.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +15,7 @@ /** * Collection of Storage for Environments. */ -@Fluent +@Immutable public final class ConnectedEnvironmentStoragesCollectionInner implements JsonSerializable { /* @@ -27,7 +26,7 @@ public final class ConnectedEnvironmentStoragesCollectionInner /** * Creates an instance of ConnectedEnvironmentStoragesCollectionInner class. */ - public ConnectedEnvironmentStoragesCollectionInner() { + private ConnectedEnvironmentStoragesCollectionInner() { } /** @@ -39,34 +38,6 @@ public List value() { return this.value; } - /** - * Set the value property: Collection of storage resources. - * - * @param value the value value to set. - * @return the ConnectedEnvironmentStoragesCollectionInner object itself. - */ - public ConnectedEnvironmentStoragesCollectionInner withValue(List value) { - this.value = value; - 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 ConnectedEnvironmentStoragesCollectionInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ConnectedEnvironmentStoragesCollectionInner.class); - /** * {@inheritDoc} */ 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 41f852b59300..07bbc8e98e3b 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -17,7 +17,7 @@ /** * Container App Auth Token. */ -@Fluent +@Immutable public final class ContainerAppAuthTokenInner extends Resource { /* * Container App auth token resource specific properties @@ -47,7 +47,7 @@ public final class ContainerAppAuthTokenInner extends Resource { /** * Creates an instance of ContainerAppAuthTokenInner class. */ - public ContainerAppAuthTokenInner() { + private ContainerAppAuthTokenInner() { } /** @@ -98,24 +98,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public ContainerAppAuthTokenInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ContainerAppAuthTokenInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the token property: Auth token value. * @@ -134,17 +116,6 @@ public OffsetDateTime expires() { return this.innerProperties() == null ? null : this.innerProperties().expires(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppAuthTokenProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppAuthTokenProperties.java index bdd867f58da3..8a9bde2b072b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppAuthTokenProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppAuthTokenProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -31,7 +31,7 @@ public final class ContainerAppAuthTokenProperties implements JsonSerializable writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); 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(); } @@ -481,6 +488,8 @@ public static ContainerAppInner fromJson(JsonReader jsonReader) throws IOExcepti } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedContainerAppInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedContainerAppInner.innerProperties = ContainerAppProperties.fromJson(reader); } else if ("extendedLocation".equals(fieldName)) { deserializedContainerAppInner.extendedLocation = ExtendedLocation.fromJson(reader); } else if ("identity".equals(fieldName)) { @@ -489,8 +498,6 @@ public static ContainerAppInner fromJson(JsonReader jsonReader) throws IOExcepti 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)) { deserializedContainerAppInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppJobExecutionsInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppJobExecutionsInner.java index 3b6331fec40d..41126b345230 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppJobExecutionsInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppJobExecutionsInner.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +15,26 @@ /** * Container App executions collection ARM resource. */ -@Fluent +@Immutable public final class ContainerAppJobExecutionsInner implements JsonSerializable { /* - * Collection of resources. + * The JobExecution items on this page */ private List value; /* - * Link to next page of resources. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ContainerAppJobExecutionsInner class. */ - public ContainerAppJobExecutionsInner() { + private ContainerAppJobExecutionsInner() { } /** - * Get the value property: Collection of resources. + * Get the value property: The JobExecution items on this page. * * @return the value value. */ @@ -44,18 +43,7 @@ public List value() { } /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the ContainerAppJobExecutionsInner object itself. - */ - public ContainerAppJobExecutionsInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,23 +51,6 @@ 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 ContainerAppJobExecutionsInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ContainerAppJobExecutionsInner.class); - /** * {@inheritDoc} */ @@ -87,6 +58,7 @@ public void validate() { 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(); } 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 1bcbf1fba3b6..23378a830938 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -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.ContainerAppNetworkingConfiguration; import com.azure.resourcemanager.appcontainers.models.ContainerAppProvisioningState; import com.azure.resourcemanager.appcontainers.models.ContainerAppRunningStatus; import com.azure.resourcemanager.appcontainers.models.Template; @@ -41,6 +42,11 @@ public final class ContainerAppProperties implements JsonSerializable { + ContainerAppsFunctionInner deserializedContainerAppsFunctionInner = new ContainerAppsFunctionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedContainerAppsFunctionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedContainerAppsFunctionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedContainerAppsFunctionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedContainerAppsFunctionInner.innerProperties + = ContainerAppsFunctionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedContainerAppsFunctionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppsFunctionInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppsFunctionProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppsFunctionProperties.java new file mode 100644 index 000000000000..f409c4887278 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppsFunctionProperties.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.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 com.azure.resourcemanager.appcontainers.models.ContainerAppsFunctionState; +import java.io.IOException; + +/** + * Function resource specific properties. + */ +@Immutable +public final class ContainerAppsFunctionProperties implements JsonSerializable { + /* + * Invoke URL for the function. + */ + private String invokeUrlTemplate; + + /* + * Trigger type of the function. + */ + private String triggerType; + + /* + * Programming language of the function. + */ + private String language; + + /* + * Indicates whether the function is disabled. This property is deprecated; use `state` instead. + */ + private Boolean isDisabled; + + /* + * The state of the function. + */ + private ContainerAppsFunctionState state; + + /** + * Creates an instance of ContainerAppsFunctionProperties class. + */ + private ContainerAppsFunctionProperties() { + } + + /** + * Get the invokeUrlTemplate property: Invoke URL for the function. + * + * @return the invokeUrlTemplate value. + */ + public String invokeUrlTemplate() { + return this.invokeUrlTemplate; + } + + /** + * Get the triggerType property: Trigger type of the function. + * + * @return the triggerType value. + */ + public String triggerType() { + return this.triggerType; + } + + /** + * Get the language property: Programming language of the function. + * + * @return the language value. + */ + public String language() { + return this.language; + } + + /** + * Get the isDisabled property: Indicates whether the function is disabled. This property is deprecated; use `state` + * instead. + * + * @return the isDisabled value. + */ + public Boolean isDisabled() { + return this.isDisabled; + } + + /** + * Get the state property: The state of the function. + * + * @return the state value. + */ + public ContainerAppsFunctionState state() { + return this.state; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppsFunctionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppsFunctionProperties 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 ContainerAppsFunctionProperties. + */ + public static ContainerAppsFunctionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppsFunctionProperties deserializedContainerAppsFunctionProperties + = new ContainerAppsFunctionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("invokeUrlTemplate".equals(fieldName)) { + deserializedContainerAppsFunctionProperties.invokeUrlTemplate = reader.getString(); + } else if ("triggerType".equals(fieldName)) { + deserializedContainerAppsFunctionProperties.triggerType = reader.getString(); + } else if ("language".equals(fieldName)) { + deserializedContainerAppsFunctionProperties.language = reader.getString(); + } else if ("isDisabled".equals(fieldName)) { + deserializedContainerAppsFunctionProperties.isDisabled = reader.getNullable(JsonReader::getBoolean); + } else if ("state".equals(fieldName)) { + deserializedContainerAppsFunctionProperties.state + = ContainerAppsFunctionState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppsFunctionProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CustomHostnameAnalysisResultInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CustomHostnameAnalysisResultInner.java index 823e86dc321e..28c1211ed935 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CustomHostnameAnalysisResultInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/CustomHostnameAnalysisResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +17,7 @@ /** * Custom domain analysis. */ -@Fluent +@Immutable public final class CustomHostnameAnalysisResultInner implements JsonSerializable { /* * Host name that was analyzed @@ -84,7 +84,7 @@ public final class CustomHostnameAnalysisResultInner implements JsonSerializable /** * Creates an instance of CustomHostnameAnalysisResultInner class. */ - public CustomHostnameAnalysisResultInner() { + private CustomHostnameAnalysisResultInner() { } /** @@ -163,17 +163,6 @@ public List cNameRecords() { return this.cNameRecords; } - /** - * Set the cNameRecords property: CName records visible for this hostname. - * - * @param cNameRecords the cNameRecords value to set. - * @return the CustomHostnameAnalysisResultInner object itself. - */ - public CustomHostnameAnalysisResultInner withCNameRecords(List cNameRecords) { - this.cNameRecords = cNameRecords; - return this; - } - /** * Get the txtRecords property: TXT records visible for this hostname. * @@ -183,17 +172,6 @@ public List txtRecords() { return this.txtRecords; } - /** - * Set the txtRecords property: TXT records visible for this hostname. - * - * @param txtRecords the txtRecords value to set. - * @return the CustomHostnameAnalysisResultInner object itself. - */ - public CustomHostnameAnalysisResultInner withTxtRecords(List txtRecords) { - this.txtRecords = txtRecords; - return this; - } - /** * Get the aRecords property: A records visible for this hostname. * @@ -203,17 +181,6 @@ public List aRecords() { return this.aRecords; } - /** - * Set the aRecords property: A records visible for this hostname. - * - * @param aRecords the aRecords value to set. - * @return the CustomHostnameAnalysisResultInner object itself. - */ - public CustomHostnameAnalysisResultInner withARecords(List aRecords) { - this.aRecords = aRecords; - return this; - } - /** * Get the alternateCNameRecords property: Alternate CName records visible for this hostname. * @@ -223,17 +190,6 @@ public List alternateCNameRecords() { return this.alternateCNameRecords; } - /** - * Set the alternateCNameRecords property: Alternate CName records visible for this hostname. - * - * @param alternateCNameRecords the alternateCNameRecords value to set. - * @return the CustomHostnameAnalysisResultInner object itself. - */ - public CustomHostnameAnalysisResultInner withAlternateCNameRecords(List alternateCNameRecords) { - this.alternateCNameRecords = alternateCNameRecords; - return this; - } - /** * Get the alternateTxtRecords property: Alternate TXT records visible for this hostname. * @@ -243,28 +199,6 @@ public List alternateTxtRecords() { return this.alternateTxtRecords; } - /** - * Set the alternateTxtRecords property: Alternate TXT records visible for this hostname. - * - * @param alternateTxtRecords the alternateTxtRecords value to set. - * @return the CustomHostnameAnalysisResultInner object itself. - */ - public CustomHostnameAnalysisResultInner withAlternateTxtRecords(List alternateTxtRecords) { - this.alternateTxtRecords = alternateTxtRecords; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (customDomainVerificationFailureInfo() != null) { - customDomainVerificationFailureInfo().validate(); - } - } - /** * {@inheritDoc} */ 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 55c7f9ee173b..8f773462de8a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -285,7 +285,7 @@ public DaprComponentInner withScopes(List scopes) { } /** - * Get the provisioningState property: Provisioning state of the Dapr Component. + * Get the provisioningState property: Provisioning state of the Connected Environment Dapr Component. * * @return the provisioningState value. */ @@ -302,17 +302,6 @@ public String deploymentErrors() { return this.innerProperties() == null ? null : this.innerProperties().deploymentErrors(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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 ab4d8ed63531..7922b94a4b96 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -61,7 +61,7 @@ public final class DaprComponentProperties implements JsonSerializable scopes; /* - * Provisioning state of the Dapr Component. + * Provisioning state of the Connected Environment Dapr Component. */ private DaprComponentProvisioningState provisioningState; @@ -237,7 +237,7 @@ public DaprComponentProperties withScopes(List scopes) { } /** - * Get the provisioningState property: Provisioning state of the Dapr Component. + * Get the provisioningState property: Provisioning state of the Connected Environment Dapr Component. * * @return the provisioningState value. */ @@ -254,20 +254,6 @@ public String deploymentErrors() { return this.deploymentErrors; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (secrets() != null) { - secrets().forEach(e -> e.validate()); - } - if (metadata() != null) { - metadata().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ 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 000000000000..1a01ec890a9b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentResiliencyPolicyInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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 000000000000..65bf90e09d3d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprComponentResiliencyPolicyProperties.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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/DaprSecretsCollectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSecretsCollectionInner.java index 0e76693a0119..ad385b6413f7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSecretsCollectionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSecretsCollectionInner.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +16,7 @@ /** * Dapr component Secrets Collection for ListSecrets Action. */ -@Fluent +@Immutable public final class DaprSecretsCollectionInner implements JsonSerializable { /* * Collection of secrets used by a Dapr component @@ -27,7 +26,7 @@ public final class DaprSecretsCollectionInner implements JsonSerializable value() { return this.value; } - /** - * Set the value property: Collection of secrets used by a Dapr component. - * - * @param value the value value to set. - * @return the DaprSecretsCollectionInner object itself. - */ - public DaprSecretsCollectionInner withValue(List value) { - this.value = value; - 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 DaprSecretsCollectionInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DaprSecretsCollectionInner.class); - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DiagnosticsCollectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DiagnosticsCollectionInner.java index 23eacdf53c2d..351527db2900 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DiagnosticsCollectionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DiagnosticsCollectionInner.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +15,26 @@ /** * Diagnostics data collection for a resource. */ -@Fluent +@Immutable public final class DiagnosticsCollectionInner implements JsonSerializable { /* - * Collection of diagnostic data. + * The Diagnostics items on this page */ private List value; /* - * Link to next page of resources. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of DiagnosticsCollectionInner class. */ - public DiagnosticsCollectionInner() { + private DiagnosticsCollectionInner() { } /** - * Get the value property: Collection of diagnostic data. + * Get the value property: The Diagnostics items on this page. * * @return the value value. */ @@ -44,18 +43,7 @@ public List value() { } /** - * Set the value property: Collection of diagnostic data. - * - * @param value the value value to set. - * @return the DiagnosticsCollectionInner object itself. - */ - public DiagnosticsCollectionInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,23 +51,6 @@ 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 DiagnosticsCollectionInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DiagnosticsCollectionInner.class); - /** * {@inheritDoc} */ @@ -87,6 +58,7 @@ public void validate() { 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(); } 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 f10dbcc28fe0..f50170832b6c 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -16,10 +16,10 @@ /** * Diagnostics data for a resource. */ -@Fluent +@Immutable public final class DiagnosticsInner extends ProxyResource { /* - * Diagnostics resource specific properties + * The resource-specific properties for this resource. */ private DiagnosticsProperties properties; @@ -46,11 +46,11 @@ public final class DiagnosticsInner extends ProxyResource { /** * Creates an instance of DiagnosticsInner class. */ - public DiagnosticsInner() { + private DiagnosticsInner() { } /** - * Get the properties property: Diagnostics resource specific properties. + * Get the properties property: The resource-specific properties for this resource. * * @return the properties value. */ @@ -58,17 +58,6 @@ public DiagnosticsProperties properties() { return this.properties; } - /** - * Set the properties property: Diagnostics resource specific properties. - * - * @param properties the properties value to set. - * @return the DiagnosticsInner object itself. - */ - public DiagnosticsInner withProperties(DiagnosticsProperties properties) { - this.properties = properties; - return this; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -108,17 +97,6 @@ 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} */ 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 000000000000..5b2b1871a858 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DotNetComponentInner.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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 000000000000..b1e3ceef0931 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DotNetComponentProperties.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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 0e95d91fd757..e51ec53ec607 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -17,7 +17,7 @@ /** * Environment Auth Token. */ -@Fluent +@Immutable public final class EnvironmentAuthTokenInner extends Resource { /* * Environment auth token resource specific properties @@ -47,7 +47,7 @@ public final class EnvironmentAuthTokenInner extends Resource { /** * Creates an instance of EnvironmentAuthTokenInner class. */ - public EnvironmentAuthTokenInner() { + private EnvironmentAuthTokenInner() { } /** @@ -98,24 +98,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public EnvironmentAuthTokenInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public EnvironmentAuthTokenInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the token property: Auth token value. * @@ -134,17 +116,6 @@ public OffsetDateTime expires() { return this.innerProperties() == null ? null : this.innerProperties().expires(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/EnvironmentAuthTokenProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/EnvironmentAuthTokenProperties.java index 494d43da9dcd..7117aa7943a7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/EnvironmentAuthTokenProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/EnvironmentAuthTokenProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -31,7 +31,7 @@ public final class EnvironmentAuthTokenProperties implements JsonSerializable { /* * Job execution name. @@ -29,7 +29,7 @@ public final class JobExecutionBaseInner implements JsonSerializable { +@Immutable +public final class JobExecutionInner extends ProxyResource { /* - * Job execution Name. + * Container Apps Job execution specific properties. */ - private String name; + private JobExecutionProperties innerProperties; /* - * Job execution Id. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private String id; + private SystemData systemData; /* - * Job execution type + * The type of the resource. */ private String type; /* - * Container Apps Job execution specific properties. + * The name of the resource. */ - private JobExecutionProperties innerProperties; - - /** - * Creates an instance of JobExecutionInner class. - */ - public JobExecutionInner() { - } + private String name; - /** - * Get the name property: Job execution Name. - * - * @return the name value. + /* + * Fully qualified resource Id for the resource. */ - public String name() { - return this.name; - } + private String id; /** - * Set the name property: Job execution Name. - * - * @param name the name value to set. - * @return the JobExecutionInner object itself. + * Creates an instance of JobExecutionInner class. */ - public JobExecutionInner withName(String name) { - this.name = name; - return this; + private JobExecutionInner() { } /** - * Get the id property: Job execution Id. + * Get the innerProperties property: Container Apps Job execution specific properties. * - * @return the id value. + * @return the innerProperties value. */ - public String id() { - return this.id; + private JobExecutionProperties innerProperties() { + return this.innerProperties; } /** - * Set the id property: Job execution Id. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @param id the id value to set. - * @return the JobExecutionInner object itself. + * @return the systemData value. */ - public JobExecutionInner withId(String id) { - this.id = id; - return this; + public SystemData systemData() { + return this.systemData; } /** - * Get the type property: Job execution type. + * Get the type property: The type of the resource. * * @return the type value. */ + @Override public String type() { return this.type; } /** - * Set the type property: Job execution type. + * Get the name property: The name of the resource. * - * @param type the type value to set. - * @return the JobExecutionInner object itself. + * @return the name value. */ - public JobExecutionInner withType(String type) { - this.type = type; - return this; + @Override + public String name() { + return this.name; } /** - * Get the innerProperties property: Container Apps Job execution specific properties. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the innerProperties value. + * @return the id value. */ - private JobExecutionProperties innerProperties() { - return this.innerProperties; + @Override + public String id() { + return this.id; } /** @@ -132,20 +118,6 @@ public OffsetDateTime startTime() { return this.innerProperties() == null ? null : this.innerProperties().startTime(); } - /** - * Set the startTime property: Job execution start time. - * - * @param startTime the startTime value to set. - * @return the JobExecutionInner object itself. - */ - public JobExecutionInner withStartTime(OffsetDateTime startTime) { - if (this.innerProperties() == null) { - this.innerProperties = new JobExecutionProperties(); - } - this.innerProperties().withStartTime(startTime); - return this; - } - /** * Get the endTime property: Job execution end time. * @@ -155,20 +127,6 @@ public OffsetDateTime endTime() { return this.innerProperties() == null ? null : this.innerProperties().endTime(); } - /** - * Set the endTime property: Job execution end time. - * - * @param endTime the endTime value to set. - * @return the JobExecutionInner object itself. - */ - public JobExecutionInner withEndTime(OffsetDateTime endTime) { - if (this.innerProperties() == null) { - this.innerProperties = new JobExecutionProperties(); - } - this.innerProperties().withEndTime(endTime); - return this; - } - /** * Get the template property: Job's execution container. * @@ -179,28 +137,31 @@ public JobExecutionTemplate template() { } /** - * Set the template property: Job's execution container. + * 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(); + } + + /** + * Get the reason property: Reason for the current condition of job execution. * - * @param template the template value to set. - * @return the JobExecutionInner object itself. - */ - public JobExecutionInner withTemplate(JobExecutionTemplate template) { - if (this.innerProperties() == null) { - this.innerProperties = new JobExecutionProperties(); - } - this.innerProperties().withTemplate(template); - return this; + * @return the reason value. + */ + public String reason() { + return this.innerProperties() == null ? null : this.innerProperties().reason(); } /** - * Validates the instance. + * Get the message property: Human readable message indicating details about the current condition of the job + * execution. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the message value. */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } + public String message() { + return this.innerProperties() == null ? null : this.innerProperties().message(); } /** @@ -209,9 +170,6 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("type", this.type); jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -222,6 +180,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of JobExecutionInner 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 JobExecutionInner. */ public static JobExecutionInner fromJson(JsonReader jsonReader) throws IOException { @@ -231,14 +190,16 @@ public static JobExecutionInner fromJson(JsonReader jsonReader) throws IOExcepti String fieldName = reader.getFieldName(); reader.nextToken(); - if ("name".equals(fieldName)) { - deserializedJobExecutionInner.name = reader.getString(); - } else if ("id".equals(fieldName)) { + if ("id".equals(fieldName)) { deserializedJobExecutionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedJobExecutionInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedJobExecutionInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedJobExecutionInner.innerProperties = JobExecutionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedJobExecutionInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } 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 e1ed19641b89..5da5acb45d21 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 @@ -1,15 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; -import com.azure.core.annotation.Fluent; +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 com.azure.resourcemanager.appcontainers.models.ExecutionStatus; import com.azure.resourcemanager.appcontainers.models.JobExecutionRunningState; import com.azure.resourcemanager.appcontainers.models.JobExecutionTemplate; import java.io.IOException; @@ -19,7 +20,7 @@ /** * Container Apps Job execution specific properties. */ -@Fluent +@Immutable public final class JobExecutionProperties implements JsonSerializable { /* * Current running State of the job @@ -41,10 +42,25 @@ 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 if ("reason".equals(fieldName)) { + deserializedJobExecutionProperties.reason = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedJobExecutionProperties.message = reader.getString(); } 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 33a02ae9daf4..bfebb9f3b883 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -12,6 +12,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 com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; import java.io.IOException; @@ -24,15 +25,14 @@ @Fluent public final class JobInner extends Resource { /* - * Managed identities needed by a container app job to interact with other Azure services to not maintain any - * secrets or credentials in code. + * Container Apps Job resource specific properties. */ - private ManagedServiceIdentity identity; + private JobProperties innerProperties; /* - * Container Apps Job resource specific properties. + * The managed service identities assigned to this resource. */ - private JobProperties innerProperties; + private ManagedServiceIdentity identity; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -61,8 +61,16 @@ public JobInner() { } /** - * 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. + * Get the innerProperties property: Container Apps Job resource specific properties. + * + * @return the innerProperties value. + */ + private JobProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the identity property: The managed service identities assigned to this resource. * * @return the identity value. */ @@ -71,8 +79,7 @@ public ManagedServiceIdentity identity() { } /** - * Set 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. + * Set the identity property: The managed service identities assigned to this resource. * * @param identity the identity value to set. * @return the JobInner object itself. @@ -82,15 +89,6 @@ public JobInner withIdentity(ManagedServiceIdentity identity) { return this; } - /** - * Get the innerProperties property: Container Apps Job resource specific properties. - * - * @return the innerProperties value. - */ - private JobProperties innerProperties() { - return this.innerProperties; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -157,6 +155,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. * @@ -267,20 +274,6 @@ public String eventStreamEndpoint() { return this.innerProperties() == null ? null : this.innerProperties().eventStreamEndpoint(); } - /** - * 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} */ @@ -289,8 +282,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("identity", this.identity); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -321,10 +314,10 @@ 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 ("identity".equals(fieldName)) { - deserializedJobInner.identity = ManagedServiceIdentity.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedJobInner.innerProperties = JobProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedJobInner.identity = ManagedServiceIdentity.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedJobInner.systemData = SystemData.fromJson(reader); } else { 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 f5b84eefb271..77332ec969fb 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -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. * @@ -168,20 +183,6 @@ public String eventStreamEndpoint() { return this.eventStreamEndpoint; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - if (template() != null) { - template().validate(); - } - } - /** * {@inheritDoc} */ @@ -212,6 +213,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/JobSecretsCollectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobSecretsCollectionInner.java index db7a2b3b449f..3cb6b831ac2b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobSecretsCollectionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobSecretsCollectionInner.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +16,7 @@ /** * Container Apps Job Secrets Collection ARM resource. */ -@Fluent +@Immutable public final class JobSecretsCollectionInner implements JsonSerializable { /* * Collection of resources. @@ -27,7 +26,7 @@ public final class JobSecretsCollectionInner implements JsonSerializable value() { return this.value; } - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the JobSecretsCollectionInner object itself. - */ - public JobSecretsCollectionInner withValue(List value) { - this.value = value; - 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 JobSecretsCollectionInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(JobSecretsCollectionInner.class); - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/LabelHistoryInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/LabelHistoryInner.java new file mode 100644 index 000000000000..af4e16fa6975 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/LabelHistoryInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.LabelHistoryProperties; +import java.io.IOException; + +/** + * Container App Label History. + */ +@Immutable +public final class LabelHistoryInner extends ProxyResource { + /* + * Container App Label History resource specific properties + */ + private LabelHistoryProperties 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 LabelHistoryInner class. + */ + private LabelHistoryInner() { + } + + /** + * Get the properties property: Container App Label History resource specific properties. + * + * @return the properties value. + */ + public LabelHistoryProperties 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LabelHistoryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LabelHistoryInner 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 LabelHistoryInner. + */ + public static LabelHistoryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LabelHistoryInner deserializedLabelHistoryInner = new LabelHistoryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLabelHistoryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLabelHistoryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLabelHistoryInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedLabelHistoryInner.properties = LabelHistoryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLabelHistoryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLabelHistoryInner; + }); + } +} 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 index 15fc47ba28da..1e39b22393e8 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -82,14 +82,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/MaintenanceConfigurationResourceInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/MaintenanceConfigurationResourceInner.java index 38c3546098ce..60124cc8eb19 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/MaintenanceConfigurationResourceInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/MaintenanceConfigurationResourceInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -121,17 +121,6 @@ public MaintenanceConfigurationResourceInner withScheduledEntries(List tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ 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 bef41147b6f8..5c03ca64788b 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -10,15 +10,18 @@ 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; import com.azure.resourcemanager.appcontainers.models.EnvironmentProvisioningState; import com.azure.resourcemanager.appcontainers.models.IngressConfiguration; import com.azure.resourcemanager.appcontainers.models.KedaConfiguration; +import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentMode; 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; @@ -32,20 +35,19 @@ @Fluent public final class ManagedEnvironmentInner extends Resource { /* - * Kind of the Environment. + * Managed environment resource specific properties */ - private String kind; + private ManagedEnvironmentProperties innerProperties; /* - * Managed identities for the Managed Environment to interact with other Azure services without maintaining any - * secrets or credentials in code. + * Kind of the Environment. */ - private ManagedServiceIdentity identity; + private String kind; /* - * Managed environment resource specific properties + * The managed service identities assigned to this resource. */ - private ManagedEnvironmentProperties innerProperties; + private ManagedServiceIdentity identity; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -73,6 +75,15 @@ public final class ManagedEnvironmentInner extends Resource { public ManagedEnvironmentInner() { } + /** + * Get the innerProperties property: Managed environment resource specific properties. + * + * @return the innerProperties value. + */ + private ManagedEnvironmentProperties innerProperties() { + return this.innerProperties; + } + /** * Get the kind property: Kind of the Environment. * @@ -94,8 +105,7 @@ public ManagedEnvironmentInner withKind(String kind) { } /** - * Get the identity property: Managed identities for the Managed Environment to interact with other Azure services - * without maintaining any secrets or credentials in code. + * Get the identity property: The managed service identities assigned to this resource. * * @return the identity value. */ @@ -104,8 +114,7 @@ public ManagedServiceIdentity 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. + * Set the identity property: The managed service identities assigned to this resource. * * @param identity the identity value to set. * @return the ManagedEnvironmentInner object itself. @@ -115,15 +124,6 @@ public ManagedEnvironmentInner withIdentity(ManagedServiceIdentity identity) { return this; } - /** - * Get the innerProperties property: Managed environment resource specific properties. - * - * @return the innerProperties value. - */ - private ManagedEnvironmentProperties innerProperties() { - return this.innerProperties; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -315,6 +315,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. * @@ -537,6 +584,31 @@ public ManagedEnvironmentInner withIngressConfiguration(IngressConfiguration ing return this; } + /** + * Get the environmentMode property: Mode of the environment. Allowed Values: 'ConsumptionOnly', 'WorkloadProfiles', + * 'Express', 'Archived'. + * + * @return the environmentMode value. + */ + public ManagedEnvironmentMode environmentMode() { + return this.innerProperties() == null ? null : this.innerProperties().environmentMode(); + } + + /** + * Set the environmentMode property: Mode of the environment. Allowed Values: 'ConsumptionOnly', 'WorkloadProfiles', + * 'Express', 'Archived'. + * + * @param environmentMode the environmentMode value to set. + * @return the ManagedEnvironmentInner object itself. + */ + public ManagedEnvironmentInner withEnvironmentMode(ManagedEnvironmentMode environmentMode) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedEnvironmentProperties(); + } + this.innerProperties().withEnvironmentMode(environmentMode); + return this; + } + /** * Get the privateEndpointConnections property: Private endpoint connections to the resource. * @@ -571,20 +643,6 @@ public ManagedEnvironmentInner withPublicNetworkAccess(PublicNetworkAccess publi 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} */ @@ -593,9 +651,9 @@ 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.writeStringField("kind", this.kind); jsonWriter.writeJsonField("identity", this.identity); - jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -626,12 +684,12 @@ public static ManagedEnvironmentInner fromJson(JsonReader jsonReader) throws IOE } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedManagedEnvironmentInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedManagedEnvironmentInner.innerProperties = ManagedEnvironmentProperties.fromJson(reader); } 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)) { deserializedManagedEnvironmentInner.systemData = SystemData.fromJson(reader); } else { 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 5f91f82673bb..cd7460581afa 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -9,14 +9,17 @@ 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; import com.azure.resourcemanager.appcontainers.models.EnvironmentProvisioningState; import com.azure.resourcemanager.appcontainers.models.IngressConfiguration; import com.azure.resourcemanager.appcontainers.models.KedaConfiguration; +import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentMode; 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; @@ -64,10 +67,20 @@ public final class ManagedEnvironmentProperties implements JsonSerializable e.validate()); - } - if (kedaConfiguration() != null) { - kedaConfiguration().validate(); - } - if (daprConfiguration() != null) { - daprConfiguration().validate(); - } - if (peerAuthentication() != null) { - peerAuthentication().validate(); - } - if (peerTrafficConfiguration() != null) { - peerTrafficConfiguration().validate(); - } - if (ingressConfiguration() != null) { - ingressConfiguration().validate(); - } - if (privateEndpointConnections() != null) { - privateEndpointConnections().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -532,6 +576,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, @@ -542,6 +588,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("peerAuthentication", this.peerAuthentication); jsonWriter.writeJsonField("peerTrafficConfiguration", this.peerTrafficConfiguration); jsonWriter.writeJsonField("ingressConfiguration", this.ingressConfiguration); + jsonWriter.writeStringField("environmentMode", + this.environmentMode == null ? null : this.environmentMode.toString()); jsonWriter.writeStringField("publicNetworkAccess", this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); return jsonWriter.writeEndObject(); @@ -580,6 +628,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)) { @@ -606,6 +660,9 @@ public static ManagedEnvironmentProperties fromJson(JsonReader jsonReader) throw } else if ("ingressConfiguration".equals(fieldName)) { deserializedManagedEnvironmentProperties.ingressConfiguration = IngressConfiguration.fromJson(reader); + } else if ("environmentMode".equals(fieldName)) { + deserializedManagedEnvironmentProperties.environmentMode + = ManagedEnvironmentMode.fromString(reader.getString()); } else if ("privateEndpointConnections".equals(fieldName)) { List privateEndpointConnections = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); 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 47955d01bdbf..cec323b427e3 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -108,17 +108,6 @@ 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} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentStoragesCollectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentStoragesCollectionInner.java index ca0c960c9eab..1c39a5295d67 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentStoragesCollectionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentStoragesCollectionInner.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +15,7 @@ /** * Collection of Storage for Environments. */ -@Fluent +@Immutable public final class ManagedEnvironmentStoragesCollectionInner implements JsonSerializable { /* @@ -27,7 +26,7 @@ public final class ManagedEnvironmentStoragesCollectionInner /** * Creates an instance of ManagedEnvironmentStoragesCollectionInner class. */ - public ManagedEnvironmentStoragesCollectionInner() { + private ManagedEnvironmentStoragesCollectionInner() { } /** @@ -39,34 +38,6 @@ public List value() { return this.value; } - /** - * Set the value property: Collection of storage resources. - * - * @param value the value value to set. - * @return the ManagedEnvironmentStoragesCollectionInner object itself. - */ - public ManagedEnvironmentStoragesCollectionInner withValue(List value) { - this.value = value; - 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 ManagedEnvironmentStoragesCollectionInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ManagedEnvironmentStoragesCollectionInner.class); - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/OperationDetailInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/OperationDetailInner.java index d67f73e58a9b..32443ad0c27a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/OperationDetailInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/OperationDetailInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Operation detail payload. */ -@Fluent +@Immutable public final class OperationDetailInner implements JsonSerializable { /* * Name of the operation @@ -40,7 +40,7 @@ public final class OperationDetailInner implements JsonSerializable 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} */ 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 index f47ea4ff34d9..6152f8294a0c 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Properties of a private link resource. */ -@Fluent +@Immutable public final class PrivateLinkResourceProperties implements JsonSerializable { /* * The private link resource group id. @@ -35,7 +35,7 @@ public final class PrivateLinkResourceProperties implements JsonSerializable 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} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaCollectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaCollectionInner.java index fb0c68b00763..66c537884a43 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaCollectionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaCollectionInner.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +15,7 @@ /** * Container App Revision Replicas collection ARM resource. */ -@Fluent +@Immutable public final class ReplicaCollectionInner implements JsonSerializable { /* * Collection of resources. @@ -26,7 +25,7 @@ public final class ReplicaCollectionInner implements JsonSerializable value() { return this.value; } - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the ReplicaCollectionInner object itself. - */ - public ReplicaCollectionInner withValue(List value) { - this.value = value; - 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 ReplicaCollectionInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ReplicaCollectionInner.class); - /** * {@inheritDoc} */ 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 883cb069be6f..1a99d57e7ea5 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -19,7 +19,7 @@ /** * Container App Revision Replica. */ -@Fluent +@Immutable public final class ReplicaInner extends ProxyResource { /* * Replica resource specific properties @@ -49,7 +49,7 @@ public final class ReplicaInner extends ProxyResource { /** * Creates an instance of ReplicaInner class. */ - public ReplicaInner() { + private ReplicaInner() { } /** @@ -136,20 +136,6 @@ public List containers() { return this.innerProperties() == null ? null : this.innerProperties().containers(); } - /** - * Set the containers property: The containers collection under a replica. - * - * @param containers the containers value to set. - * @return the ReplicaInner object itself. - */ - public ReplicaInner withContainers(List containers) { - if (this.innerProperties() == null) { - this.innerProperties = new ReplicaProperties(); - } - this.innerProperties().withContainers(containers); - return this; - } - /** * Get the initContainers property: The init containers collection under a replica. * @@ -159,31 +145,6 @@ public List initContainers() { return this.innerProperties() == null ? null : this.innerProperties().initContainers(); } - /** - * Set the initContainers property: The init containers collection under a replica. - * - * @param initContainers the initContainers value to set. - * @return the ReplicaInner object itself. - */ - public ReplicaInner withInitContainers(List initContainers) { - if (this.innerProperties() == null) { - this.innerProperties = new ReplicaProperties(); - } - this.innerProperties().withInitContainers(initContainers); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaProperties.java index f2ba7088effc..5dbb2f512edd 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -19,7 +19,7 @@ /** * Replica resource specific properties. */ -@Fluent +@Immutable public final class ReplicaProperties implements JsonSerializable { /* * Timestamp describing when the pod was created by controller @@ -49,7 +49,7 @@ public final class ReplicaProperties implements JsonSerializable containers() { return this.containers; } - /** - * Set the containers property: The containers collection under a replica. - * - * @param containers the containers value to set. - * @return the ReplicaProperties object itself. - */ - public ReplicaProperties withContainers(List containers) { - this.containers = containers; - return this; - } - /** * Get the initContainers property: The init containers collection under a replica. * @@ -108,31 +97,6 @@ public List initContainers() { return this.initContainers; } - /** - * Set the initContainers property: The init containers collection under a replica. - * - * @param initContainers the initContainers value to set. - * @return the ReplicaProperties object itself. - */ - public ReplicaProperties withInitContainers(List initContainers) { - this.initContainers = initContainers; - 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()); - } - if (initContainers() != null) { - initContainers().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ 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 7e1d14ba2e14..658f7d0f3970 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -50,7 +50,7 @@ public final class RevisionInner extends ProxyResource { /** * Creates an instance of RevisionInner class. */ - public RevisionInner() { + private RevisionInner() { } /** @@ -204,17 +204,6 @@ public RevisionRunningState runningState() { return this.innerProperties() == null ? null : this.innerProperties().runningState(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/RevisionProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/RevisionProperties.java index 29f8e0525ebb..34f98d13cd71 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/RevisionProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/RevisionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -83,7 +83,7 @@ public final class RevisionProperties implements JsonSerializable tags) { + super.withTags(tags); + return this; + } + + /** + * {@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.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SandboxGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SandboxGroupInner 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 SandboxGroupInner. + */ + public static SandboxGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SandboxGroupInner deserializedSandboxGroupInner = new SandboxGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSandboxGroupInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSandboxGroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSandboxGroupInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSandboxGroupInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSandboxGroupInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSandboxGroupInner.properties = SandboxGroupProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSandboxGroupInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSandboxGroupInner; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ScheduledEntries.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ScheduledEntries.java index 1eaf540e78fb..7a6a0f86a6e6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ScheduledEntries.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ScheduledEntries.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -50,23 +49,6 @@ public ScheduledEntries withScheduledEntries(List scheduledEntri return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (scheduledEntries() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property scheduledEntries in model ScheduledEntries")); - } else { - scheduledEntries().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ScheduledEntries.class); - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SecretsCollectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SecretsCollectionInner.java index 89c90347637c..d7805931fe7a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SecretsCollectionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SecretsCollectionInner.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +16,7 @@ /** * Container App Secrets Collection ARM resource. */ -@Fluent +@Immutable public final class SecretsCollectionInner implements JsonSerializable { /* * Collection of resources. @@ -27,7 +26,7 @@ public final class SecretsCollectionInner implements JsonSerializable value() { return this.value; } - /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the SecretsCollectionInner object itself. - */ - public SecretsCollectionInner withValue(List value) { - this.value = value; - 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 SecretsCollectionInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecretsCollectionInner.class); - /** * {@inheritDoc} */ 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 index b78023bf7bca..2d7d9af89c47 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -30,15 +30,14 @@ @Fluent public final class SessionPoolInner extends Resource { /* - * Managed identities needed by a session pool to interact with other Azure services to not maintain any secrets or - * credentials in code. + * Container App session pool resource specific properties */ - private ManagedServiceIdentity identity; + private SessionPoolProperties innerProperties; /* - * Container App session pool resource specific properties + * The managed service identities assigned to this resource. */ - private SessionPoolProperties innerProperties; + private ManagedServiceIdentity identity; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -67,8 +66,16 @@ public SessionPoolInner() { } /** - * Get the identity property: Managed identities needed by a session pool to interact with other Azure services to - * not maintain any secrets or credentials in code. + * Get the innerProperties property: Container App session pool resource specific properties. + * + * @return the innerProperties value. + */ + private SessionPoolProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the identity property: The managed service identities assigned to this resource. * * @return the identity value. */ @@ -77,8 +84,7 @@ public ManagedServiceIdentity identity() { } /** - * Set the identity property: Managed identities needed by a session pool to interact with other Azure services to - * not maintain any secrets or credentials in code. + * Set the identity property: The managed service identities assigned to this resource. * * @param identity the identity value to set. * @return the SessionPoolInner object itself. @@ -88,15 +94,6 @@ public SessionPoolInner withIdentity(ManagedServiceIdentity identity) { return this; } - /** - * 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. * @@ -178,7 +175,8 @@ public SessionPoolInner withEnvironmentId(String environmentId) { } /** - * Get the containerType property: The container type of the sessions. + * Get the containerType property: The container type of the sessions. You can use your own container to build the + * session pool, or you can use a predefined container to run workload with specific language. * * @return the containerType value. */ @@ -187,7 +185,8 @@ public ContainerType containerType() { } /** - * Set the containerType property: The container type of the sessions. + * Set the containerType property: The container type of the sessions. You can use your own container to build the + * session pool, or you can use a predefined container to run workload with specific language. * * @param containerType the containerType value to set. * @return the SessionPoolInner object itself. @@ -392,20 +391,6 @@ public SessionPoolInner withManagedIdentitySettings(List 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} */ @@ -414,8 +399,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("identity", this.identity); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -446,10 +431,10 @@ public static SessionPoolInner fromJson(JsonReader jsonReader) throws IOExceptio } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedSessionPoolInner.withTags(tags); - } else if ("identity".equals(fieldName)) { - deserializedSessionPoolInner.identity = ManagedServiceIdentity.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedSessionPoolInner.innerProperties = SessionPoolProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedSessionPoolInner.identity = ManagedServiceIdentity.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedSessionPoolInner.systemData = SystemData.fromJson(reader); } else { 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 index b32bd41995dc..aa36a29c056c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -32,7 +32,8 @@ public final class SessionPoolProperties implements JsonSerializable e.validate()); - } - if (dynamicPoolConfiguration() != null) { - dynamicPoolConfiguration().validate(); - } - if (customContainerTemplate() != null) { - customContainerTemplate().validate(); - } - if (sessionNetworkConfiguration() != null) { - sessionNetworkConfiguration().validate(); - } - if (managedIdentitySettings() != null) { - managedIdentitySettings().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ 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 index d826fa30dd3e..9f16cb4a6a19 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -159,29 +159,6 @@ public 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} */ 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 21c58f99bc1e..cae72d9b5bed 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -180,17 +180,6 @@ public SourceControlInner withGithubActionConfiguration(GithubActionConfiguratio return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SourceControlProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SourceControlProperties.java index 798cb258d277..61cee530955b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SourceControlProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/SourceControlProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; @@ -119,17 +119,6 @@ public SourceControlProperties withGithubActionConfiguration(GithubActionConfigu return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (githubActionConfiguration() != null) { - githubActionConfiguration().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/UsageInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/UsageInner.java index 2f42763df5db..361c73e13d39 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/UsageInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/UsageInner.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +15,7 @@ /** * Describes Compute Resource Usage. */ -@Fluent +@Immutable public final class UsageInner implements JsonSerializable { /* * An enum describing the unit of usage measurement. @@ -41,7 +40,7 @@ public final class UsageInner implements JsonSerializable { /** * Creates an instance of UsageInner class. */ - public UsageInner() { + private UsageInner() { } /** @@ -62,17 +61,6 @@ public float currentValue() { return this.currentValue; } - /** - * Set the currentValue property: The current usage of the resource. - * - * @param currentValue the currentValue value to set. - * @return the UsageInner object itself. - */ - public UsageInner withCurrentValue(float currentValue) { - this.currentValue = currentValue; - return this; - } - /** * Get the limit property: The maximum permitted usage of the resource. * @@ -82,17 +70,6 @@ public float limit() { return this.limit; } - /** - * Set the limit property: The maximum permitted usage of the resource. - * - * @param limit the limit value to set. - * @return the UsageInner object itself. - */ - public UsageInner withLimit(float limit) { - this.limit = limit; - return this; - } - /** * Get the name property: The name of the type of usage. * @@ -102,33 +79,6 @@ public UsageName name() { return this.name; } - /** - * Set the name property: The name of the type of usage. - * - * @param name the name value to set. - * @return the UsageInner object itself. - */ - public UsageInner withName(UsageName name) { - this.name = name; - 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 UsageInner")); - } else { - name().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(UsageInner.class); - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/VnetConnectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/VnetConnectionInner.java new file mode 100644 index 000000000000..5f4fb1d12976 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/VnetConnectionInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.VnetConnectionProperties; +import java.io.IOException; + +/** + * A virtual network connection associated with a SandboxGroup. + */ +@Fluent +public final class VnetConnectionInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private VnetConnectionProperties 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 VnetConnectionInner class. + */ + public VnetConnectionInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public VnetConnectionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the VnetConnectionInner object itself. + */ + public VnetConnectionInner withProperties(VnetConnectionProperties 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VnetConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VnetConnectionInner 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 VnetConnectionInner. + */ + public static VnetConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VnetConnectionInner deserializedVnetConnectionInner = new VnetConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVnetConnectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedVnetConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVnetConnectionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedVnetConnectionInner.properties = VnetConnectionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedVnetConnectionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVnetConnectionInner; + }); + } +} 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 index 3566e3620f1e..b2d1b8170990 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -17,17 +17,17 @@ /** * Schema for the workflow object. */ -@Fluent +@Immutable public final class WorkflowEnvelopeInner extends ProxyResource { /* - * Gets the logic app hybrid workflow kind. + * Additional workflow properties. */ - private WorkflowKind kind; + private WorkflowEnvelopeProperties properties; /* - * Additional workflow properties. + * Gets the logic app hybrid workflow kind. */ - private WorkflowEnvelopeProperties properties; + private WorkflowKind kind; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -52,27 +52,7 @@ public final class WorkflowEnvelopeInner extends ProxyResource { /** * Creates an instance of WorkflowEnvelopeInner class. */ - public WorkflowEnvelopeInner() { - } - - /** - * Get the kind property: Gets the logic app hybrid workflow kind. - * - * @return the kind value. - */ - public WorkflowKind kind() { - return this.kind; - } - - /** - * Set the kind property: Gets the logic app hybrid workflow kind. - * - * @param kind the kind value to set. - * @return the WorkflowEnvelopeInner object itself. - */ - public WorkflowEnvelopeInner withKind(WorkflowKind kind) { - this.kind = kind; - return this; + private WorkflowEnvelopeInner() { } /** @@ -85,14 +65,12 @@ public WorkflowEnvelopeProperties properties() { } /** - * Set the properties property: Additional workflow properties. + * Get the kind property: Gets the logic app hybrid workflow kind. * - * @param properties the properties value to set. - * @return the WorkflowEnvelopeInner object itself. + * @return the kind value. */ - public WorkflowEnvelopeInner withProperties(WorkflowEnvelopeProperties properties) { - this.properties = properties; - return this; + public WorkflowKind kind() { + return this.kind; } /** @@ -134,25 +112,14 @@ 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.writeStringField("kind", this.kind == null ? null : this.kind.toString()); jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); return jsonWriter.writeEndObject(); } @@ -178,10 +145,10 @@ public static WorkflowEnvelopeInner fromJson(JsonReader jsonReader) throws IOExc deserializedWorkflowEnvelopeInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedWorkflowEnvelopeInner.type = reader.getString(); - } else if ("kind".equals(fieldName)) { - deserializedWorkflowEnvelopeInner.kind = WorkflowKind.fromString(reader.getString()); } else if ("properties".equals(fieldName)) { deserializedWorkflowEnvelopeInner.properties = WorkflowEnvelopeProperties.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedWorkflowEnvelopeInner.kind = WorkflowKind.fromString(reader.getString()); } else if ("systemData".equals(fieldName)) { deserializedWorkflowEnvelopeInner.systemData = SystemData.fromJson(reader); } else { 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 3bbd9fb5cca5..3c523c333b26 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -16,7 +16,7 @@ /** * Collection of all the workload Profile States for a Managed Environment.. */ -@Fluent +@Immutable public final class WorkloadProfileStatesInner extends ProxyResource { /* * Workload Profile resource specific properties. @@ -46,7 +46,7 @@ public final class WorkloadProfileStatesInner extends ProxyResource { /** * Creates an instance of WorkloadProfileStatesInner class. */ - public WorkloadProfileStatesInner() { + private WorkloadProfileStatesInner() { } /** @@ -58,17 +58,6 @@ public WorkloadProfileStatesProperties properties() { return this.properties; } - /** - * Set the properties property: Workload Profile resource specific properties. - * - * @param properties the properties value to set. - * @return the WorkloadProfileStatesInner object itself. - */ - public WorkloadProfileStatesInner withProperties(WorkloadProfileStatesProperties properties) { - this.properties = properties; - return this; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -108,17 +97,6 @@ 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} */ 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 cf8afa847d83..0548bba35fff 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 @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for ContainerAppsApiClient. - * Logic app is an extension resource on container app and the extension resource enables logic specific operations on - * the container app through the APIs listed. + * Package containing the inner data models for ContainerAppsApi. + * 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 bf20e497bc3e..01085f434b3a 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 @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for ContainerAppsApiClient. - * Logic app is an extension resource on container app and the extension resource enables logic specific operations on - * the container app through the APIs listed. + * Package containing the service clients for ContainerAppsApi. + * 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/AuthConfigImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AuthConfigImpl.java index dac6789aac8f..84f69db25504 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AuthConfigImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AuthConfigImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableEnvironmentModeImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableEnvironmentModeImpl.java new file mode 100644 index 000000000000..b96771cd0197 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableEnvironmentModeImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appcontainers.fluent.models.AvailableEnvironmentModeInner; +import com.azure.resourcemanager.appcontainers.models.AvailableEnvironmentMode; +import com.azure.resourcemanager.appcontainers.models.AvailableEnvironmentModeProperties; + +public final class AvailableEnvironmentModeImpl implements AvailableEnvironmentMode { + private AvailableEnvironmentModeInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + AvailableEnvironmentModeImpl(AvailableEnvironmentModeInner 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 location() { + return this.innerModel().location(); + } + + public AvailableEnvironmentModeProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AvailableEnvironmentModeInner 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/AvailableEnvironmentModesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableEnvironmentModesClientImpl.java new file mode 100644 index 000000000000..4ed3a7ea325f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableEnvironmentModesClientImpl.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.appcontainers.fluent.AvailableEnvironmentModesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.AvailableEnvironmentModeInner; +import com.azure.resourcemanager.appcontainers.implementation.models.AvailableEnvironmentModesCollection; +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 AvailableEnvironmentModesClient. + */ +public final class AvailableEnvironmentModesClientImpl implements AvailableEnvironmentModesClient { + /** + * The proxy service used to perform REST calls. + */ + private final AvailableEnvironmentModesService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of AvailableEnvironmentModesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvailableEnvironmentModesClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(AvailableEnvironmentModesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientAvailableEnvironmentModes to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ContainerAppsApiClientAvailableEnvironmentModes") + public interface AvailableEnvironmentModesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/locations/{location}/availableManagedEnvironmentsModes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/locations/{location}/availableManagedEnvironmentsModes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get available environment modes by location. + * + * Gets the environment modes available to a subscription in a location. + * + * @param location The name of the Azure region. + * @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 available environment modes by location. + * + * Gets the environment modes available to a subscription in a location along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, 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 available environment modes by location. + * + * Gets the environment modes available to a subscription in a location. + * + * @param location The name of the Azure region. + * @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 available environment modes by location. + * + * Gets the environment modes available to a subscription in a location as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get available environment modes by location. + * + * Gets the environment modes available to a subscription in a location. + * + * @param location The name of the Azure region. + * @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 available environment modes by location. + * + * Gets the environment modes available to a subscription in a location along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String location) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get available environment modes by location. + * + * Gets the environment modes available to a subscription in a location. + * + * @param location The name of the Azure region. + * @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 available environment modes by location. + * + * Gets the environment modes available to a subscription in a location along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String location, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get available environment modes by location. + * + * Gets the environment modes available to a subscription in a location. + * + * @param location The name of the Azure region. + * @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 available environment modes by location. + * + * Gets the environment modes available to a subscription in a location as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(() -> listSinglePage(location), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Get available environment modes by location. + * + * Gets the environment modes available to a subscription in a location. + * + * @param location The name of the Azure region. + * @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 available environment modes by location. + * + * Gets the environment modes available to a subscription in a location as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(() -> listSinglePage(location, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get available environment modes by location. + * + * 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 available environment modes by location. + * + * Gets the environment modes available to a subscription in a location along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 available environment modes by location. + * + * 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 available environment modes by location. + * + * Gets the environment modes available to a subscription in a location along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get available environment modes by location. + * + * 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 available environment modes by location. + * + * Gets the environment modes available to a subscription in a location along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/AvailableEnvironmentModesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableEnvironmentModesImpl.java new file mode 100644 index 000000000000..32f17be599ad --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableEnvironmentModesImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.AvailableEnvironmentModesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.AvailableEnvironmentModeInner; +import com.azure.resourcemanager.appcontainers.models.AvailableEnvironmentMode; +import com.azure.resourcemanager.appcontainers.models.AvailableEnvironmentModes; + +public final class AvailableEnvironmentModesImpl implements AvailableEnvironmentModes { + private static final ClientLogger LOGGER = new ClientLogger(AvailableEnvironmentModesImpl.class); + + private final AvailableEnvironmentModesClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public AvailableEnvironmentModesImpl(AvailableEnvironmentModesClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AvailableEnvironmentModeImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AvailableEnvironmentModeImpl(inner1, this.manager())); + } + + private AvailableEnvironmentModesClient 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/AvailableWorkloadProfileImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableWorkloadProfileImpl.java index a4636a09d35b..b617190485da 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableWorkloadProfileImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableWorkloadProfileImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableWorkloadProfilesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableWorkloadProfilesClientImpl.java index 5c06b26b389d..0650da26badd 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableWorkloadProfilesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableWorkloadProfilesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -25,10 +25,9 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.AvailableWorkloadProfilesClient; import com.azure.resourcemanager.appcontainers.fluent.models.AvailableWorkloadProfileInner; -import com.azure.resourcemanager.appcontainers.models.AvailableWorkloadProfilesCollection; +import com.azure.resourcemanager.appcontainers.implementation.models.AvailableWorkloadProfilesCollection; import reactor.core.publisher.Mono; /** @@ -60,31 +59,31 @@ public final class AvailableWorkloadProfilesClientImpl implements AvailableWorkl * The interface defining all the services for ContainerAppsApiClientAvailableWorkloadProfiles to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientAvailableWorkloadProfiles") public interface AvailableWorkloadProfilesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/locations/{location}/availableManagedEnvironmentsWorkloadProfileTypes") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/locations/{location}/availableManagedEnvironmentsWorkloadProfileTypes") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -92,7 +91,7 @@ Mono> getNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response getNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -101,30 +100,21 @@ Response getNextSync( * * Get all available workload profiles for a location. * - * @param location The name of Azure region. + * @param location The name of the Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available workload profiles for a location along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return available workload profiles by location. + * + * Get all available workload profiles for a location along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getSinglePageAsync(String location) { - 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 (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), location, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, 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())); @@ -135,11 +125,13 @@ private Mono> getSinglePageAsync(St * * Get all available workload profiles for a location. * - * @param location The name of Azure region. + * @param location The name of the Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available workload profiles for a location as paginated response with {@link PagedFlux}. + * @return available workload profiles by location. + * + * Get all available workload profiles for a location as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux getAsync(String location) { @@ -151,31 +143,19 @@ private PagedFlux getAsync(String location) { * * Get all available workload profiles for a location. * - * @param location The name of Azure region. + * @param location The name of the Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available workload profiles for a location along with {@link PagedResponse}. + * @return available workload profiles by location. + * + * Get all available workload profiles for a location along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse getSinglePage(String location) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.getSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), location, this.client.getApiVersion(), accept, Context.NONE); + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -185,32 +165,20 @@ private PagedResponse getSinglePage(String locati * * Get all available workload profiles for a location. * - * @param location The name of Azure region. + * @param location The name of the Azure region. * @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 all available workload profiles for a location along with {@link PagedResponse}. + * @return available workload profiles by location. + * + * Get all available workload profiles for a location along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse getSinglePage(String location, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.getSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), location, this.client.getApiVersion(), accept, context); + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -220,11 +188,13 @@ private PagedResponse getSinglePage(String locati * * Get all available workload profiles for a location. * - * @param location The name of Azure region. + * @param location The name of the Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available workload profiles for a location as paginated response with {@link PagedIterable}. + * @return available workload profiles by location. + * + * Get all available workload profiles for a location as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable get(String location) { @@ -236,12 +206,14 @@ public PagedIterable get(String location) { * * Get all available workload profiles for a location. * - * @param location The name of Azure region. + * @param location The name of the Azure region. * @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 all available workload profiles for a location as paginated response with {@link PagedIterable}. + * @return available workload profiles by location. + * + * Get all available workload profiles for a location as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable get(String location, Context context) { @@ -258,18 +230,13 @@ public PagedIterable get(String location, Context * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available workload profiles for a location along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return available workload profiles by location. + * + * Get all available workload profiles for a location along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getNextSinglePageAsync(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.getNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -286,19 +253,12 @@ private Mono> getNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available workload profiles for a location along with {@link PagedResponse}. + * @return available workload profiles by location. + * + * Get all available workload profiles for a location along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse getNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.getNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -316,25 +276,16 @@ private PagedResponse getNextSinglePage(String ne * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available workload profiles for a location along with {@link PagedResponse}. + * @return available workload profiles by location. + * + * Get all available workload profiles for a location along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse getNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.getNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(AvailableWorkloadProfilesClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableWorkloadProfilesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableWorkloadProfilesImpl.java index de9fd579bec6..442371b6666e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableWorkloadProfilesImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableWorkloadProfilesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BillingMeterCollectionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BillingMeterCollectionImpl.java index b87bf3c7ed11..67310cf21094 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BillingMeterCollectionImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BillingMeterCollectionImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BillingMetersClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BillingMetersClientImpl.java index da6d71ef3984..f369e99a7c1b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BillingMetersClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BillingMetersClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -20,7 +20,6 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.BillingMetersClient; import com.azure.resourcemanager.appcontainers.fluent.models.BillingMeterCollectionInner; import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; @@ -55,24 +54,24 @@ public final class BillingMetersClientImpl implements BillingMetersClient { * The interface defining all the services for ContainerAppsApiClientBillingMeters to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientBillingMeters") public interface BillingMetersService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/locations/{location}/billingMeters") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/locations/{location}/billingMeters") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); } /** @@ -80,29 +79,20 @@ Response getSync(@HostParam("$host") String endpoin * * Get all billingMeters for a location. * - * @param location The name of Azure region. + * @param location The name of the Azure region. * @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 all billingMeters for a location along with {@link Response} on successful completion of {@link Mono}. + * @return billing meters by location. + * + * Get all billingMeters for a location along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String location) { - 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 (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), location, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -111,11 +101,13 @@ private Mono> getWithResponseAsync(String * * Get all billingMeters for a location. * - * @param location The name of Azure region. + * @param location The name of the Azure region. * @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 all billingMeters for a location on successful completion of {@link Mono}. + * @return billing meters by location. + * + * Get all billingMeters for a location on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String location) { @@ -127,32 +119,20 @@ private Mono getAsync(String location) { * * Get all billingMeters for a location. * - * @param location The name of Azure region. + * @param location The name of the Azure region. * @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 all billingMeters for a location along with {@link Response}. + * @return billing meters by location. + * + * Get all billingMeters for a location along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String location, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), location, - this.client.getApiVersion(), accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + location, accept, context); } /** @@ -160,16 +140,16 @@ public Response getWithResponse(String location, Co * * Get all billingMeters for a location. * - * @param location The name of Azure region. + * @param location The name of the Azure region. * @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 all billingMeters for a location. + * @return billing meters by location. + * + * Get all billingMeters for a location. */ @ServiceMethod(returns = ReturnType.SINGLE) public BillingMeterCollectionInner get(String location) { return getWithResponse(location, Context.NONE).getValue(); } - - private static final ClientLogger LOGGER = new ClientLogger(BillingMetersClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BillingMetersImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BillingMetersImpl.java index 8b793dcb1ac0..7e0b2fe9118b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BillingMetersImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BillingMetersImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -28,12 +28,8 @@ public BillingMetersImpl(BillingMetersClient innerClient, public Response getWithResponse(String location, Context context) { Response inner = this.serviceClient().getWithResponse(location, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new BillingMeterCollectionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BillingMeterCollectionImpl(inner.getValue(), this.manager())); } public BillingMeterCollection get(String location) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificateImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificateImpl.java index bea380ab1c9a..5db215a3e775 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificateImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificateImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesClientImpl.java index c8103e14e8a1..df42b58f83d3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -26,14 +26,13 @@ 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.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.CertificatesClient; import com.azure.resourcemanager.appcontainers.fluent.models.CertificateInner; -import com.azure.resourcemanager.appcontainers.models.CertificateCollection; +import com.azure.resourcemanager.appcontainers.implementation.models.CertificateCollection; import com.azure.resourcemanager.appcontainers.models.CertificatePatch; -import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; import reactor.core.publisher.Mono; /** @@ -65,543 +64,378 @@ public final class CertificatesClientImpl implements CertificatesClient { * The interface defining all the services for ContainerAppsApiClientCertificates to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientCertificates") public interface CertificatesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, + @PathParam("environmentName") String environmentName, @PathParam("certificateName") String certificateName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, + @PathParam("environmentName") String environmentName, @PathParam("certificateName") String certificateName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("certificateName") String certificateName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, @BodyParam("application/json") CertificateInner certificateEnvelope, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("certificateName") String certificateName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, @BodyParam("application/json") CertificateInner certificateEnvelope, + Context context); - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}") + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("certificateName") String certificateName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CertificateInner certificateEnvelope, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CertificatePatch certificateEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}") + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("certificateName") String certificateName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CertificateInner certificateEnvelope, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CertificatePatch certificateEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}") @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("certificateName") String certificateName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}") @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response deleteSync(@HostParam("$host") String endpoint, + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("certificateName") String certificateName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @PathParam("certificateName") String certificateName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CertificatePatch certificateEnvelope, @HeaderParam("Accept") String accept, + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response updateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @PathParam("certificateName") String certificateName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CertificatePatch certificateEnvelope, @HeaderParam("Accept") String accept, + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Get the Certificates in a given managed environment. + * Get the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. + * @param certificateName Name of the Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 Certificates in a given managed environment along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the specified Certificate along with {@link Response} 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.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String environmentName, + String certificateName) { 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)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, certificateName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the Certificates in 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 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 Certificates in a given 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 Certificates in a given managed environment. + * Get the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. + * @param certificateName Name of the Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 Certificates in a given managed environment along with {@link PagedResponse}. + * @return the specified Certificate on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String environmentName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + private Mono getAsync(String resourceGroupName, String environmentName, String certificateName) { + return getWithResponseAsync(resourceGroupName, environmentName, certificateName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get the Certificates in a given managed environment. + * Get the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. + * @param certificateName Name of the Certificate. * @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 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 Certificates in a given managed environment along with {@link PagedResponse}. + * @return the specified Certificate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String environmentName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } + public Response getWithResponse(String resourceGroupName, String environmentName, + String certificateName, Context context) { final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, certificateName, accept, context); } /** - * Get the Certificates in 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 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 Certificates in a given managed environment as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String environmentName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, environmentName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Get the Certificates in a given managed environment. + * Get the specified Certificate. * * @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. + * @param certificateName Name of the Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 Certificates in a given managed environment as paginated response with {@link PagedIterable}. + * @return the specified Certificate. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String environmentName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, environmentName, context), - nextLink -> listNextSinglePage(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public CertificateInner get(String resourceGroupName, String environmentName, String certificateName) { + return getWithResponse(resourceGroupName, environmentName, certificateName, Context.NONE).getValue(); } /** - * Get the specified Certificate. + * Create or Update a Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Certificate to be created or updated. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 specified Certificate along with {@link Response} on successful completion of {@link Mono}. + * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String environmentName, - String certificateName) { - 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 (certificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String environmentName, String certificateName, CertificateInner certificateEnvelope) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, certificateName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, certificateName, accept, + certificateEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the specified Certificate. + * Create or Update a Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 specified Certificate on successful completion of {@link Mono}. + * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String environmentName, String certificateName) { - return getWithResponseAsync(resourceGroupName, environmentName, certificateName) + private Mono createOrUpdateAsync(String resourceGroupName, String environmentName, + String certificateName) { + final CertificateInner certificateEnvelope = null; + return createOrUpdateWithResponseAsync(resourceGroupName, environmentName, certificateName, certificateEnvelope) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get the specified Certificate. + * Create or Update a Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Certificate to be created or updated. * @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 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 specified Certificate along with {@link Response}. + * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String environmentName, - String certificateName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (certificateName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } + public Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, + String certificateName, CertificateInner certificateEnvelope, Context context) { final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, certificateName, this.client.getApiVersion(), accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, certificateName, accept, + certificateEnvelope, context); } /** - * Get the specified Certificate. + * Create or Update a Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 specified Certificate. + * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CertificateInner get(String resourceGroupName, String environmentName, String certificateName) { - return getWithResponse(resourceGroupName, environmentName, certificateName, Context.NONE).getValue(); + public CertificateInner createOrUpdate(String resourceGroupName, String environmentName, String certificateName) { + final CertificateInner certificateEnvelope = null; + return createOrUpdateWithResponse(resourceGroupName, environmentName, certificateName, certificateEnvelope, + Context.NONE).getValue(); } /** - * Create or Update a Certificate. + * Update properties of a certificate + * + * Patches a certificate. Currently only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. - * @param certificateEnvelope Certificate to be created or updated. + * @param certificateEnvelope Properties of a certificate that need to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String environmentName, String certificateName, CertificateInner certificateEnvelope) { - 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 (certificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } - if (certificateEnvelope != null) { - certificateEnvelope.validate(); - } + private Mono> updateWithResponseAsync(String resourceGroupName, String environmentName, + String certificateName, CertificatePatch certificateEnvelope) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, certificateName, this.client.getApiVersion(), certificateEnvelope, - accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, certificateName, contentType, + accept, certificateEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or Update a Certificate. + * Update properties of a certificate + * + * Patches a certificate. Currently only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Properties of a certificate that need to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String environmentName, - String certificateName) { - final CertificateInner certificateEnvelope = null; - return createOrUpdateWithResponseAsync(resourceGroupName, environmentName, certificateName, certificateEnvelope) + private Mono updateAsync(String resourceGroupName, String environmentName, String certificateName, + CertificatePatch certificateEnvelope) { + return updateWithResponseAsync(resourceGroupName, environmentName, certificateName, certificateEnvelope) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Create or Update a Certificate. + * Update properties of a certificate + * + * Patches a certificate. Currently only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. - * @param certificateEnvelope Certificate to be created or updated. + * @param certificateEnvelope Properties of a certificate that need to be updated. * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, - String certificateName, CertificateInner certificateEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (certificateName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } - if (certificateEnvelope != null) { - certificateEnvelope.validate(); - } + public Response updateWithResponse(String resourceGroupName, String environmentName, + String certificateName, CertificatePatch certificateEnvelope, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, certificateName, this.client.getApiVersion(), certificateEnvelope, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, certificateName, contentType, accept, + certificateEnvelope, context); } /** - * Create or Update a Certificate. + * Update properties of a certificate + * + * Patches a certificate. Currently only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Properties of a certificate that need to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CertificateInner createOrUpdate(String resourceGroupName, String environmentName, String certificateName) { - final CertificateInner certificateEnvelope = null; - return createOrUpdateWithResponse(resourceGroupName, environmentName, certificateName, certificateEnvelope, + public CertificateInner update(String resourceGroupName, String environmentName, String certificateName, + CertificatePatch certificateEnvelope) { + return updateWithResponse(resourceGroupName, environmentName, certificateName, certificateEnvelope, Context.NONE).getValue(); } @@ -612,37 +446,16 @@ public CertificateInner createOrUpdate(String resourceGroupName, String environm * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 certificateName) { - 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 (certificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateName 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, certificateName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, certificateName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -653,7 +466,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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. */ @@ -671,38 +484,15 @@ private Mono deleteAsync(String resourceGroupName, String environmentName, * @param certificateName Name of the Certificate. * @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 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String environmentName, String certificateName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (certificateName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, certificateName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, certificateName, context); } /** @@ -712,7 +502,7 @@ public Response deleteWithResponse(String resourceGroupName, String enviro * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @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) @@ -721,150 +511,115 @@ public void delete(String resourceGroupName, String environmentName, String cert } /** - * Update properties of a certificate - * - * Patches a certificate. Currently only patching of tags is supported. + * Get the Certificates in 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 certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with - * {@link Response} on successful completion of {@link Mono}. + * @return the Certificates in a given managed environment along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String environmentName, - String certificateName, CertificatePatch certificateEnvelope) { - 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 (certificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } - if (certificateEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateEnvelope is required and cannot be null.")); - } else { - certificateEnvelope.validate(); - } + private Mono> listSinglePageAsync(String resourceGroupName, + String environmentName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, certificateName, this.client.getApiVersion(), certificateEnvelope, - accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, 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())); } /** - * Update properties of a certificate + * Get the Certificates in a given managed environment. * - * Patches a certificate. Currently only patching of tags is supported. + * @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 Certificates in a given 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 Certificates in 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 certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment on successful - * completion of {@link Mono}. + * @return the Certificates in a given managed environment along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String environmentName, String certificateName, - CertificatePatch certificateEnvelope) { - return updateWithResponseAsync(resourceGroupName, environmentName, certificateName, certificateEnvelope) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String resourceGroupName, String environmentName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Update properties of a certificate - * - * Patches a certificate. Currently only patching of tags is supported. + * Get the Certificates in 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 certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need to be updated. * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with - * {@link Response}. + * @return the Certificates in a given managed environment along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String environmentName, - String certificateName, CertificatePatch certificateEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (certificateName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } - if (certificateEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter certificateEnvelope is required and cannot be null.")); - } else { - certificateEnvelope.validate(); - } + private PagedResponse listSinglePage(String resourceGroupName, String environmentName, + Context context) { final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, certificateName, this.client.getApiVersion(), certificateEnvelope, accept, context); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Update properties of a certificate + * Get the Certificates in a given managed environment. * - * Patches a certificate. Currently only patching of tags is supported. + * @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 Certificates in a given managed environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, environmentName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Get the Certificates in 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 certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need to be updated. + * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment. + * @return the Certificates in a given managed environment as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CertificateInner update(String resourceGroupName, String environmentName, String certificateName, - CertificatePatch certificateEnvelope) { - return updateWithResponse(resourceGroupName, environmentName, certificateName, certificateEnvelope, - Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, environmentName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -874,20 +629,13 @@ public CertificateInner update(String resourceGroupName, String environmentName, * * @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 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 Certificates in a given managed environment 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(), @@ -902,21 +650,12 @@ private Mono> listNextSinglePageAsync(String nex * * @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 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 Certificates in a given managed environment along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -932,27 +671,16 @@ private PagedResponse listNextSinglePage(String nextLink) { * @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 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 Certificates in a given managed environment along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(CertificatesClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesImpl.java index 8d014c732e36..35c0d659bdef 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -28,26 +28,12 @@ public CertificatesImpl(CertificatesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String environmentName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, environmentName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CertificateImpl(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 CertificateImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String environmentName, String certificateName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, environmentName, certificateName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CertificateImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CertificateImpl(inner.getValue(), this.manager())); } public Certificate get(String resourceGroupName, String environmentName, String certificateName) { @@ -64,12 +50,8 @@ public Response createOrUpdateWithResponse(String resourceGroupName Response inner = this.serviceClient() .createOrUpdateWithResponse(resourceGroupName, environmentName, certificateName, certificateEnvelope, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CertificateImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CertificateImpl(inner.getValue(), this.manager())); } public Certificate createOrUpdate(String resourceGroupName, String environmentName, String certificateName) { @@ -82,25 +64,12 @@ public Certificate createOrUpdate(String resourceGroupName, String environmentNa } } - public Response deleteWithResponse(String resourceGroupName, String environmentName, String certificateName, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, environmentName, certificateName, context); - } - - public void delete(String resourceGroupName, String environmentName, String certificateName) { - this.serviceClient().delete(resourceGroupName, environmentName, certificateName); - } - public Response updateWithResponse(String resourceGroupName, String environmentName, String certificateName, CertificatePatch certificateEnvelope, Context context) { Response inner = this.serviceClient() .updateWithResponse(resourceGroupName, environmentName, certificateName, certificateEnvelope, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CertificateImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CertificateImpl(inner.getValue(), this.manager())); } public Certificate update(String resourceGroupName, String environmentName, String certificateName, @@ -114,6 +83,25 @@ public Certificate update(String resourceGroupName, String environmentName, Stri } } + public Response deleteWithResponse(String resourceGroupName, String environmentName, String certificateName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, environmentName, certificateName, context); + } + + public void delete(String resourceGroupName, String environmentName, String certificateName) { + this.serviceClient().delete(resourceGroupName, environmentName, certificateName); + } + + public PagedIterable list(String resourceGroupName, String environmentName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, environmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CertificateImpl(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 CertificateImpl(inner1, this.manager())); + } + private CertificatesClient serviceClient() { return this.innerClient; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CheckMigrationEligibilityResponseImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CheckMigrationEligibilityResponseImpl.java new file mode 100644 index 000000000000..1952e5a83cbb --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CheckMigrationEligibilityResponseImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.resourcemanager.appcontainers.fluent.models.CheckMigrationEligibilityResponseInner; +import com.azure.resourcemanager.appcontainers.models.CheckMigrationEligibilityResponse; +import com.azure.resourcemanager.appcontainers.models.MigrationEligibilityFailureReason; +import java.util.Collections; +import java.util.List; + +public final class CheckMigrationEligibilityResponseImpl implements CheckMigrationEligibilityResponse { + private CheckMigrationEligibilityResponseInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + CheckMigrationEligibilityResponseImpl(CheckMigrationEligibilityResponseInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public boolean isEligible() { + return this.innerModel().isEligible(); + } + + public String environmentName() { + return this.innerModel().environmentName(); + } + + public String currentMode() { + return this.innerModel().currentMode(); + } + + public String targetMode() { + return this.innerModel().targetMode(); + } + + public List failureReasons() { + List inner = this.innerModel().failureReasons(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CheckMigrationEligibilityResponseInner 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/CheckNameAvailabilityResponseImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CheckNameAvailabilityResponseImpl.java index fcc2727cde3d..1fa8ad5e246e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CheckNameAvailabilityResponseImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CheckNameAvailabilityResponseImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentImpl.java index 360ce8afee09..5e10ced7a58c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentStorageImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentStorageImpl.java index 4c60f0891fc0..7d94698661d1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentStorageImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentStorageImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentStoragesCollectionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentStoragesCollectionImpl.java index c5aaf65dce2f..92a34b3e906f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentStoragesCollectionImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentStoragesCollectionImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesClientImpl.java index fd6a126b0c1b..1d4516a4a520 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -31,12 +31,11 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.appcontainers.fluent.ConnectedEnvironmentsCertificatesClient; import com.azure.resourcemanager.appcontainers.fluent.models.CertificateInner; -import com.azure.resourcemanager.appcontainers.models.CertificateCollection; +import com.azure.resourcemanager.appcontainers.implementation.models.CertificateCollection; import com.azure.resourcemanager.appcontainers.models.CertificatePatch; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -71,303 +70,128 @@ public final class ConnectedEnvironmentsCertificatesClientImpl implements Connec * The interface defining all the services for ContainerAppsApiClientConnectedEnvironmentsCertificates to be used by * the proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientConnectedEnvironmentsCertificates") public interface ConnectedEnvironmentsCertificatesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("certificateName") String certificateName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("certificateName") String certificateName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") - @ExpectedResponses({ 200 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("certificateName") String certificateName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("certificateName") String certificateName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CertificateInner certificateEnvelope, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") - @ExpectedResponses({ 200 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("certificateName") String certificateName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("certificateName") String certificateName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CertificateInner certificateEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") - @ExpectedResponses({ 200, 201 }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("certificateName") String certificateName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CertificateInner certificateEnvelope, @HeaderParam("Accept") String accept, + @PathParam("certificateName") String certificateName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CertificatePatch certificateEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") - @ExpectedResponses({ 200, 201 }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("certificateName") String certificateName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CertificateInner certificateEnvelope, @HeaderParam("Accept") String accept, + @PathParam("certificateName") String certificateName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CertificatePatch certificateEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("certificateName") String certificateName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("certificateName") String certificateName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("certificateName") String certificateName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("certificateName") String certificateName, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") - @ExpectedResponses({ 200, 202 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("certificateName") String certificateName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CertificatePatch certificateEnvelope, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") - @ExpectedResponses({ 200, 202 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("certificateName") String certificateName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CertificatePatch certificateEnvelope, @HeaderParam("Accept") String accept, - Context context); + @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); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get the Certificates in a given connected environment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Connected 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 Certificates in a given connected environment along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String connectedEnvironmentName) { - 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 (connectedEnvironmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, connectedEnvironmentName, 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 Certificates in a given connected environment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Connected 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 Certificates in a given connected environment as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String connectedEnvironmentName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, connectedEnvironmentName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get the Certificates in a given connected environment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Connected 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 Certificates in a given connected environment along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String connectedEnvironmentName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, this.client.getApiVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the Certificates in a given connected environment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Connected 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 Certificates in a given connected environment along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String connectedEnvironmentName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, this.client.getApiVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the Certificates in a given connected environment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Connected 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 Certificates in a given connected environment as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String connectedEnvironmentName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, connectedEnvironmentName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Get the Certificates in a given connected environment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Connected 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 Certificates in a given connected environment as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String connectedEnvironmentName, - Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, connectedEnvironmentName, context), - nextLink -> listNextSinglePage(nextLink, context)); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -384,31 +208,11 @@ public PagedIterable list(String resourceGroupName, String con @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String connectedEnvironmentName, String certificateName) { - 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 (connectedEnvironmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (certificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, certificateName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, certificateName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -445,32 +249,9 @@ private Mono getAsync(String resourceGroupName, String connect @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String connectedEnvironmentName, String certificateName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (certificateName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, certificateName, this.client.getApiVersion(), accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, connectedEnvironmentName, certificateName, accept, context); } /** @@ -505,34 +286,11 @@ public CertificateInner get(String resourceGroupName, String connectedEnvironmen @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String connectedEnvironmentName, String certificateName, CertificateInner certificateEnvelope) { - 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 (connectedEnvironmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (certificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } - if (certificateEnvelope != null) { - certificateEnvelope.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, connectedEnvironmentName, certificateName, this.client.getApiVersion(), - certificateEnvelope, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, certificateName, accept, + certificateEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -552,36 +310,10 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String connectedEnvironmentName, String certificateName, CertificateInner certificateEnvelope) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (certificateName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } - if (certificateEnvelope != null) { - certificateEnvelope.validate(); - } final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, certificateName, this.client.getApiVersion(), certificateEnvelope, accept, - Context.NONE); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, certificateName, accept, + certificateEnvelope, Context.NONE); } /** @@ -601,36 +333,10 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String connectedEnvironmentName, String certificateName, CertificateInner certificateEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (certificateName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } - if (certificateEnvelope != null) { - certificateEnvelope.validate(); - } final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, certificateName, this.client.getApiVersion(), certificateEnvelope, accept, - context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, certificateName, accept, + certificateEnvelope, context); } /** @@ -826,537 +532,500 @@ public CertificateInner createOrUpdate(String resourceGroupName, String connecte } /** - * Deletes the specified Certificate. + * Update properties of a certificate + * + * Patches a certificate. Currently only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Properties of a certificate that need 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 Response} on successful completion of {@link Mono}. + * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, - String connectedEnvironmentName, String certificateName) { - 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 (connectedEnvironmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (certificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } + private Mono>> updateWithResponseAsync(String resourceGroupName, + String connectedEnvironmentName, String certificateName, CertificatePatch certificateEnvelope) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, certificateName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, certificateName, + contentType, accept, certificateEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes the specified Certificate. + * Update properties of a certificate + * + * Patches a certificate. Currently only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Properties of a certificate that need 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 response body along with {@link Response}. + * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String connectedEnvironmentName, - String certificateName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (certificateName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } + private Response updateWithResponse(String resourceGroupName, String connectedEnvironmentName, + String certificateName, CertificatePatch certificateEnvelope) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, certificateName, this.client.getApiVersion(), accept, Context.NONE); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, certificateName, contentType, + accept, certificateEnvelope, Context.NONE); } /** - * Deletes the specified Certificate. + * Update properties of a certificate + * + * Patches a certificate. Currently only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Properties of a certificate that need 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 response body along with {@link Response}. + * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String connectedEnvironmentName, - String certificateName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (certificateName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } + private Response updateWithResponse(String resourceGroupName, String connectedEnvironmentName, + String certificateName, CertificatePatch certificateEnvelope, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, certificateName, this.client.getApiVersion(), accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, certificateName, contentType, + accept, certificateEnvelope, context); } /** - * Deletes the specified Certificate. + * Update properties of a certificate + * + * Patches a certificate. Currently only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Properties of a certificate that need 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 long-running operation. + * @return the {@link PollerFlux} for polling of certificate used for Custom Domain bindings of Container Apps in a + * Managed Environment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, - String connectedEnvironmentName, String certificateName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, connectedEnvironmentName, certificateName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + private PollerFlux, CertificateInner> beginUpdateAsync(String resourceGroupName, + String connectedEnvironmentName, String certificateName, CertificatePatch certificateEnvelope) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, connectedEnvironmentName, + certificateName, certificateEnvelope); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CertificateInner.class, CertificateInner.class, this.client.getContext()); } /** - * Deletes the specified Certificate. + * Update properties of a certificate + * + * Patches a certificate. Currently only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Properties of a certificate that need 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 long-running operation. + * @return the {@link SyncPoller} for polling of certificate used for Custom Domain bindings of Container Apps in a + * Managed Environment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String connectedEnvironmentName, - String certificateName) { + public SyncPoller, CertificateInner> beginUpdate(String resourceGroupName, + String connectedEnvironmentName, String certificateName, CertificatePatch certificateEnvelope) { Response response - = deleteWithResponse(resourceGroupName, connectedEnvironmentName, certificateName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + = updateWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, certificateEnvelope); + return this.client.getLroResult(response, CertificateInner.class, + CertificateInner.class, Context.NONE); } /** - * Deletes the specified Certificate. + * Update properties of a certificate + * + * Patches a certificate. Currently only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Properties of a certificate that need 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 long-running operation. + * @return the {@link SyncPoller} for polling of certificate used for Custom Domain bindings of Container Apps in a + * Managed Environment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String connectedEnvironmentName, - String certificateName, Context context) { - Response response - = deleteWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); + public SyncPoller, CertificateInner> beginUpdate(String resourceGroupName, + String connectedEnvironmentName, String certificateName, CertificatePatch certificateEnvelope, + Context context) { + Response response = updateWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, + certificateEnvelope, context); + return this.client.getLroResult(response, CertificateInner.class, + CertificateInner.class, context); } /** - * Deletes the specified Certificate. + * Update properties of a certificate + * + * Patches a certificate. Currently only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Properties of a certificate that need 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 A {@link Mono} that completes when a successful response is received. + * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String connectedEnvironmentName, String certificateName) { - return beginDeleteAsync(resourceGroupName, connectedEnvironmentName, certificateName).last() + private Mono updateAsync(String resourceGroupName, String connectedEnvironmentName, + String certificateName, CertificatePatch certificateEnvelope) { + return beginUpdateAsync(resourceGroupName, connectedEnvironmentName, certificateName, certificateEnvelope) + .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes the specified Certificate. + * Update properties of a certificate + * + * Patches a certificate. Currently only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Properties of a certificate that need 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 certificate used for Custom Domain bindings of Container Apps in a Managed Environment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String connectedEnvironmentName, String certificateName) { - beginDelete(resourceGroupName, connectedEnvironmentName, certificateName).getFinalResult(); + public CertificateInner update(String resourceGroupName, String connectedEnvironmentName, String certificateName, + CertificatePatch certificateEnvelope) { + return beginUpdate(resourceGroupName, connectedEnvironmentName, certificateName, certificateEnvelope) + .getFinalResult(); } /** - * Deletes the specified Certificate. + * Update properties of a certificate + * + * Patches a certificate. Currently only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Properties of a certificate that need 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 certificate used for Custom Domain bindings of Container Apps in a Managed Environment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String connectedEnvironmentName, String certificateName, - Context context) { - beginDelete(resourceGroupName, connectedEnvironmentName, certificateName, context).getFinalResult(); + public CertificateInner update(String resourceGroupName, String connectedEnvironmentName, String certificateName, + CertificatePatch certificateEnvelope, Context context) { + return beginUpdate(resourceGroupName, connectedEnvironmentName, certificateName, certificateEnvelope, context) + .getFinalResult(); } /** - * Update properties of a certificate - * - * Patches a certificate. Currently only patching of tags is supported. + * Deletes the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need 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 certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with - * {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String connectedEnvironmentName, String certificateName, CertificatePatch certificateEnvelope) { - 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 (connectedEnvironmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (certificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } - if (certificateEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateEnvelope is required and cannot be null.")); - } else { - certificateEnvelope.validate(); - } - final String accept = "application/json"; + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String connectedEnvironmentName, String certificateName) { return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, connectedEnvironmentName, certificateName, this.client.getApiVersion(), - certificateEnvelope, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, certificateName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update properties of a certificate - * - * Patches a certificate. Currently only patching of tags is supported. + * Deletes the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need 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 certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with - * {@link Response}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String connectedEnvironmentName, - String certificateName, CertificatePatch certificateEnvelope) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (certificateName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } - if (certificateEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter certificateEnvelope is required and cannot be null.")); - } else { - certificateEnvelope.validate(); - } - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, certificateName, this.client.getApiVersion(), certificateEnvelope, accept, + private Response deleteWithResponse(String resourceGroupName, String connectedEnvironmentName, + String certificateName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, certificateName, Context.NONE); } /** - * Update properties of a certificate - * - * Patches a certificate. Currently only patching of tags is supported. + * Deletes the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need 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 certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with - * {@link Response}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String connectedEnvironmentName, - String certificateName, CertificatePatch certificateEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (certificateName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } - if (certificateEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter certificateEnvelope is required and cannot be null.")); - } else { - certificateEnvelope.validate(); - } - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, certificateName, this.client.getApiVersion(), certificateEnvelope, accept, - context); + private Response deleteWithResponse(String resourceGroupName, String connectedEnvironmentName, + String certificateName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, certificateName, context); } /** - * Update properties of a certificate - * - * Patches a certificate. Currently only patching of tags is supported. + * Deletes the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need 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 certificate used for Custom Domain bindings of Container Apps in a - * Managed Environment. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CertificateInner> beginUpdateAsync(String resourceGroupName, - String connectedEnvironmentName, String certificateName, CertificatePatch certificateEnvelope) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, connectedEnvironmentName, - certificateName, certificateEnvelope); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - CertificateInner.class, CertificateInner.class, this.client.getContext()); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, + String connectedEnvironmentName, String certificateName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, connectedEnvironmentName, certificateName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Update properties of a certificate - * - * Patches a certificate. Currently only patching of tags is supported. + * Deletes the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need 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 certificate used for Custom Domain bindings of Container Apps in a - * Managed Environment. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CertificateInner> beginUpdate(String resourceGroupName, - String connectedEnvironmentName, String certificateName, CertificatePatch certificateEnvelope) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String connectedEnvironmentName, + String certificateName) { Response response - = updateWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, certificateEnvelope); - return this.client.getLroResult(response, CertificateInner.class, - CertificateInner.class, Context.NONE); + = deleteWithResponse(resourceGroupName, connectedEnvironmentName, certificateName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** - * Update properties of a certificate - * - * Patches a certificate. Currently only patching of tags is supported. + * Deletes the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need 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 certificate used for Custom Domain bindings of Container Apps in a - * Managed Environment. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CertificateInner> beginUpdate(String resourceGroupName, - String connectedEnvironmentName, String certificateName, CertificatePatch certificateEnvelope, - Context context) { - Response response = updateWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, - certificateEnvelope, context); - return this.client.getLroResult(response, CertificateInner.class, - CertificateInner.class, context); + public SyncPoller, Void> beginDelete(String resourceGroupName, String connectedEnvironmentName, + String certificateName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** - * Update properties of a certificate - * - * Patches a certificate. Currently only patching of tags is supported. + * Deletes the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need 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 certificate used for Custom Domain bindings of Container Apps in a Managed Environment on successful - * completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String connectedEnvironmentName, - String certificateName, CertificatePatch certificateEnvelope) { - return beginUpdateAsync(resourceGroupName, connectedEnvironmentName, certificateName, certificateEnvelope) - .last() + private Mono deleteAsync(String resourceGroupName, String connectedEnvironmentName, String certificateName) { + return beginDeleteAsync(resourceGroupName, connectedEnvironmentName, certificateName).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Update properties of a certificate + * Deletes the specified Certificate. * - * Patches a certificate. Currently only patching of tags is supported. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the Connected Environment. + * @param certificateName Name of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 connectedEnvironmentName, String certificateName) { + beginDelete(resourceGroupName, connectedEnvironmentName, certificateName).getFinalResult(); + } + + /** + * Deletes the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need 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 certificate used for Custom Domain bindings of Container Apps in a Managed Environment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CertificateInner update(String resourceGroupName, String connectedEnvironmentName, String certificateName, - CertificatePatch certificateEnvelope) { - return beginUpdate(resourceGroupName, connectedEnvironmentName, certificateName, certificateEnvelope) - .getFinalResult(); + public void delete(String resourceGroupName, String connectedEnvironmentName, String certificateName, + Context context) { + beginDelete(resourceGroupName, connectedEnvironmentName, certificateName, context).getFinalResult(); } /** - * Update properties of a certificate + * Get the Certificates in a given connected environment. * - * Patches a certificate. Currently only patching of tags is supported. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the Connected 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 Certificates in a given connected environment along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String connectedEnvironmentName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, 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 Certificates in a given connected environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the Connected 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 Certificates in a given connected environment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String connectedEnvironmentName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, connectedEnvironmentName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get the Certificates in a given connected environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the Connected 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 Certificates in a given connected environment along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String connectedEnvironmentName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the Certificates in a given connected environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. - * @param certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need 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 certificate used for Custom Domain bindings of Container Apps in a Managed Environment. + * @return the Certificates in a given connected environment along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CertificateInner update(String resourceGroupName, String connectedEnvironmentName, String certificateName, - CertificatePatch certificateEnvelope, Context context) { - return beginUpdate(resourceGroupName, connectedEnvironmentName, certificateName, certificateEnvelope, context) - .getFinalResult(); + private PagedResponse listSinglePage(String resourceGroupName, String connectedEnvironmentName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the Certificates in a given connected environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the Connected 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 Certificates in a given connected environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String connectedEnvironmentName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, connectedEnvironmentName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Get the Certificates in a given connected environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the Connected 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 Certificates in a given connected environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String connectedEnvironmentName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, connectedEnvironmentName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -1373,13 +1042,6 @@ public CertificateInner update(String resourceGroupName, String connectedEnviron */ @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(), @@ -1400,15 +1062,6 @@ private Mono> listNextSinglePageAsync(String nex */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -1430,21 +1083,10 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(ConnectedEnvironmentsCertificatesClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesImpl.java index cb5215fbc180..352c34866b12 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -27,27 +27,12 @@ public ConnectedEnvironmentsCertificatesImpl(ConnectedEnvironmentsCertificatesCl this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String connectedEnvironmentName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, connectedEnvironmentName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CertificateImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String connectedEnvironmentName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, connectedEnvironmentName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CertificateImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String connectedEnvironmentName, String certificateName, Context context) { Response inner = this.serviceClient() .getWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CertificateImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CertificateImpl(inner.getValue(), this.manager())); } public Certificate get(String resourceGroupName, String connectedEnvironmentName, String certificateName) { @@ -68,6 +53,17 @@ public void delete(String resourceGroupName, String connectedEnvironmentName, St this.serviceClient().delete(resourceGroupName, connectedEnvironmentName, certificateName, context); } + public PagedIterable list(String resourceGroupName, String connectedEnvironmentName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, connectedEnvironmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CertificateImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String connectedEnvironmentName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, connectedEnvironmentName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CertificateImpl(inner1, this.manager())); + } + public Certificate 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/ConnectedEnvironmentsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsClientImpl.java index c3dea5482cc2..988f79275d96 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -31,14 +31,13 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.appcontainers.fluent.ConnectedEnvironmentsClient; import com.azure.resourcemanager.appcontainers.fluent.models.CheckNameAvailabilityResponseInner; import com.azure.resourcemanager.appcontainers.fluent.models.ConnectedEnvironmentInner; +import com.azure.resourcemanager.appcontainers.implementation.models.ConnectedEnvironmentCollection; import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityRequest; -import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentCollection; import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentPatchResource; import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; import java.nio.ByteBuffer; @@ -74,455 +73,174 @@ public final class ConnectedEnvironmentsClientImpl implements ConnectedEnvironme * The interface defining all the services for ContainerAppsApiClientConnectedEnvironments to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientConnectedEnvironments") public interface ConnectedEnvironmentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/connectedEnvironments") - @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}/providers/Microsoft.App/connectedEnvironments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listSync(@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/connectedEnvironments") - @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/connectedEnvironments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listByResourceGroupSync(@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/connectedEnvironments/{connectedEnvironmentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getByResourceGroupSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConnectedEnvironmentInner environmentEnvelope, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConnectedEnvironmentInner environmentEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConnectedEnvironmentInner environmentEnvelope, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConnectedEnvironmentInner environmentEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectedEnvironmentName") String connectedEnvironmentName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConnectedEnvironmentPatchResource environmentEnvelope, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectedEnvironmentName") String connectedEnvironmentName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConnectedEnvironmentPatchResource environmentEnvelope, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("connectedEnvironmentName") String connectedEnvironmentName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("connectedEnvironmentName") String connectedEnvironmentName, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConnectedEnvironmentPatchResource environmentEnvelope, - @HeaderParam("Accept") String accept, Context context); + Mono> listByResourceGroup(@HostParam("endpoint") 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" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response updateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConnectedEnvironmentPatchResource environmentEnvelope, + Response listByResourceGroupSync(@HostParam("endpoint") 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}/providers/Microsoft.App/connectedEnvironments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list(@HostParam("endpoint") 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}/providers/Microsoft.App/connectedEnvironments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/checkNameAvailability") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> checkNameAvailability(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> checkNameAvailability(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CheckNameAvailabilityRequest checkNameAvailabilityRequest, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckNameAvailabilityRequest checkNameAvailabilityRequest, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/checkNameAvailability") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response checkNameAvailabilitySync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response checkNameAvailabilitySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CheckNameAvailabilityRequest checkNameAvailabilityRequest, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckNameAvailabilityRequest checkNameAvailabilityRequest, 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, + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listBySubscriptionNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") 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, + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listByResourceGroupNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } - /** - * Get all connectedEnvironments for a 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 all connectedEnvironments for a 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 all connectedEnvironments for a 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 all connectedEnvironments for a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Get all connectedEnvironments for a 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 all connectedEnvironments for a subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage() { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get all connectedEnvironments for a 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 all connectedEnvironments for a subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get all connectedEnvironments for a 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 all connectedEnvironments for a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); - } - - /** - * Get all connectedEnvironments for a 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 all connectedEnvironments for a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(() -> listSinglePage(context), - nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); - } - - /** - * Get all connectedEnvironments in a resource group. - * - * @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 all connectedEnvironments in a resource group 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 all connectedEnvironments in a resource group. - * - * @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 all connectedEnvironments in a resource group as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Get all connectedEnvironments in a resource group. - * - * @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 all connectedEnvironments in a resource group along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listByResourceGroupSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get all connectedEnvironments in a 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 DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all connectedEnvironments in a resource group along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listByResourceGroupSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get all connectedEnvironments in a resource group. - * - * @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 all connectedEnvironments in a resource group as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePage(nextLink)); - } - - /** - * Get all connectedEnvironments in a 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 DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all connectedEnvironments in a resource group as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); - } - /** * Get the properties of an connectedEnvironment. * @@ -537,27 +255,10 @@ public PagedIterable listByResourceGroup(String resou @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String connectedEnvironmentName) { - 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 (connectedEnvironmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, connectedEnvironmentName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -592,28 +293,9 @@ private Mono getByResourceGroupAsync(String resourceG @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String connectedEnvironmentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, connectedEnvironmentName, this.client.getApiVersion(), accept, context); + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, accept, context); } /** @@ -646,33 +328,12 @@ public ConnectedEnvironmentInner getByResourceGroup(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String connectedEnvironmentName, ConnectedEnvironmentInner environmentEnvelope) { - 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 (connectedEnvironmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (environmentEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentEnvelope is required and cannot be null.")); - } else { - environmentEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, connectedEnvironmentName, this.client.getApiVersion(), environmentEnvelope, accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, contentType, accept, + environmentEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -691,34 +352,11 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String connectedEnvironmentName, ConnectedEnvironmentInner environmentEnvelope) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (environmentEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentEnvelope is required and cannot be null.")); - } else { - environmentEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, this.client.getApiVersion(), environmentEnvelope, accept, Context.NONE); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, contentType, accept, + environmentEnvelope, Context.NONE); } /** @@ -737,34 +375,11 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String connectedEnvironmentName, ConnectedEnvironmentInner environmentEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (environmentEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentEnvelope is required and cannot be null.")); - } else { - environmentEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, this.client.getApiVersion(), environmentEnvelope, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, contentType, accept, + environmentEnvelope, context); } /** @@ -870,22 +485,114 @@ public ConnectedEnvironmentInner createOrUpdate(String resourceGroupName, String } /** - * Creates or updates an connectedEnvironment. + * Creates or updates an connectedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connectedEnvironment. + * @param environmentEnvelope Configuration details of the connectedEnvironment. + * @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 an environment for Kubernetes cluster specialized for web workloads by Azure App Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectedEnvironmentInner createOrUpdate(String resourceGroupName, String connectedEnvironmentName, + ConnectedEnvironmentInner environmentEnvelope, Context context) { + return beginCreateOrUpdate(resourceGroupName, connectedEnvironmentName, environmentEnvelope, context) + .getFinalResult(); + } + + /** + * Update connected Environment's properties. + * + * Patches a Managed Environment. Only patching of tags is supported currently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connectedEnvironment. + * @param environmentEnvelope Configuration details of the connectedEnvironment. + * @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 an environment for Kubernetes cluster specialized for web workloads by Azure App Service along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, + String connectedEnvironmentName, ConnectedEnvironmentPatchResource environmentEnvelope) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, contentType, accept, + environmentEnvelope, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update connected Environment's properties. + * + * Patches a Managed Environment. Only patching of tags is supported currently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connectedEnvironment. + * @param environmentEnvelope Configuration details of the connectedEnvironment. + * @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 an environment for Kubernetes cluster specialized for web workloads by Azure App Service on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String connectedEnvironmentName, + ConnectedEnvironmentPatchResource environmentEnvelope) { + return updateWithResponseAsync(resourceGroupName, connectedEnvironmentName, environmentEnvelope) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update connected Environment's properties. + * + * Patches a Managed Environment. Only patching of tags is supported currently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connectedEnvironment. + * @param environmentEnvelope Configuration details of the connectedEnvironment. + * @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 an environment for Kubernetes cluster specialized for web workloads by Azure App Service along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, + String connectedEnvironmentName, ConnectedEnvironmentPatchResource environmentEnvelope, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, contentType, accept, + environmentEnvelope, context); + } + + /** + * Update connected Environment's properties. + * + * Patches a Managed Environment. Only patching of tags is supported currently. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the connectedEnvironment. * @param environmentEnvelope Configuration details of the connectedEnvironment. - * @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 an environment for Kubernetes cluster specialized for web workloads by Azure App Service. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectedEnvironmentInner createOrUpdate(String resourceGroupName, String connectedEnvironmentName, - ConnectedEnvironmentInner environmentEnvelope, Context context) { - return beginCreateOrUpdate(resourceGroupName, connectedEnvironmentName, environmentEnvelope, context) - .getFinalResult(); + public ConnectedEnvironmentInner update(String resourceGroupName, String connectedEnvironmentName, + ConnectedEnvironmentPatchResource environmentEnvelope) { + return updateWithResponse(resourceGroupName, connectedEnvironmentName, environmentEnvelope, Context.NONE) + .getValue(); } /** @@ -901,26 +608,9 @@ public ConnectedEnvironmentInner createOrUpdate(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String connectedEnvironmentName) { - 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 (connectedEnvironmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, connectedEnvironmentName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -936,28 +626,8 @@ private Mono>> deleteWithResponseAsync(String resource */ @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String connectedEnvironmentName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, this.client.getApiVersion(), accept, Context.NONE); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, Context.NONE); } /** @@ -974,28 +644,8 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String connectedEnvironmentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, context); } /** @@ -1096,139 +746,202 @@ public void delete(String resourceGroupName, String connectedEnvironmentName, Co } /** - * Update connected Environment's properties. - * - * Patches a Managed Environment. Only patching of tags is supported currently. + * Get all connectedEnvironments in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connectedEnvironment. - * @param environmentEnvelope Configuration details of the connectedEnvironment. * @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 an environment for Kubernetes cluster specialized for web workloads by Azure App Service along with - * {@link Response} on successful completion of {@link Mono}. + * @return all connectedEnvironments in a resource group along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String connectedEnvironmentName, ConnectedEnvironmentPatchResource environmentEnvelope) { - 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 (connectedEnvironmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (environmentEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentEnvelope is required and cannot be null.")); - } else { - environmentEnvelope.validate(); - } + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, this.client.getApiVersion(), environmentEnvelope, accept, context)) + .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())); } /** - * Update connected Environment's properties. + * Get all connectedEnvironments in a resource group. * - * Patches a Managed Environment. Only patching of tags is supported currently. + * @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 all connectedEnvironments in a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Get all connectedEnvironments in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connectedEnvironment. - * @param environmentEnvelope Configuration details of the connectedEnvironment. * @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 an environment for Kubernetes cluster specialized for web workloads by Azure App Service on successful - * completion of {@link Mono}. + * @return all connectedEnvironments in a resource group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String connectedEnvironmentName, - ConnectedEnvironmentPatchResource environmentEnvelope) { - return updateWithResponseAsync(resourceGroupName, connectedEnvironmentName, environmentEnvelope) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Update connected Environment's properties. - * - * Patches a Managed Environment. Only patching of tags is supported currently. + * Get all connectedEnvironments in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connectedEnvironment. - * @param environmentEnvelope Configuration details of the connectedEnvironment. * @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 an environment for Kubernetes cluster specialized for web workloads by Azure App Service along with - * {@link Response}. + * @return all connectedEnvironments in a resource group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, - String connectedEnvironmentName, ConnectedEnvironmentPatchResource environmentEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (environmentEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentEnvelope is required and cannot be null.")); - } else { - environmentEnvelope.validate(); - } + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + Context context) { final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, this.client.getApiVersion(), environmentEnvelope, accept, context); + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Update connected Environment's properties. + * Get all connectedEnvironments in a resource group. * - * Patches a Managed Environment. Only patching of tags is supported currently. + * @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 all connectedEnvironments in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * Get all connectedEnvironments in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connectedEnvironment. - * @param environmentEnvelope Configuration details of the connectedEnvironment. + * @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 an environment for Kubernetes cluster specialized for web workloads by Azure App Service. + * @return all connectedEnvironments in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * Get all connectedEnvironments for a 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 all connectedEnvironments for a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectedEnvironmentInner update(String resourceGroupName, String connectedEnvironmentName, - ConnectedEnvironmentPatchResource environmentEnvelope) { - return updateWithResponse(resourceGroupName, connectedEnvironmentName, environmentEnvelope, Context.NONE) - .getValue(); + private Mono> listSinglePageAsync() { + 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())); + } + + /** + * Get all connectedEnvironments for a 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 all connectedEnvironments for a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Get all connectedEnvironments for a 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 all connectedEnvironments for a subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get all connectedEnvironments for a 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 all connectedEnvironments for a subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get all connectedEnvironments for a 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 all connectedEnvironments for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * Get all connectedEnvironments for a 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 all connectedEnvironments for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); } /** @@ -1237,7 +950,7 @@ public ConnectedEnvironmentInner update(String resourceGroupName, String connect * Checks if resource connectedEnvironmentName is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Managed Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param checkNameAvailabilityRequest The check connectedEnvironmentName availability request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -1248,33 +961,12 @@ public ConnectedEnvironmentInner update(String resourceGroupName, String connect private Mono> checkNameAvailabilityWithResponseAsync( String resourceGroupName, String connectedEnvironmentName, CheckNameAvailabilityRequest checkNameAvailabilityRequest) { - 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 (connectedEnvironmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (checkNameAvailabilityRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter checkNameAvailabilityRequest is required and cannot be null.")); - } else { - checkNameAvailabilityRequest.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, - this.client.getApiVersion(), checkNameAvailabilityRequest, accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + connectedEnvironmentName, contentType, accept, checkNameAvailabilityRequest, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1284,7 +976,7 @@ private Mono> checkNameAvailability * Checks if resource connectedEnvironmentName is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Managed Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param checkNameAvailabilityRequest The check connectedEnvironmentName availability request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -1304,7 +996,7 @@ private Mono checkNameAvailabilityAsync(Stri * Checks if resource connectedEnvironmentName is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Managed Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param checkNameAvailabilityRequest The check connectedEnvironmentName availability request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1315,36 +1007,11 @@ private Mono checkNameAvailabilityAsync(Stri @ServiceMethod(returns = ReturnType.SINGLE) public Response checkNameAvailabilityWithResponse(String resourceGroupName, String connectedEnvironmentName, CheckNameAvailabilityRequest checkNameAvailabilityRequest, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (checkNameAvailabilityRequest == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter checkNameAvailabilityRequest is required and cannot be null.")); - } else { - checkNameAvailabilityRequest.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.checkNameAvailabilitySync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, connectedEnvironmentName, this.client.getApiVersion(), checkNameAvailabilityRequest, - accept, context); + return service.checkNameAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, contentType, accept, + checkNameAvailabilityRequest, context); } /** @@ -1353,7 +1020,7 @@ public Response checkNameAvailabilityWithRes * Checks if resource connectedEnvironmentName is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Managed Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param checkNameAvailabilityRequest The check connectedEnvironmentName availability request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -1368,67 +1035,45 @@ public CheckNameAvailabilityResponseInner checkNameAvailability(String resourceG } /** - * Get all connectedEnvironments for a subscription. - * * 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 all connectedEnvironments for a subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return all connectedEnvironments in a resource group 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.")); - } + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + 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 all connectedEnvironments for a subscription. - * * 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 all connectedEnvironments for a subscription along with {@link PagedResponse}. + * @return all connectedEnvironments in a resource group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { final String accept = "application/json"; Response res - = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } /** - * Get all connectedEnvironments for a subscription. - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1436,83 +1081,64 @@ private PagedResponse listBySubscriptionNextSinglePag * @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 all connectedEnvironments for a subscription along with {@link PagedResponse}. + * @return all connectedEnvironments in a resource group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listBySubscriptionNextSinglePage(String nextLink, + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } /** + * Get all connectedEnvironments for a subscription. + * * 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 all connectedEnvironments in a resource group along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return all connectedEnvironments for a subscription 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.")); - } + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + 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 all connectedEnvironments for a subscription. + * * 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 all connectedEnvironments in a resource group along with {@link PagedResponse}. + * @return all connectedEnvironments for a subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { final String accept = "application/json"; Response res - = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } /** + * Get all connectedEnvironments for a subscription. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1520,26 +1146,15 @@ private PagedResponse listByResourceGroupNextSinglePa * @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 all connectedEnvironments in a resource group along with {@link PagedResponse}. + * @return all connectedEnvironments for a subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupNextSinglePage(String nextLink, + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(ConnectedEnvironmentsClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsClientImpl.java index 010feafa279f..0740af96f221 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -31,13 +31,12 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.appcontainers.fluent.ConnectedEnvironmentsDaprComponentsClient; import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentInner; import com.azure.resourcemanager.appcontainers.fluent.models.DaprSecretsCollectionInner; -import com.azure.resourcemanager.appcontainers.models.DaprComponentsCollection; +import com.azure.resourcemanager.appcontainers.implementation.models.DaprComponentsCollection; import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -72,125 +71,117 @@ public final class ConnectedEnvironmentsDaprComponentsClientImpl implements Conn * The interface defining all the services for ContainerAppsApiClientConnectedEnvironmentsDaprComponents to be used * by the proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientConnectedEnvironmentsDaprComponents") public interface ConnectedEnvironmentsDaprComponentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("componentName") String componentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("componentName") String componentName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("componentName") String componentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("componentName") String componentName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("componentName") String componentName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DaprComponentInner daprComponentEnvelope, - @HeaderParam("Accept") String accept, Context context); + @PathParam("componentName") String componentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") DaprComponentInner daprComponentEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("componentName") String componentName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DaprComponentInner daprComponentEnvelope, - @HeaderParam("Accept") String accept, Context context); + @PathParam("componentName") String componentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") DaprComponentInner daprComponentEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("componentName") String componentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("componentName") String componentName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectedEnvironmentName") String connectedEnvironmentName, + @PathParam("componentName") String componentName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("componentName") String componentName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}/listSecrets") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSecrets(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("componentName") String componentName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}/listSecrets") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listSecretsSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listSecrets(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("componentName") String componentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("componentName") String componentName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}/listSecrets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response listSecretsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectedEnvironmentName") String connectedEnvironmentName, + @PathParam("componentName") String componentName, @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, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -198,177 +189,7 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get the Dapr Components for a connected environment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected 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 Components for a connected environment along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String connectedEnvironmentName) { - 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 (connectedEnvironmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, connectedEnvironmentName, 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 Components for a connected environment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected 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 Components for a connected environment as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String connectedEnvironmentName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, connectedEnvironmentName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get the Dapr Components for a connected environment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected 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 Components for a connected environment along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, - String connectedEnvironmentName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, this.client.getApiVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the Dapr Components for a connected environment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected 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 Components for a connected environment along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String connectedEnvironmentName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, this.client.getApiVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the Dapr Components for a connected environment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected 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 Components for a connected environment as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String connectedEnvironmentName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, connectedEnvironmentName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Get the Dapr Components for a connected environment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected 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 Components for a connected environment as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String connectedEnvironmentName, - Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, connectedEnvironmentName, context), - nextLink -> listNextSinglePage(nextLink, context)); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -385,30 +206,11 @@ public PagedIterable list(String resourceGroupName, String c @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String connectedEnvironmentName, 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 (connectedEnvironmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter connectedEnvironmentName 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.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, componentName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, componentName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -445,32 +247,9 @@ private Mono getAsync(String resourceGroupName, String conne @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String connectedEnvironmentName, String componentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (componentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, componentName, this.client.getApiVersion(), accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, connectedEnvironmentName, componentName, accept, context); } /** @@ -495,7 +274,7 @@ public DaprComponentInner get(String resourceGroupName, String connectedEnvironm * Creates or updates a Dapr Component in a connected environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param componentName Name of the Dapr Component. * @param daprComponentEnvelope Configuration details of the Dapr Component. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -506,36 +285,12 @@ public DaprComponentInner get(String resourceGroupName, String connectedEnvironm @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String connectedEnvironmentName, String componentName, DaprComponentInner daprComponentEnvelope) { - 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 (connectedEnvironmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (componentName == null) { - return Mono.error(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); - } - if (daprComponentEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter daprComponentEnvelope is required and cannot be null.")); - } else { - daprComponentEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, connectedEnvironmentName, componentName, this.client.getApiVersion(), - daprComponentEnvelope, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, componentName, + contentType, accept, daprComponentEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -545,7 +300,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * Creates or updates a Dapr Component in a connected environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param componentName Name of the Dapr Component. * @param daprComponentEnvelope Configuration details of the Dapr Component. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -556,39 +311,11 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String connectedEnvironmentName, String componentName, DaprComponentInner daprComponentEnvelope) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (componentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); - } - if (daprComponentEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter daprComponentEnvelope is required and cannot be null.")); - } else { - daprComponentEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, componentName, this.client.getApiVersion(), daprComponentEnvelope, accept, - Context.NONE); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, componentName, contentType, + accept, daprComponentEnvelope, Context.NONE); } /** @@ -597,7 +324,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName * Creates or updates a Dapr Component in a connected environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param componentName Name of the Dapr Component. * @param daprComponentEnvelope Configuration details of the Dapr Component. * @param context The context to associate with this operation. @@ -609,39 +336,11 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String connectedEnvironmentName, String componentName, DaprComponentInner daprComponentEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (componentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); - } - if (daprComponentEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter daprComponentEnvelope is required and cannot be null.")); - } else { - daprComponentEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, componentName, this.client.getApiVersion(), daprComponentEnvelope, accept, - context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, componentName, contentType, + accept, daprComponentEnvelope, context); } /** @@ -650,7 +349,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName * Creates or updates a Dapr Component in a connected environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param componentName Name of the Dapr Component. * @param daprComponentEnvelope Configuration details of the Dapr Component. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -674,7 +373,7 @@ private PollerFlux, DaprComponentInner> beginCrea * Creates or updates a Dapr Component in a connected environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param componentName Name of the Dapr Component. * @param daprComponentEnvelope Configuration details of the Dapr Component. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -697,7 +396,7 @@ public SyncPoller, DaprComponentInner> beginCreat * Creates or updates a Dapr Component in a connected environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param componentName Name of the Dapr Component. * @param daprComponentEnvelope Configuration details of the Dapr Component. * @param context The context to associate with this operation. @@ -722,7 +421,7 @@ public SyncPoller, DaprComponentInner> beginCreat * Creates or updates a Dapr Component in a connected environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param componentName Name of the Dapr Component. * @param daprComponentEnvelope Configuration details of the Dapr Component. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -743,7 +442,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, S * Creates or updates a Dapr Component in a connected environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param componentName Name of the Dapr Component. * @param daprComponentEnvelope Configuration details of the Dapr Component. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -764,7 +463,7 @@ public DaprComponentInner createOrUpdate(String resourceGroupName, String connec * Creates or updates a Dapr Component in a connected environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param componentName Name of the Dapr Component. * @param daprComponentEnvelope Configuration details of the Dapr Component. * @param context The context to associate with this operation. @@ -796,30 +495,9 @@ public DaprComponentInner createOrUpdate(String resourceGroupName, String connec @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String connectedEnvironmentName, 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 (connectedEnvironmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter connectedEnvironmentName 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.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, componentName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, componentName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -839,32 +517,8 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String connectedEnvironmentName, String componentName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (componentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, componentName, this.client.getApiVersion(), accept, Context.NONE); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, componentName, Context.NONE); } /** @@ -884,32 +538,8 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String connectedEnvironmentName, String componentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (componentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, componentName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, componentName, context); } /** @@ -1031,6 +661,122 @@ public void delete(String resourceGroupName, String connectedEnvironmentName, St beginDelete(resourceGroupName, connectedEnvironmentName, componentName, context).getFinalResult(); } + /** + * Get the Dapr Components for a connected environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connected 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 Components for a connected environment along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String connectedEnvironmentName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, 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 Components for a connected environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connected 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 Components for a connected environment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String connectedEnvironmentName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, connectedEnvironmentName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get the Dapr Components for a connected environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connected 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 Components for a connected environment along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String connectedEnvironmentName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, connectedEnvironmentName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the Dapr Components for a connected environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connected 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 Components for a connected environment along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String connectedEnvironmentName, + Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, connectedEnvironmentName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the Dapr Components for a connected environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connected 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 Components for a connected environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String connectedEnvironmentName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, connectedEnvironmentName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Get the Dapr Components for a connected environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connected 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 Components for a connected environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String connectedEnvironmentName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, connectedEnvironmentName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + /** * List secrets for a dapr component. * @@ -1046,29 +792,10 @@ public void delete(String resourceGroupName, String connectedEnvironmentName, St @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSecretsWithResponseAsync(String resourceGroupName, String connectedEnvironmentName, 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 (connectedEnvironmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter connectedEnvironmentName 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.listSecrets(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, connectedEnvironmentName, componentName, this.client.getApiVersion(), accept, + .withContext(context -> service.listSecrets(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, componentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1106,32 +833,10 @@ private Mono listSecretsAsync(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) public Response listSecretsWithResponse(String resourceGroupName, String connectedEnvironmentName, String componentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (componentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); - } final String accept = "application/json"; - return service.listSecretsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, componentName, this.client.getApiVersion(), accept, context); + return service.listSecretsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, componentName, accept, + context); } /** @@ -1166,13 +871,6 @@ public DaprSecretsCollectionInner listSecrets(String resourceGroupName, String c */ @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(), @@ -1193,15 +891,6 @@ private Mono> listNextSinglePageAsync(String n */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -1223,21 +912,10 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(ConnectedEnvironmentsDaprComponentsClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsImpl.java index efbf24f526d5..be1613e18b3a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -29,29 +29,12 @@ public ConnectedEnvironmentsDaprComponentsImpl(ConnectedEnvironmentsDaprComponen this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String connectedEnvironmentName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, connectedEnvironmentName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DaprComponentImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String connectedEnvironmentName, - Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, connectedEnvironmentName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DaprComponentImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String connectedEnvironmentName, String componentName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, connectedEnvironmentName, componentName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DaprComponentImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DaprComponentImpl(inner.getValue(), this.manager())); } public DaprComponent get(String resourceGroupName, String connectedEnvironmentName, String componentName) { @@ -72,16 +55,25 @@ public void delete(String resourceGroupName, String connectedEnvironmentName, St this.serviceClient().delete(resourceGroupName, connectedEnvironmentName, componentName, context); } + public PagedIterable list(String resourceGroupName, String connectedEnvironmentName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, connectedEnvironmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DaprComponentImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String connectedEnvironmentName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, connectedEnvironmentName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DaprComponentImpl(inner1, this.manager())); + } + public Response listSecretsWithResponse(String resourceGroupName, String connectedEnvironmentName, String componentName, Context context) { Response inner = this.serviceClient() .listSecretsWithResponse(resourceGroupName, connectedEnvironmentName, componentName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DaprSecretsCollectionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DaprSecretsCollectionImpl(inner.getValue(), this.manager())); } public DaprSecretsCollection listSecrets(String resourceGroupName, String connectedEnvironmentName, diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsImpl.java index 967e5ac9321f..69050687edd1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -30,37 +30,12 @@ public ConnectedEnvironmentsImpl(ConnectedEnvironmentsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectedEnvironmentImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectedEnvironmentImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectedEnvironmentImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectedEnvironmentImpl(inner1, this.manager())); - } - public Response getByResourceGroupWithResponse(String resourceGroupName, String connectedEnvironmentName, Context context) { Response inner = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, connectedEnvironmentName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ConnectedEnvironmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConnectedEnvironmentImpl(inner.getValue(), this.manager())); } public ConnectedEnvironment getByResourceGroup(String resourceGroupName, String connectedEnvironmentName) { @@ -81,17 +56,34 @@ public void delete(String resourceGroupName, String connectedEnvironmentName, Co this.serviceClient().delete(resourceGroupName, connectedEnvironmentName, context); } + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectedEnvironmentImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectedEnvironmentImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectedEnvironmentImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectedEnvironmentImpl(inner1, this.manager())); + } + public Response checkNameAvailabilityWithResponse(String resourceGroupName, String connectedEnvironmentName, CheckNameAvailabilityRequest checkNameAvailabilityRequest, Context context) { Response inner = this.serviceClient() .checkNameAvailabilityWithResponse(resourceGroupName, connectedEnvironmentName, checkNameAvailabilityRequest, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager())); } public CheckNameAvailabilityResponse checkNameAvailability(String resourceGroupName, diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsStoragesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsStoragesClientImpl.java index 80839b60ec55..aa675c043610 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsStoragesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsStoragesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -26,7 +26,6 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.appcontainers.fluent.ConnectedEnvironmentsStoragesClient; @@ -66,210 +65,97 @@ public final class ConnectedEnvironmentsStoragesClientImpl implements ConnectedE * The interface defining all the services for ContainerAppsApiClientConnectedEnvironmentsStorages to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientConnectedEnvironmentsStorages") public interface ConnectedEnvironmentsStoragesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages/{storageName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("storageName") String storageName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("storageName") String storageName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages/{storageName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("storageName") String storageName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("storageName") String storageName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages/{storageName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("storageName") String storageName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConnectedEnvironmentStorageInner storageEnvelope, - @HeaderParam("Accept") String accept, Context context); + @PathParam("storageName") String storageName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConnectedEnvironmentStorageInner storageEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages/{storageName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("storageName") String storageName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConnectedEnvironmentStorageInner storageEnvelope, - @HeaderParam("Accept") String accept, Context context); + @PathParam("storageName") String storageName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConnectedEnvironmentStorageInner storageEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages/{storageName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("storageName") String storageName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("storageName") String storageName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages/{storageName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("connectedEnvironmentName") String connectedEnvironmentName, - @PathParam("storageName") String storageName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get all storages for a connectedEnvironment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the 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 all storages for a connectedEnvironment along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String resourceGroupName, - String connectedEnvironmentName) { - 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 (connectedEnvironmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, connectedEnvironmentName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } + @PathParam("storageName") String storageName, Context context); - /** - * Get all storages for a connectedEnvironment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the 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 all storages for a connectedEnvironment on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String resourceGroupName, - String connectedEnvironmentName) { - return listWithResponseAsync(resourceGroupName, connectedEnvironmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get all storages for a connectedEnvironment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the 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 all storages for a connectedEnvironment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String resourceGroupName, - String connectedEnvironmentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, this.client.getApiVersion(), accept, context); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectedEnvironmentName") String connectedEnvironmentName, + @HeaderParam("Accept") String accept, Context context); - /** - * Get all storages for a connectedEnvironment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the 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 all storages for a connectedEnvironment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectedEnvironmentStoragesCollectionInner list(String resourceGroupName, String connectedEnvironmentName) { - return listWithResponse(resourceGroupName, connectedEnvironmentName, Context.NONE).getValue(); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectedEnvironmentName") String connectedEnvironmentName, + @HeaderParam("Accept") String accept, Context context); } /** * Get storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -279,29 +165,9 @@ public ConnectedEnvironmentStoragesCollectionInner list(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String connectedEnvironmentName, String storageName) { - 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 (connectedEnvironmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (storageName == null) { - return Mono.error(new IllegalArgumentException("Parameter storageName is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, connectedEnvironmentName, storageName, this.client.getApiVersion(), accept, context)) + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, storageName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -309,7 +175,7 @@ private Mono> getWithResponseAsync(St * Get storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -327,7 +193,7 @@ private Mono getAsync(String resourceGroupName * Get storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -338,39 +204,16 @@ private Mono getAsync(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String connectedEnvironmentName, String storageName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (storageName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter storageName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, storageName, this.client.getApiVersion(), accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, connectedEnvironmentName, storageName, accept, context); } /** * Get storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -387,7 +230,7 @@ public ConnectedEnvironmentStorageInner get(String resourceGroupName, String con * Create or update storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param storageEnvelope Configuration details of storage. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -399,36 +242,12 @@ public ConnectedEnvironmentStorageInner get(String resourceGroupName, String con @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String connectedEnvironmentName, String storageName, ConnectedEnvironmentStorageInner storageEnvelope) { - 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 (connectedEnvironmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (storageName == null) { - return Mono.error(new IllegalArgumentException("Parameter storageName is required and cannot be null.")); - } - if (storageEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageEnvelope is required and cannot be null.")); - } else { - storageEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, connectedEnvironmentName, storageName, this.client.getApiVersion(), storageEnvelope, - accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, storageName, contentType, + accept, storageEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -436,7 +255,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * Create or update storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param storageEnvelope Configuration details of storage. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -447,45 +266,18 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String connectedEnvironmentName, String storageName, ConnectedEnvironmentStorageInner storageEnvelope) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (storageName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter storageName is required and cannot be null.")); - } - if (storageEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter storageEnvelope is required and cannot be null.")); - } else { - storageEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, storageName, this.client.getApiVersion(), storageEnvelope, accept, Context.NONE); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, storageName, contentType, + accept, storageEnvelope, Context.NONE); } /** * Create or update storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param storageEnvelope Configuration details of storage. * @param context The context to associate with this operation. @@ -497,45 +289,18 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String connectedEnvironmentName, String storageName, ConnectedEnvironmentStorageInner storageEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (storageName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter storageName is required and cannot be null.")); - } - if (storageEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter storageEnvelope is required and cannot be null.")); - } else { - storageEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, storageName, this.client.getApiVersion(), storageEnvelope, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, storageName, contentType, + accept, storageEnvelope, context); } /** * Create or update storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param storageEnvelope Configuration details of storage. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -558,7 +323,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName * Create or update storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param storageEnvelope Configuration details of storage. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -580,7 +345,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName * Create or update storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param storageEnvelope Configuration details of storage. * @param context The context to associate with this operation. @@ -603,7 +368,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName * Create or update storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param storageEnvelope Configuration details of storage. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -623,7 +388,7 @@ private Mono createOrUpdateAsync(String resour * Create or update storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param storageEnvelope Configuration details of storage. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -642,7 +407,7 @@ public ConnectedEnvironmentStorageInner createOrUpdate(String resourceGroupName, * Create or update storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param storageEnvelope Configuration details of storage. * @param context The context to associate with this operation. @@ -662,7 +427,7 @@ public ConnectedEnvironmentStorageInner createOrUpdate(String resourceGroupName, * Delete storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -672,29 +437,9 @@ public ConnectedEnvironmentStorageInner createOrUpdate(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String connectedEnvironmentName, String storageName) { - 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 (connectedEnvironmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (storageName == null) { - return Mono.error(new IllegalArgumentException("Parameter storageName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, connectedEnvironmentName, storageName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, storageName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -702,7 +447,7 @@ private Mono>> deleteWithResponseAsync(String resource * Delete storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -712,39 +457,15 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String connectedEnvironmentName, String storageName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (storageName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter storageName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, storageName, this.client.getApiVersion(), accept, Context.NONE); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, storageName, Context.NONE); } /** * Delete storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -755,39 +476,15 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String connectedEnvironmentName, String storageName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (connectedEnvironmentName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter connectedEnvironmentName is required and cannot be null.")); - } - if (storageName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter storageName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - connectedEnvironmentName, storageName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, storageName, context); } /** * Delete storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -807,7 +504,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * Delete storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -825,7 +522,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * Delete storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -845,7 +542,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * Delete storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -862,7 +559,7 @@ private Mono deleteAsync(String resourceGroupName, String connectedEnviron * Delete storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -877,7 +574,7 @@ public void delete(String resourceGroupName, String connectedEnvironmentName, St * Delete storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -889,5 +586,75 @@ public void delete(String resourceGroupName, String connectedEnvironmentName, St beginDelete(resourceGroupName, connectedEnvironmentName, storageName, context).getFinalResult(); } - private static final ClientLogger LOGGER = new ClientLogger(ConnectedEnvironmentsStoragesClientImpl.class); + /** + * Get all storages for a connectedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connectedEnvironment. + * @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 all storages for a connectedEnvironment along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, + String connectedEnvironmentName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectedEnvironmentName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all storages for a connectedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connectedEnvironment. + * @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 all storages for a connectedEnvironment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, + String connectedEnvironmentName) { + return listWithResponseAsync(resourceGroupName, connectedEnvironmentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get all storages for a connectedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connectedEnvironment. + * @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 all storages for a connectedEnvironment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, + String connectedEnvironmentName, Context context) { + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, connectedEnvironmentName, accept, context); + } + + /** + * Get all storages for a connectedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connectedEnvironment. + * @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 all storages for a connectedEnvironment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectedEnvironmentStoragesCollectionInner list(String resourceGroupName, String connectedEnvironmentName) { + return listWithResponse(resourceGroupName, connectedEnvironmentName, Context.NONE).getValue(); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsStoragesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsStoragesImpl.java index ee606ea30d78..44fa2bec1b06 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsStoragesImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsStoragesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -28,38 +28,12 @@ public ConnectedEnvironmentsStoragesImpl(ConnectedEnvironmentsStoragesClient inn this.serviceManager = serviceManager; } - public Response listWithResponse(String resourceGroupName, - String connectedEnvironmentName, Context context) { - Response inner - = this.serviceClient().listWithResponse(resourceGroupName, connectedEnvironmentName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ConnectedEnvironmentStoragesCollectionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ConnectedEnvironmentStoragesCollection list(String resourceGroupName, String connectedEnvironmentName) { - ConnectedEnvironmentStoragesCollectionInner inner - = this.serviceClient().list(resourceGroupName, connectedEnvironmentName); - if (inner != null) { - return new ConnectedEnvironmentStoragesCollectionImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse(String resourceGroupName, String connectedEnvironmentName, String storageName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, connectedEnvironmentName, storageName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ConnectedEnvironmentStorageImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConnectedEnvironmentStorageImpl(inner.getValue(), this.manager())); } public ConnectedEnvironmentStorage get(String resourceGroupName, String connectedEnvironmentName, @@ -81,6 +55,24 @@ public void delete(String resourceGroupName, String connectedEnvironmentName, St this.serviceClient().delete(resourceGroupName, connectedEnvironmentName, storageName, context); } + public Response listWithResponse(String resourceGroupName, + String connectedEnvironmentName, Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, connectedEnvironmentName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConnectedEnvironmentStoragesCollectionImpl(inner.getValue(), this.manager())); + } + + public ConnectedEnvironmentStoragesCollection list(String resourceGroupName, String connectedEnvironmentName) { + ConnectedEnvironmentStoragesCollectionInner inner + = this.serviceClient().list(resourceGroupName, connectedEnvironmentName); + if (inner != null) { + return new ConnectedEnvironmentStoragesCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + public ConnectedEnvironmentStorage 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/ContainerAppAuthTokenImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppAuthTokenImpl.java index c0b49215b5a4..997ffae9c93e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppAuthTokenImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppAuthTokenImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; 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 23c907be949c..68c1fb4ca3bd 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -12,6 +12,7 @@ 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.ContainerAppNetworkingConfiguration; import com.azure.resourcemanager.appcontainers.models.ContainerAppProvisioningState; import com.azure.resourcemanager.appcontainers.models.ContainerAppRunningStatus; import com.azure.resourcemanager.appcontainers.models.CustomHostnameAnalysisResult; @@ -90,6 +91,10 @@ public String environmentId() { return this.innerModel().environmentId(); } + public ContainerAppNetworkingConfiguration networking() { + return this.innerModel().networking(); + } + public String workloadProfileName() { return this.innerModel().workloadProfileName(); } @@ -309,6 +314,11 @@ public ContainerAppImpl withEnvironmentId(String environmentId) { return this; } + public ContainerAppImpl withNetworking(ContainerAppNetworkingConfiguration networking) { + this.innerModel().withNetworking(networking); + return this; + } + public ContainerAppImpl withWorkloadProfileName(String workloadProfileName) { this.innerModel().withWorkloadProfileName(workloadProfileName); return this; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppJobExecutionsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppJobExecutionsImpl.java index 6dfa8160d1f7..87bfad70676b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppJobExecutionsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppJobExecutionsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppPrivateEndpointConnectionsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppPrivateEndpointConnectionsClientImpl.java new file mode 100644 index 000000000000..fc4edfc30d38 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppPrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,870 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.BinaryData; +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.ContainerAppPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.appcontainers.implementation.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 + * ContainerAppPrivateEndpointConnectionsClient. + */ +public final class ContainerAppPrivateEndpointConnectionsClientImpl + implements ContainerAppPrivateEndpointConnectionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ContainerAppPrivateEndpointConnectionsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppPrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppPrivateEndpointConnectionsClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(ContainerAppPrivateEndpointConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerAppPrivateEndpointConnections to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ContainerAppsApiClientContainerAppPrivateEndpointConnections") + public interface ContainerAppPrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a private endpoint connection for a given Container App. + * + * Gets the details of a private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Container App. + * + * Gets the details of a private endpoint connection associated with a Container App along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String containerAppName, String privateEndpointConnectionName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, privateEndpointConnectionName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a private endpoint connection for a given Container App. + * + * Gets the details of a private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Container App. + * + * Gets the details of a private endpoint connection associated with a Container App on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String containerAppName, + String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, containerAppName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a private endpoint connection for a given Container App. + * + * Gets the details of a private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 Container App. + * + * Gets the details of a private endpoint connection associated with a Container App along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String containerAppName, + String privateEndpointConnectionName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, privateEndpointConnectionName, accept, context); + } + + /** + * Get a private endpoint connection for a given Container App. + * + * Gets the details of a private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Container App. + * + * Gets the details of a private endpoint connection associated with a Container App. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get(String resourceGroupName, String containerAppName, + String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, containerAppName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + /** + * Update the state of a private endpoint connection for a given Container App. + * + * Creates a private endpoint connection or updates its connection state 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 privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 containerAppName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnectionEnvelope) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, privateEndpointConnectionName, + contentType, accept, privateEndpointConnectionEnvelope, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the state of a private endpoint connection for a given Container App. + * + * Creates a private endpoint connection or updates its connection state 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 privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String containerAppName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, privateEndpointConnectionName, + contentType, accept, privateEndpointConnectionEnvelope, Context.NONE); + } + + /** + * Update the state of a private endpoint connection for a given Container App. + * + * Creates a private endpoint connection or updates its connection state 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 privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String containerAppName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, privateEndpointConnectionName, + contentType, accept, privateEndpointConnectionEnvelope, context); + } + + /** + * Update the state of a private endpoint connection for a given Container App. + * + * Creates a private endpoint connection or updates its connection state 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 privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 containerAppName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, containerAppName, + 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 Container App. + * + * Creates a private endpoint connection or updates its connection state 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 privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 containerAppName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnectionEnvelope) { + Response response = createOrUpdateWithResponse(resourceGroupName, containerAppName, + privateEndpointConnectionName, privateEndpointConnectionEnvelope); + return this.client.getLroResult(response, + PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, Context.NONE); + } + + /** + * Update the state of a private endpoint connection for a given Container App. + * + * Creates a private endpoint connection or updates its connection state 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 privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 containerAppName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, containerAppName, + privateEndpointConnectionName, privateEndpointConnectionEnvelope, context); + return this.client.getLroResult(response, + PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, context); + } + + /** + * Update the state of a private endpoint connection for a given Container App. + * + * Creates a private endpoint connection or updates its connection state 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 privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 containerAppName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, containerAppName, privateEndpointConnectionName, + privateEndpointConnectionEnvelope).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the state of a private endpoint connection for a given Container App. + * + * Creates a private endpoint connection or updates its connection state 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 privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 containerAppName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope) { + return beginCreateOrUpdate(resourceGroupName, containerAppName, privateEndpointConnectionName, + privateEndpointConnectionEnvelope).getFinalResult(); + } + + /** + * Update the state of a private endpoint connection for a given Container App. + * + * Creates a private endpoint connection or updates its connection state 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 privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 containerAppName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, + Context context) { + return beginCreateOrUpdate(resourceGroupName, containerAppName, privateEndpointConnectionName, + privateEndpointConnectionEnvelope, context).getFinalResult(); + } + + /** + * Delete a private endpoint connection for a given Container App. + * + * Deletes the specified private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 privateEndpointConnectionName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, privateEndpointConnectionName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a private endpoint connection for a given Container App. + * + * Deletes the specified private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String containerAppName, + String privateEndpointConnectionName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, privateEndpointConnectionName, + Context.NONE); + } + + /** + * Delete a private endpoint connection for a given Container App. + * + * Deletes the specified private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String containerAppName, + String privateEndpointConnectionName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, privateEndpointConnectionName, + context); + } + + /** + * Delete a private endpoint connection for a given Container App. + * + * Deletes the specified private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 privateEndpointConnectionName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, containerAppName, privateEndpointConnectionName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a private endpoint connection for a given Container App. + * + * Deletes the specified private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 privateEndpointConnectionName) { + Response response + = deleteWithResponse(resourceGroupName, containerAppName, privateEndpointConnectionName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a private endpoint connection for a given Container App. + * + * Deletes the specified private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 privateEndpointConnectionName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, containerAppName, privateEndpointConnectionName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a private endpoint connection for a given Container App. + * + * Deletes the specified private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, containerAppName, privateEndpointConnectionName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a private endpoint connection for a given Container App. + * + * Deletes the specified private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 privateEndpointConnectionName) { + beginDelete(resourceGroupName, containerAppName, privateEndpointConnectionName).getFinalResult(); + } + + /** + * Delete a private endpoint connection for a given Container App. + * + * Deletes the specified private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 privateEndpointConnectionName, + Context context) { + beginDelete(resourceGroupName, containerAppName, privateEndpointConnectionName, context).getFinalResult(); + } + + /** + * List private endpoint connections for a given Container App. + * + * Lists all private endpoint connections associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PrivateEndpointConnection list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String containerAppName) { + 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 private endpoint connections for a given Container App. + * + * Lists all private endpoint connections associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PrivateEndpointConnection 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 private endpoint connections for a given Container App. + * + * Lists all private endpoint connections associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PrivateEndpointConnection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String containerAppName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List private endpoint connections for a given Container App. + * + * Lists all private endpoint connections associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @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 PrivateEndpointConnection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String containerAppName, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List private endpoint connections for a given Container App. + * + * Lists all private endpoint connections associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PrivateEndpointConnection list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String containerAppName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, containerAppName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List private endpoint connections for a given Container App. + * + * Lists all private endpoint connections associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @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 PrivateEndpointConnection list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String containerAppName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, containerAppName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * List private endpoint connections for a given Container App. + * + * 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 PrivateEndpointConnection list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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())); + } + + /** + * List private endpoint connections for a given Container App. + * + * 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 PrivateEndpointConnection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List private endpoint connections for a given Container App. + * + * 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 PrivateEndpointConnection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/ContainerAppPrivateEndpointConnectionsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppPrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..4ef7de16ad2c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppPrivateEndpointConnectionsImpl.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ContainerAppPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppPrivateEndpointConnections; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointConnection; + +public final class ContainerAppPrivateEndpointConnectionsImpl implements ContainerAppPrivateEndpointConnections { + private static final ClientLogger LOGGER = new ClientLogger(ContainerAppPrivateEndpointConnectionsImpl.class); + + private final ContainerAppPrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public ContainerAppPrivateEndpointConnectionsImpl(ContainerAppPrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String containerAppName, + String privateEndpointConnectionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, containerAppName, privateEndpointConnectionName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } + + public PrivateEndpointConnection get(String resourceGroupName, String containerAppName, + String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner + = this.serviceClient().get(resourceGroupName, containerAppName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateEndpointConnection createOrUpdate(String resourceGroupName, String containerAppName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope) { + PrivateEndpointConnectionInner inner = this.serviceClient() + .createOrUpdate(resourceGroupName, containerAppName, privateEndpointConnectionName, + privateEndpointConnectionEnvelope); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateEndpointConnection createOrUpdate(String resourceGroupName, String containerAppName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, + Context context) { + PrivateEndpointConnectionInner inner = this.serviceClient() + .createOrUpdate(resourceGroupName, containerAppName, privateEndpointConnectionName, + privateEndpointConnectionEnvelope, context); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String containerAppName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, containerAppName, privateEndpointConnectionName); + } + + public void delete(String resourceGroupName, String containerAppName, String privateEndpointConnectionName, + Context context) { + this.serviceClient().delete(resourceGroupName, containerAppName, privateEndpointConnectionName, context); + } + + public PagedIterable list(String resourceGroupName, String containerAppName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, containerAppName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(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 PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + private ContainerAppPrivateEndpointConnectionsClient 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/ContainerAppPrivateLinkResourcesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppPrivateLinkResourcesClientImpl.java new file mode 100644 index 000000000000..9d502774ab3f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppPrivateLinkResourcesClientImpl.java @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ContainerAppPrivateLinkResourcesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.appcontainers.implementation.models.PrivateLinkResourceListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ContainerAppPrivateLinkResourcesClient. + */ +public final class ContainerAppPrivateLinkResourcesClientImpl implements ContainerAppPrivateLinkResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ContainerAppPrivateLinkResourcesService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppPrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppPrivateLinkResourcesClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(ContainerAppPrivateLinkResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerAppPrivateLinkResources to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ContainerAppsApiClientContainerAppPrivateLinkResources") + public interface ContainerAppPrivateLinkResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/privateLinkResources/{privateLinkResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("privateLinkResourceName") String privateLinkResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/privateLinkResources/{privateLinkResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("privateLinkResourceName") String privateLinkResourceName, @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List private link resources for a given Container App. + * + * Lists the private link resources supported by a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 link resources for a managed environment along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String containerAppName) { + 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 private link resources for a given Container App. + * + * Lists the private link resources supported by a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 link resources for a managed environment 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 private link resources for a given Container App. + * + * Lists the private link resources supported by a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 link resources for a managed environment along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String containerAppName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List private link resources for a given Container App. + * + * Lists the private link resources supported by a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @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 link resources for a managed environment along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String containerAppName, + Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List private link resources for a given Container App. + * + * Lists the private link resources supported by a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 link resources for a managed environment as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String containerAppName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, containerAppName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List private link resources for a given Container App. + * + * Lists the private link resources supported by a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @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 link resources for a managed environment as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String containerAppName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, containerAppName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get a private link resource for a given Container App. + * + * Gets the details of a private link resource supported by a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateLinkResourceName The name of the private link 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 link resource for a given Container App. + * + * Gets the details of a private link resource supported by a Container App along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String containerAppName, String privateLinkResourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, privateLinkResourceName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a private link resource for a given Container App. + * + * Gets the details of a private link resource supported by a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateLinkResourceName The name of the private link 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 link resource for a given Container App. + * + * Gets the details of a private link resource supported by a Container App on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String containerAppName, + String privateLinkResourceName) { + return getWithResponseAsync(resourceGroupName, containerAppName, privateLinkResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a private link resource for a given Container App. + * + * Gets the details of a private link resource supported by a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateLinkResourceName The name of the private link 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 link resource for a given Container App. + * + * Gets the details of a private link resource supported by a Container App along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String containerAppName, + String privateLinkResourceName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, privateLinkResourceName, accept, context); + } + + /** + * Get a private link resource for a given Container App. + * + * Gets the details of a private link resource supported by a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateLinkResourceName The name of the private link 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 link resource for a given Container App. + * + * Gets the details of a private link resource supported by a Container App. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner get(String resourceGroupName, String containerAppName, + String privateLinkResourceName) { + return getWithResponse(resourceGroupName, containerAppName, privateLinkResourceName, Context.NONE).getValue(); + } + + /** + * List private link resources for a given Container App. + * + * 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 link resources for a managed environment along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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())); + } + + /** + * List private link resources for a given Container App. + * + * 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 link resources for a managed environment along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List private link resources for a given Container App. + * + * 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 link resources for a managed environment along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/ContainerAppPrivateLinkResourcesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppPrivateLinkResourcesImpl.java new file mode 100644 index 000000000000..6d1c9faf31dc --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppPrivateLinkResourcesImpl.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ContainerAppPrivateLinkResourcesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppPrivateLinkResources; +import com.azure.resourcemanager.appcontainers.models.PrivateLinkResource; + +public final class ContainerAppPrivateLinkResourcesImpl implements ContainerAppPrivateLinkResources { + private static final ClientLogger LOGGER = new ClientLogger(ContainerAppPrivateLinkResourcesImpl.class); + + private final ContainerAppPrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public ContainerAppPrivateLinkResourcesImpl(ContainerAppPrivateLinkResourcesClient 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 PrivateLinkResourceImpl(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 PrivateLinkResourceImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String containerAppName, + String privateLinkResourceName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, containerAppName, privateLinkResourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + } + + public PrivateLinkResource get(String resourceGroupName, String containerAppName, String privateLinkResourceName) { + PrivateLinkResourceInner inner + = this.serviceClient().get(resourceGroupName, containerAppName, privateLinkResourceName); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private ContainerAppPrivateLinkResourcesClient 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/ContainerAppsApiClientBuilder.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsApiClientBuilder.java index 29f39590b634..493ecc934e31 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -20,34 +20,34 @@ @ServiceClientBuilder(serviceClients = { ContainerAppsApiClientImpl.class }) public final class ContainerAppsApiClientBuilder { /* - * The ID of the target subscription. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The ID of the target subscription. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. + * @param endpoint the endpoint value. * @return the ContainerAppsApiClientBuilder. */ - public ContainerAppsApiClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public ContainerAppsApiClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. + * @param subscriptionId the subscriptionId value. * @return the ContainerAppsApiClientBuilder. */ - public ContainerAppsApiClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public ContainerAppsApiClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -132,7 +132,7 @@ public ContainerAppsApiClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ContainerAppsApiClientImpl client = new ContainerAppsApiClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } 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 7bf5698e969e..947c58d9dd37 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -26,6 +26,7 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.appcontainers.fluent.AvailableEnvironmentModesClient; import com.azure.resourcemanager.appcontainers.fluent.AvailableWorkloadProfilesClient; import com.azure.resourcemanager.appcontainers.fluent.BillingMetersClient; import com.azure.resourcemanager.appcontainers.fluent.CertificatesClient; @@ -33,15 +34,23 @@ import com.azure.resourcemanager.appcontainers.fluent.ConnectedEnvironmentsClient; import com.azure.resourcemanager.appcontainers.fluent.ConnectedEnvironmentsDaprComponentsClient; import com.azure.resourcemanager.appcontainers.fluent.ConnectedEnvironmentsStoragesClient; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppPrivateLinkResourcesClient; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsApiClient; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsAuthConfigsClient; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsClient; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsDiagnosticsClient; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsFunctionsClient; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsLabelHistoriesClient; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsRevisionFunctionsClient; 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.DotNetComponentsClient; +import com.azure.resourcemanager.appcontainers.fluent.FunctionsExtensionsClient; import com.azure.resourcemanager.appcontainers.fluent.HttpRouteConfigsClient; import com.azure.resourcemanager.appcontainers.fluent.JavaComponentsClient; import com.azure.resourcemanager.appcontainers.fluent.JobsClient; @@ -59,7 +68,9 @@ import com.azure.resourcemanager.appcontainers.fluent.NamespacesClient; import com.azure.resourcemanager.appcontainers.fluent.OperationsClient; import com.azure.resourcemanager.appcontainers.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.appcontainers.fluent.SandboxGroupsClient; import com.azure.resourcemanager.appcontainers.fluent.UsagesClient; +import com.azure.resourcemanager.appcontainers.fluent.VnetConnectionsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -75,26 +86,12 @@ @ServiceClient(builder = ContainerAppsApiClientBuilder.class) public final class ContainerAppsApiClientImpl implements ContainerAppsApiClient { /** - * The ID of the target subscription. - */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -103,12 +100,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -116,6 +113,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -159,115 +170,115 @@ public Duration getDefaultPollInterval() { } /** - * The ContainerAppsAuthConfigsClient object to access its operations. + * The ResourceProvidersClient object to access its operations. */ - private final ContainerAppsAuthConfigsClient containerAppsAuthConfigs; + private final ResourceProvidersClient resourceProviders; /** - * Gets the ContainerAppsAuthConfigsClient object to access its operations. + * Gets the ResourceProvidersClient object to access its operations. * - * @return the ContainerAppsAuthConfigsClient object. + * @return the ResourceProvidersClient object. */ - public ContainerAppsAuthConfigsClient getContainerAppsAuthConfigs() { - return this.containerAppsAuthConfigs; + public ResourceProvidersClient getResourceProviders() { + return this.resourceProviders; } /** - * The AvailableWorkloadProfilesClient object to access its operations. + * The OperationsClient object to access its operations. */ - private final AvailableWorkloadProfilesClient availableWorkloadProfiles; + private final OperationsClient operations; /** - * Gets the AvailableWorkloadProfilesClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the AvailableWorkloadProfilesClient object. + * @return the OperationsClient object. */ - public AvailableWorkloadProfilesClient getAvailableWorkloadProfiles() { - return this.availableWorkloadProfiles; + public OperationsClient getOperations() { + return this.operations; } /** - * The BillingMetersClient object to access its operations. + * The ContainerAppsSessionPoolsClient object to access its operations. */ - private final BillingMetersClient billingMeters; + private final ContainerAppsSessionPoolsClient containerAppsSessionPools; /** - * Gets the BillingMetersClient object to access its operations. + * Gets the ContainerAppsSessionPoolsClient object to access its operations. * - * @return the BillingMetersClient object. + * @return the ContainerAppsSessionPoolsClient object. */ - public BillingMetersClient getBillingMeters() { - return this.billingMeters; + public ContainerAppsSessionPoolsClient getContainerAppsSessionPools() { + return this.containerAppsSessionPools; } /** - * The ConnectedEnvironmentsClient object to access its operations. + * The SandboxGroupsClient object to access its operations. */ - private final ConnectedEnvironmentsClient connectedEnvironments; + private final SandboxGroupsClient sandboxGroups; /** - * Gets the ConnectedEnvironmentsClient object to access its operations. + * Gets the SandboxGroupsClient object to access its operations. * - * @return the ConnectedEnvironmentsClient object. + * @return the SandboxGroupsClient object. */ - public ConnectedEnvironmentsClient getConnectedEnvironments() { - return this.connectedEnvironments; + public SandboxGroupsClient getSandboxGroups() { + return this.sandboxGroups; } /** - * The ConnectedEnvironmentsCertificatesClient object to access its operations. + * The VnetConnectionsClient object to access its operations. */ - private final ConnectedEnvironmentsCertificatesClient connectedEnvironmentsCertificates; + private final VnetConnectionsClient vnetConnections; /** - * Gets the ConnectedEnvironmentsCertificatesClient object to access its operations. + * Gets the VnetConnectionsClient object to access its operations. * - * @return the ConnectedEnvironmentsCertificatesClient object. + * @return the VnetConnectionsClient object. */ - public ConnectedEnvironmentsCertificatesClient getConnectedEnvironmentsCertificates() { - return this.connectedEnvironmentsCertificates; + public VnetConnectionsClient getVnetConnections() { + return this.vnetConnections; } /** - * The ConnectedEnvironmentsDaprComponentsClient object to access its operations. + * The ContainerAppsSourceControlsClient object to access its operations. */ - private final ConnectedEnvironmentsDaprComponentsClient connectedEnvironmentsDaprComponents; + private final ContainerAppsSourceControlsClient containerAppsSourceControls; /** - * Gets the ConnectedEnvironmentsDaprComponentsClient object to access its operations. + * Gets the ContainerAppsSourceControlsClient object to access its operations. * - * @return the ConnectedEnvironmentsDaprComponentsClient object. + * @return the ContainerAppsSourceControlsClient object. */ - public ConnectedEnvironmentsDaprComponentsClient getConnectedEnvironmentsDaprComponents() { - return this.connectedEnvironmentsDaprComponents; + public ContainerAppsSourceControlsClient getContainerAppsSourceControls() { + return this.containerAppsSourceControls; } /** - * The ConnectedEnvironmentsStoragesClient object to access its operations. + * The ContainerAppsClient object to access its operations. */ - private final ConnectedEnvironmentsStoragesClient connectedEnvironmentsStorages; + private final ContainerAppsClient containerApps; /** - * Gets the ConnectedEnvironmentsStoragesClient object to access its operations. + * Gets the ContainerAppsClient object to access its operations. * - * @return the ConnectedEnvironmentsStoragesClient object. + * @return the ContainerAppsClient object. */ - public ConnectedEnvironmentsStoragesClient getConnectedEnvironmentsStorages() { - return this.connectedEnvironmentsStorages; + public ContainerAppsClient getContainerApps() { + return this.containerApps; } /** - * The ContainerAppsClient object to access its operations. + * The ContainerAppsFunctionsClient object to access its operations. */ - private final ContainerAppsClient containerApps; + private final ContainerAppsFunctionsClient containerAppsFunctions; /** - * Gets the ContainerAppsClient object to access its operations. + * Gets the ContainerAppsFunctionsClient object to access its operations. * - * @return the ContainerAppsClient object. + * @return the ContainerAppsFunctionsClient object. */ - public ContainerAppsClient getContainerApps() { - return this.containerApps; + public ContainerAppsFunctionsClient getContainerAppsFunctions() { + return this.containerAppsFunctions; } /** @@ -285,129 +296,129 @@ public ContainerAppsRevisionsClient getContainerAppsRevisions() { } /** - * The ContainerAppsRevisionReplicasClient object to access its operations. + * The FunctionsExtensionsClient object to access its operations. */ - private final ContainerAppsRevisionReplicasClient containerAppsRevisionReplicas; + private final FunctionsExtensionsClient functionsExtensions; /** - * Gets the ContainerAppsRevisionReplicasClient object to access its operations. + * Gets the FunctionsExtensionsClient object to access its operations. * - * @return the ContainerAppsRevisionReplicasClient object. + * @return the FunctionsExtensionsClient object. */ - public ContainerAppsRevisionReplicasClient getContainerAppsRevisionReplicas() { - return this.containerAppsRevisionReplicas; + public FunctionsExtensionsClient getFunctionsExtensions() { + return this.functionsExtensions; } /** - * The ContainerAppsDiagnosticsClient object to access its operations. + * The ContainerAppsLabelHistoriesClient object to access its operations. */ - private final ContainerAppsDiagnosticsClient containerAppsDiagnostics; + private final ContainerAppsLabelHistoriesClient containerAppsLabelHistories; /** - * Gets the ContainerAppsDiagnosticsClient object to access its operations. + * Gets the ContainerAppsLabelHistoriesClient object to access its operations. * - * @return the ContainerAppsDiagnosticsClient object. + * @return the ContainerAppsLabelHistoriesClient object. */ - public ContainerAppsDiagnosticsClient getContainerAppsDiagnostics() { - return this.containerAppsDiagnostics; + public ContainerAppsLabelHistoriesClient getContainerAppsLabelHistories() { + return this.containerAppsLabelHistories; } /** - * The ManagedEnvironmentDiagnosticsClient object to access its operations. + * The ContainerAppsRevisionReplicasClient object to access its operations. */ - private final ManagedEnvironmentDiagnosticsClient managedEnvironmentDiagnostics; + private final ContainerAppsRevisionReplicasClient containerAppsRevisionReplicas; /** - * Gets the ManagedEnvironmentDiagnosticsClient object to access its operations. + * Gets the ContainerAppsRevisionReplicasClient object to access its operations. * - * @return the ManagedEnvironmentDiagnosticsClient object. + * @return the ContainerAppsRevisionReplicasClient object. */ - public ManagedEnvironmentDiagnosticsClient getManagedEnvironmentDiagnostics() { - return this.managedEnvironmentDiagnostics; + public ContainerAppsRevisionReplicasClient getContainerAppsRevisionReplicas() { + return this.containerAppsRevisionReplicas; } /** - * The ManagedEnvironmentsDiagnosticsClient object to access its operations. + * The DotNetComponentsClient object to access its operations. */ - private final ManagedEnvironmentsDiagnosticsClient managedEnvironmentsDiagnostics; + private final DotNetComponentsClient dotNetComponents; /** - * Gets the ManagedEnvironmentsDiagnosticsClient object to access its operations. + * Gets the DotNetComponentsClient object to access its operations. * - * @return the ManagedEnvironmentsDiagnosticsClient object. + * @return the DotNetComponentsClient object. */ - public ManagedEnvironmentsDiagnosticsClient getManagedEnvironmentsDiagnostics() { - return this.managedEnvironmentsDiagnostics; + public DotNetComponentsClient getDotNetComponents() { + return this.dotNetComponents; } /** - * The JobsClient object to access its operations. + * The JavaComponentsClient object to access its operations. */ - private final JobsClient jobs; + private final JavaComponentsClient javaComponents; /** - * Gets the JobsClient object to access its operations. + * Gets the JavaComponentsClient object to access its operations. * - * @return the JobsClient object. + * @return the JavaComponentsClient object. */ - public JobsClient getJobs() { - return this.jobs; + public JavaComponentsClient getJavaComponents() { + return this.javaComponents; } /** - * The OperationsClient object to access its operations. + * The LogicAppsClient object to access its operations. */ - private final OperationsClient operations; + private final LogicAppsClient logicApps; /** - * Gets the OperationsClient object to access its operations. + * Gets the LogicAppsClient object to access its operations. * - * @return the OperationsClient object. + * @return the LogicAppsClient object. */ - public OperationsClient getOperations() { - return this.operations; + public LogicAppsClient getLogicApps() { + return this.logicApps; } /** - * The JavaComponentsClient object to access its operations. + * The ContainerAppsAuthConfigsClient object to access its operations. */ - private final JavaComponentsClient javaComponents; + private final ContainerAppsAuthConfigsClient containerAppsAuthConfigs; /** - * Gets the JavaComponentsClient object to access its operations. + * Gets the ContainerAppsAuthConfigsClient object to access its operations. * - * @return the JavaComponentsClient object. + * @return the ContainerAppsAuthConfigsClient object. */ - public JavaComponentsClient getJavaComponents() { - return this.javaComponents; + public ContainerAppsAuthConfigsClient getContainerAppsAuthConfigs() { + return this.containerAppsAuthConfigs; } /** - * The JobsExecutionsClient object to access its operations. + * The ConnectedEnvironmentsClient object to access its operations. */ - private final JobsExecutionsClient jobsExecutions; + private final ConnectedEnvironmentsClient connectedEnvironments; /** - * Gets the JobsExecutionsClient object to access its operations. + * Gets the ConnectedEnvironmentsClient object to access its operations. * - * @return the JobsExecutionsClient object. + * @return the ConnectedEnvironmentsClient object. */ - public JobsExecutionsClient getJobsExecutions() { - return this.jobsExecutions; + public ConnectedEnvironmentsClient getConnectedEnvironments() { + return this.connectedEnvironments; } /** - * The ResourceProvidersClient object to access its operations. + * The CertificatesClient object to access its operations. */ - private final ResourceProvidersClient resourceProviders; + private final CertificatesClient certificates; /** - * Gets the ResourceProvidersClient object to access its operations. + * Gets the CertificatesClient object to access its operations. * - * @return the ResourceProvidersClient object. + * @return the CertificatesClient object. */ - public ResourceProvidersClient getResourceProviders() { - return this.resourceProviders; + public CertificatesClient getCertificates() { + return this.certificates; } /** @@ -425,17 +436,45 @@ public ManagedEnvironmentsClient getManagedEnvironments() { } /** - * The CertificatesClient object to access its operations. + * The ConnectedEnvironmentsDaprComponentsClient object to access its operations. */ - private final CertificatesClient certificates; + private final ConnectedEnvironmentsDaprComponentsClient connectedEnvironmentsDaprComponents; /** - * Gets the CertificatesClient object to access its operations. + * Gets the ConnectedEnvironmentsDaprComponentsClient object to access its operations. * - * @return the CertificatesClient object. + * @return the ConnectedEnvironmentsDaprComponentsClient object. */ - public CertificatesClient getCertificates() { - return this.certificates; + public ConnectedEnvironmentsDaprComponentsClient getConnectedEnvironmentsDaprComponents() { + return this.connectedEnvironmentsDaprComponents; + } + + /** + * The DaprComponentsClient object to access its operations. + */ + private final DaprComponentsClient daprComponents; + + /** + * Gets the DaprComponentsClient object to access its operations. + * + * @return the DaprComponentsClient object. + */ + public DaprComponentsClient getDaprComponents() { + return this.daprComponents; + } + + /** + * The ConnectedEnvironmentsStoragesClient object to access its operations. + */ + private final ConnectedEnvironmentsStoragesClient connectedEnvironmentsStorages; + + /** + * Gets the ConnectedEnvironmentsStoragesClient object to access its operations. + * + * @return the ConnectedEnvironmentsStoragesClient object. + */ + public ConnectedEnvironmentsStoragesClient getConnectedEnvironmentsStorages() { + return this.connectedEnvironmentsStorages; } /** @@ -453,31 +492,31 @@ public ManagedCertificatesClient getManagedCertificates() { } /** - * The NamespacesClient object to access its operations. + * The ContainerAppPrivateEndpointConnectionsClient object to access its operations. */ - private final NamespacesClient namespaces; + private final ContainerAppPrivateEndpointConnectionsClient containerAppPrivateEndpointConnections; /** - * Gets the NamespacesClient object to access its operations. + * Gets the ContainerAppPrivateEndpointConnectionsClient object to access its operations. * - * @return the NamespacesClient object. + * @return the ContainerAppPrivateEndpointConnectionsClient object. */ - public NamespacesClient getNamespaces() { - return this.namespaces; + public ContainerAppPrivateEndpointConnectionsClient getContainerAppPrivateEndpointConnections() { + return this.containerAppPrivateEndpointConnections; } /** - * The ManagedEnvironmentPrivateEndpointConnectionsClient object to access its operations. + * The ContainerAppPrivateLinkResourcesClient object to access its operations. */ - private final ManagedEnvironmentPrivateEndpointConnectionsClient managedEnvironmentPrivateEndpointConnections; + private final ContainerAppPrivateLinkResourcesClient containerAppPrivateLinkResources; /** - * Gets the ManagedEnvironmentPrivateEndpointConnectionsClient object to access its operations. + * Gets the ContainerAppPrivateLinkResourcesClient object to access its operations. * - * @return the ManagedEnvironmentPrivateEndpointConnectionsClient object. + * @return the ContainerAppPrivateLinkResourcesClient object. */ - public ManagedEnvironmentPrivateEndpointConnectionsClient getManagedEnvironmentPrivateEndpointConnections() { - return this.managedEnvironmentPrivateEndpointConnections; + public ContainerAppPrivateLinkResourcesClient getContainerAppPrivateLinkResources() { + return this.containerAppPrivateLinkResources; } /** @@ -495,17 +534,143 @@ public ManagedEnvironmentPrivateLinkResourcesClient getManagedEnvironmentPrivate } /** - * The DaprComponentsClient object to access its operations. + * The DaprComponentResiliencyPoliciesClient object to access its operations. */ - private final DaprComponentsClient daprComponents; + private final DaprComponentResiliencyPoliciesClient daprComponentResiliencyPolicies; /** - * Gets the DaprComponentsClient object to access its operations. + * Gets the DaprComponentResiliencyPoliciesClient object to access its operations. * - * @return the DaprComponentsClient object. + * @return the DaprComponentResiliencyPoliciesClient object. */ - public DaprComponentsClient getDaprComponents() { - return this.daprComponents; + public DaprComponentResiliencyPoliciesClient getDaprComponentResiliencyPolicies() { + return this.daprComponentResiliencyPolicies; + } + + /** + * The MaintenanceConfigurationsClient object to access its operations. + */ + private final MaintenanceConfigurationsClient maintenanceConfigurations; + + /** + * Gets the MaintenanceConfigurationsClient object to access its operations. + * + * @return the MaintenanceConfigurationsClient object. + */ + public MaintenanceConfigurationsClient getMaintenanceConfigurations() { + return this.maintenanceConfigurations; + } + + /** + * The ManagedEnvironmentsStoragesClient object to access its operations. + */ + private final ManagedEnvironmentsStoragesClient managedEnvironmentsStorages; + + /** + * Gets the ManagedEnvironmentsStoragesClient object to access its operations. + * + * @return the ManagedEnvironmentsStoragesClient object. + */ + public ManagedEnvironmentsStoragesClient getManagedEnvironmentsStorages() { + return this.managedEnvironmentsStorages; + } + + /** + * The JobsClient object to access its operations. + */ + private final JobsClient jobs; + + /** + * Gets the JobsClient object to access its operations. + * + * @return the JobsClient object. + */ + public JobsClient getJobs() { + return this.jobs; + } + + /** + * The ContainerAppsDiagnosticsClient object to access its operations. + */ + private final ContainerAppsDiagnosticsClient containerAppsDiagnostics; + + /** + * Gets the ContainerAppsDiagnosticsClient object to access its operations. + * + * @return the ContainerAppsDiagnosticsClient object. + */ + public ContainerAppsDiagnosticsClient getContainerAppsDiagnostics() { + return this.containerAppsDiagnostics; + } + + /** + * The ManagedEnvironmentsDiagnosticsClient object to access its operations. + */ + private final ManagedEnvironmentsDiagnosticsClient managedEnvironmentsDiagnostics; + + /** + * Gets the ManagedEnvironmentsDiagnosticsClient object to access its operations. + * + * @return the ManagedEnvironmentsDiagnosticsClient object. + */ + public ManagedEnvironmentsDiagnosticsClient getManagedEnvironmentsDiagnostics() { + return this.managedEnvironmentsDiagnostics; + } + + /** + * The ContainerAppsRevisionFunctionsClient object to access its operations. + */ + private final ContainerAppsRevisionFunctionsClient containerAppsRevisionFunctions; + + /** + * Gets the ContainerAppsRevisionFunctionsClient object to access its operations. + * + * @return the ContainerAppsRevisionFunctionsClient object. + */ + public ContainerAppsRevisionFunctionsClient getContainerAppsRevisionFunctions() { + return this.containerAppsRevisionFunctions; + } + + /** + * The ConnectedEnvironmentsCertificatesClient object to access its operations. + */ + private final ConnectedEnvironmentsCertificatesClient connectedEnvironmentsCertificates; + + /** + * Gets the ConnectedEnvironmentsCertificatesClient object to access its operations. + * + * @return the ConnectedEnvironmentsCertificatesClient object. + */ + public ConnectedEnvironmentsCertificatesClient getConnectedEnvironmentsCertificates() { + return this.connectedEnvironmentsCertificates; + } + + /** + * The NamespacesClient object to access its operations. + */ + private final NamespacesClient namespaces; + + /** + * Gets the NamespacesClient object to access its operations. + * + * @return the NamespacesClient object. + */ + 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; } /** @@ -523,59 +688,73 @@ public HttpRouteConfigsClient getHttpRouteConfigs() { } /** - * The MaintenanceConfigurationsClient object to access its operations. + * The JobsExecutionsClient object to access its operations. */ - private final MaintenanceConfigurationsClient maintenanceConfigurations; + private final JobsExecutionsClient jobsExecutions; /** - * Gets the MaintenanceConfigurationsClient object to access its operations. + * Gets the JobsExecutionsClient object to access its operations. * - * @return the MaintenanceConfigurationsClient object. + * @return the JobsExecutionsClient object. */ - public MaintenanceConfigurationsClient getMaintenanceConfigurations() { - return this.maintenanceConfigurations; + public JobsExecutionsClient getJobsExecutions() { + return this.jobsExecutions; } /** - * The ManagedEnvironmentsStoragesClient object to access its operations. + * The ManagedEnvironmentDiagnosticsClient object to access its operations. */ - private final ManagedEnvironmentsStoragesClient managedEnvironmentsStorages; + private final ManagedEnvironmentDiagnosticsClient managedEnvironmentDiagnostics; /** - * Gets the ManagedEnvironmentsStoragesClient object to access its operations. + * Gets the ManagedEnvironmentDiagnosticsClient object to access its operations. * - * @return the ManagedEnvironmentsStoragesClient object. + * @return the ManagedEnvironmentDiagnosticsClient object. */ - public ManagedEnvironmentsStoragesClient getManagedEnvironmentsStorages() { - return this.managedEnvironmentsStorages; + public ManagedEnvironmentDiagnosticsClient getManagedEnvironmentDiagnostics() { + return this.managedEnvironmentDiagnostics; } /** - * The ContainerAppsSessionPoolsClient object to access its operations. + * The AvailableWorkloadProfilesClient object to access its operations. */ - private final ContainerAppsSessionPoolsClient containerAppsSessionPools; + private final AvailableWorkloadProfilesClient availableWorkloadProfiles; /** - * Gets the ContainerAppsSessionPoolsClient object to access its operations. + * Gets the AvailableWorkloadProfilesClient object to access its operations. * - * @return the ContainerAppsSessionPoolsClient object. + * @return the AvailableWorkloadProfilesClient object. */ - public ContainerAppsSessionPoolsClient getContainerAppsSessionPools() { - return this.containerAppsSessionPools; + public AvailableWorkloadProfilesClient getAvailableWorkloadProfiles() { + return this.availableWorkloadProfiles; } /** - * The ContainerAppsSourceControlsClient object to access its operations. + * The AvailableEnvironmentModesClient object to access its operations. */ - private final ContainerAppsSourceControlsClient containerAppsSourceControls; + private final AvailableEnvironmentModesClient availableEnvironmentModes; /** - * Gets the ContainerAppsSourceControlsClient object to access its operations. + * Gets the AvailableEnvironmentModesClient object to access its operations. * - * @return the ContainerAppsSourceControlsClient object. + * @return the AvailableEnvironmentModesClient object. */ - public ContainerAppsSourceControlsClient getContainerAppsSourceControls() { - return this.containerAppsSourceControls; + public AvailableEnvironmentModesClient getAvailableEnvironmentModes() { + return this.availableEnvironmentModes; + } + + /** + * The BillingMetersClient object to access its operations. + */ + private final BillingMetersClient billingMeters; + + /** + * Gets the BillingMetersClient object to access its operations. + * + * @return the BillingMetersClient object. + */ + public BillingMetersClient getBillingMeters() { + return this.billingMeters; } /** @@ -606,20 +785,6 @@ public ManagedEnvironmentUsagesClient getManagedEnvironmentUsages() { return this.managedEnvironmentUsages; } - /** - * 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; - } - /** * Initializes an instance of ContainerAppsApiClient client. * @@ -627,51 +792,62 @@ public LogicAppsClient getLogicApps() { * @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 endpoint server parameter. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ ContainerAppsApiClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2025-07-01"; - this.containerAppsAuthConfigs = new ContainerAppsAuthConfigsClientImpl(this); - this.availableWorkloadProfiles = new AvailableWorkloadProfilesClientImpl(this); - this.billingMeters = new BillingMetersClientImpl(this); - this.connectedEnvironments = new ConnectedEnvironmentsClientImpl(this); - this.connectedEnvironmentsCertificates = new ConnectedEnvironmentsCertificatesClientImpl(this); - this.connectedEnvironmentsDaprComponents = new ConnectedEnvironmentsDaprComponentsClientImpl(this); - this.connectedEnvironmentsStorages = new ConnectedEnvironmentsStoragesClientImpl(this); + this.subscriptionId = subscriptionId; + this.apiVersion = "2026-07-01"; + this.resourceProviders = new ResourceProvidersClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.containerAppsSessionPools = new ContainerAppsSessionPoolsClientImpl(this); + this.sandboxGroups = new SandboxGroupsClientImpl(this); + this.vnetConnections = new VnetConnectionsClientImpl(this); + this.containerAppsSourceControls = new ContainerAppsSourceControlsClientImpl(this); this.containerApps = new ContainerAppsClientImpl(this); + this.containerAppsFunctions = new ContainerAppsFunctionsClientImpl(this); this.containerAppsRevisions = new ContainerAppsRevisionsClientImpl(this); + this.functionsExtensions = new FunctionsExtensionsClientImpl(this); + this.containerAppsLabelHistories = new ContainerAppsLabelHistoriesClientImpl(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.operations = new OperationsClientImpl(this); + this.dotNetComponents = new DotNetComponentsClientImpl(this); this.javaComponents = new JavaComponentsClientImpl(this); - this.jobsExecutions = new JobsExecutionsClientImpl(this); - this.resourceProviders = new ResourceProvidersClientImpl(this); - this.managedEnvironments = new ManagedEnvironmentsClientImpl(this); + this.logicApps = new LogicAppsClientImpl(this); + this.containerAppsAuthConfigs = new ContainerAppsAuthConfigsClientImpl(this); + this.connectedEnvironments = new ConnectedEnvironmentsClientImpl(this); this.certificates = new CertificatesClientImpl(this); + this.managedEnvironments = new ManagedEnvironmentsClientImpl(this); + this.connectedEnvironmentsDaprComponents = new ConnectedEnvironmentsDaprComponentsClientImpl(this); + this.daprComponents = new DaprComponentsClientImpl(this); + this.connectedEnvironmentsStorages = new ConnectedEnvironmentsStoragesClientImpl(this); this.managedCertificates = new ManagedCertificatesClientImpl(this); + this.containerAppPrivateEndpointConnections = new ContainerAppPrivateEndpointConnectionsClientImpl(this); + this.containerAppPrivateLinkResources = new ContainerAppPrivateLinkResourcesClientImpl(this); + this.managedEnvironmentPrivateLinkResources = new ManagedEnvironmentPrivateLinkResourcesClientImpl(this); + this.daprComponentResiliencyPolicies = new DaprComponentResiliencyPoliciesClientImpl(this); + this.maintenanceConfigurations = new MaintenanceConfigurationsClientImpl(this); + this.managedEnvironmentsStorages = new ManagedEnvironmentsStoragesClientImpl(this); + this.jobs = new JobsClientImpl(this); + this.containerAppsDiagnostics = new ContainerAppsDiagnosticsClientImpl(this); + this.managedEnvironmentsDiagnostics = new ManagedEnvironmentsDiagnosticsClientImpl(this); + this.containerAppsRevisionFunctions = new ContainerAppsRevisionFunctionsClientImpl(this); + this.connectedEnvironmentsCertificates = new ConnectedEnvironmentsCertificatesClientImpl(this); this.namespaces = new NamespacesClientImpl(this); this.managedEnvironmentPrivateEndpointConnections = new ManagedEnvironmentPrivateEndpointConnectionsClientImpl(this); - this.managedEnvironmentPrivateLinkResources = new ManagedEnvironmentPrivateLinkResourcesClientImpl(this); - this.daprComponents = new DaprComponentsClientImpl(this); this.httpRouteConfigs = new HttpRouteConfigsClientImpl(this); - this.maintenanceConfigurations = new MaintenanceConfigurationsClientImpl(this); - this.managedEnvironmentsStorages = new ManagedEnvironmentsStoragesClientImpl(this); - this.containerAppsSessionPools = new ContainerAppsSessionPoolsClientImpl(this); - this.containerAppsSourceControls = new ContainerAppsSourceControlsClientImpl(this); + this.jobsExecutions = new JobsExecutionsClientImpl(this); + this.managedEnvironmentDiagnostics = new ManagedEnvironmentDiagnosticsClientImpl(this); + this.availableWorkloadProfiles = new AvailableWorkloadProfilesClientImpl(this); + this.availableEnvironmentModes = new AvailableEnvironmentModesClientImpl(this); + this.billingMeters = new BillingMetersClientImpl(this); this.usages = new UsagesClientImpl(this); this.managedEnvironmentUsages = new ManagedEnvironmentUsagesClientImpl(this); - this.logicApps = new LogicAppsClientImpl(this); } /** @@ -785,7 +961,7 @@ private static final class HttpResponseImpl extends HttpResponse { super(null); this.statusCode = statusCode; this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + this.responseBody = responseBody == null ? new byte[0] : responseBody.getBytes(StandardCharsets.UTF_8); } public int getStatusCode() { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsAuthConfigsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsAuthConfigsClientImpl.java index 47cfa64c04bc..54d32af72eba 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsAuthConfigsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsAuthConfigsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -27,10 +27,9 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsAuthConfigsClient; import com.azure.resourcemanager.appcontainers.fluent.models.AuthConfigInner; -import com.azure.resourcemanager.appcontainers.models.AuthConfigCollection; +import com.azure.resourcemanager.appcontainers.implementation.models.AuthConfigCollection; import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; import reactor.core.publisher.Mono; @@ -63,99 +62,95 @@ public final class ContainerAppsAuthConfigsClientImpl implements ContainerAppsAu * The interface defining all the services for ContainerAppsApiClientContainerAppsAuthConfigs to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientContainerAppsAuthConfigs") public interface ContainerAppsAuthConfigsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listByContainerApp(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion, + @PathParam("containerAppName") String containerAppName, @PathParam("authConfigName") String authConfigName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listByContainerAppSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion, + @PathParam("containerAppName") String containerAppName, @PathParam("authConfigName") String authConfigName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, @PathParam("authConfigName") String authConfigName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AuthConfigInner authConfigEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, @PathParam("authConfigName") String authConfigName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AuthConfigInner authConfigEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}") - @ExpectedResponses({ 200 }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, @PathParam("authConfigName") String authConfigName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AuthConfigInner authConfigEnvelope, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}") - @ExpectedResponses({ 200 }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, @PathParam("authConfigName") String authConfigName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AuthConfigInner authConfigEnvelope, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}") - @ExpectedResponses({ 200, 204 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listByContainerApp(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @PathParam("authConfigName") String authConfigName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("containerAppName") String containerAppName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}") - @ExpectedResponses({ 200, 204 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listByContainerAppSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @PathParam("authConfigName") String authConfigName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("containerAppName") String containerAppName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> listByContainerAppNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -163,179 +158,10 @@ Mono> listByContainerAppNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Response listByContainerAppNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } - /** - * Get the Container App AuthConfigs in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName 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 the Container App AuthConfigs in a given resource group along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByContainerAppSinglePageAsync(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.listByContainerApp(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, 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 Container App AuthConfigs in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName 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 the Container App AuthConfigs in a given resource group as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByContainerAppAsync(String resourceGroupName, String containerAppName) { - return new PagedFlux<>(() -> listByContainerAppSinglePageAsync(resourceGroupName, containerAppName), - nextLink -> listByContainerAppNextSinglePageAsync(nextLink)); - } - - /** - * Get the Container App AuthConfigs in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName 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 the Container App AuthConfigs in a given resource group along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByContainerAppSinglePage(String resourceGroupName, - String containerAppName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listByContainerAppSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, this.client.getApiVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the Container App AuthConfigs in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName 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 the Container App AuthConfigs in a given resource group along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByContainerAppSinglePage(String resourceGroupName, - String containerAppName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listByContainerAppSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, this.client.getApiVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the Container App AuthConfigs in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName 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 the Container App AuthConfigs in a given resource group as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName) { - return new PagedIterable<>(() -> listByContainerAppSinglePage(resourceGroupName, containerAppName), - nextLink -> listByContainerAppNextSinglePage(nextLink)); - } - - /** - * Get the Container App AuthConfigs in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName 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 the Container App AuthConfigs in a given resource group as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, - Context context) { - return new PagedIterable<>(() -> listByContainerAppSinglePage(resourceGroupName, containerAppName, context), - nextLink -> listByContainerAppNextSinglePage(nextLink, context)); - } - /** * Get a AuthConfig of a Container App. * @@ -350,29 +176,10 @@ public PagedIterable listByContainerApp(String resourceGroupNam @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String containerAppName, String authConfigName) { - 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 (authConfigName == null) { - return Mono.error(new IllegalArgumentException("Parameter authConfigName 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, authConfigName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, authConfigName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -408,31 +215,9 @@ private Mono getAsync(String resourceGroupName, String containe @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String containerAppName, String authConfigName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (authConfigName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter authConfigName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, authConfigName, this.client.getApiVersion(), accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, authConfigName, accept, context); } /** @@ -467,36 +252,12 @@ public AuthConfigInner get(String resourceGroupName, String containerAppName, St @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String containerAppName, String authConfigName, AuthConfigInner authConfigEnvelope) { - 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 (authConfigName == null) { - return Mono.error(new IllegalArgumentException("Parameter authConfigName is required and cannot be null.")); - } - if (authConfigEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter authConfigEnvelope is required and cannot be null.")); - } else { - authConfigEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, authConfigName, this.client.getApiVersion(), authConfigEnvelope, - accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, authConfigName, contentType, + accept, authConfigEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -537,37 +298,11 @@ private Mono createOrUpdateAsync(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String containerAppName, String authConfigName, AuthConfigInner authConfigEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (authConfigName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter authConfigName is required and cannot be null.")); - } - if (authConfigEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter authConfigEnvelope is required and cannot be null.")); - } else { - authConfigEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, authConfigName, this.client.getApiVersion(), authConfigEnvelope, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, authConfigName, contentType, accept, + authConfigEnvelope, context); } /** @@ -603,29 +338,9 @@ public AuthConfigInner createOrUpdate(String resourceGroupName, String container @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String containerAppName, String authConfigName) { - 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 (authConfigName == null) { - return Mono.error(new IllegalArgumentException("Parameter authConfigName 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, authConfigName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, authConfigName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -661,31 +376,8 @@ private Mono deleteAsync(String resourceGroupName, String containerAppName @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String containerAppName, String authConfigName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (authConfigName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter authConfigName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, authConfigName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, authConfigName, context); } /** @@ -703,6 +395,122 @@ public void delete(String resourceGroupName, String containerAppName, String aut deleteWithResponse(resourceGroupName, containerAppName, authConfigName, Context.NONE); } + /** + * Get the Container App AuthConfigs in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the Container App AuthConfigs in a given resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByContainerAppSinglePageAsync(String resourceGroupName, + String containerAppName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByContainerApp(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())); + } + + /** + * Get the Container App AuthConfigs in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the Container App AuthConfigs in a given resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByContainerAppAsync(String resourceGroupName, String containerAppName) { + return new PagedFlux<>(() -> listByContainerAppSinglePageAsync(resourceGroupName, containerAppName), + nextLink -> listByContainerAppNextSinglePageAsync(nextLink)); + } + + /** + * Get the Container App AuthConfigs in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the Container App AuthConfigs in a given resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByContainerAppSinglePage(String resourceGroupName, + String containerAppName) { + final String accept = "application/json"; + Response res + = service.listByContainerAppSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the Container App AuthConfigs in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the Container App AuthConfigs in a given resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByContainerAppSinglePage(String resourceGroupName, + String containerAppName, Context context) { + final String accept = "application/json"; + Response res + = service.listByContainerAppSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the Container App AuthConfigs in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the Container App AuthConfigs in a given resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName) { + return new PagedIterable<>(() -> listByContainerAppSinglePage(resourceGroupName, containerAppName), + nextLink -> listByContainerAppNextSinglePage(nextLink)); + } + + /** + * Get the Container App AuthConfigs in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the Container App AuthConfigs in a given resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, + Context context) { + return new PagedIterable<>(() -> listByContainerAppSinglePage(resourceGroupName, containerAppName, context), + nextLink -> listByContainerAppNextSinglePage(nextLink, context)); + } + /** * Get the Container App AuthConfigs in a given resource group. * @@ -717,13 +525,6 @@ public void delete(String resourceGroupName, String containerAppName, String aut */ @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( @@ -746,15 +547,6 @@ private Mono> listByContainerAppNextSinglePageAsy */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByContainerAppNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listByContainerAppNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -776,21 +568,10 @@ private PagedResponse listByContainerAppNextSinglePage(String n */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByContainerAppNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listByContainerAppNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(ContainerAppsAuthConfigsClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsAuthConfigsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsAuthConfigsImpl.java index f3d9f8b6c14a..e85c422f42f3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsAuthConfigsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsAuthConfigsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -27,29 +27,12 @@ public ContainerAppsAuthConfigsImpl(ContainerAppsAuthConfigsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName) { - PagedIterable inner - = this.serviceClient().listByContainerApp(resourceGroupName, containerAppName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AuthConfigImpl(inner1, this.manager())); - } - - public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, - Context context) { - PagedIterable inner - = this.serviceClient().listByContainerApp(resourceGroupName, containerAppName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AuthConfigImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String containerAppName, String authConfigName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, containerAppName, authConfigName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AuthConfigImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AuthConfigImpl(inner.getValue(), this.manager())); } public AuthConfig get(String resourceGroupName, String containerAppName, String authConfigName) { @@ -70,6 +53,19 @@ public void delete(String resourceGroupName, String containerAppName, String aut this.serviceClient().delete(resourceGroupName, containerAppName, authConfigName); } + public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName) { + PagedIterable inner + = this.serviceClient().listByContainerApp(resourceGroupName, containerAppName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AuthConfigImpl(inner1, this.manager())); + } + + public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, + Context context) { + PagedIterable inner + = this.serviceClient().listByContainerApp(resourceGroupName, containerAppName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AuthConfigImpl(inner1, this.manager())); + } + public AuthConfig 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/ContainerAppsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsClientImpl.java index 2baaae487949..1246467f2ab1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -32,7 +32,6 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsClient; @@ -40,7 +39,7 @@ import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppInner; import com.azure.resourcemanager.appcontainers.fluent.models.CustomHostnameAnalysisResultInner; import com.azure.resourcemanager.appcontainers.fluent.models.SecretsCollectionInner; -import com.azure.resourcemanager.appcontainers.models.ContainerAppCollection; +import com.azure.resourcemanager.appcontainers.implementation.models.ContainerAppCollection; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -74,156 +73,152 @@ public final class ContainerAppsClientImpl implements ContainerAppsClient { * The interface defining all the services for ContainerAppsApiClientContainerApps to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientContainerApps") public interface ContainerAppsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/containerApps") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.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}/providers/Microsoft.App/containerApps") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@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/containerApps") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.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/containerApps") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listByResourceGroupSync(@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/containerApps/{containerAppName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 404 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("containerAppName") String containerAppName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 404 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getByResourceGroupSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("containerAppName") String containerAppName, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ContainerAppInner containerAppEnvelope, @HeaderParam("Accept") String accept, + @PathParam("containerAppName") String containerAppName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ContainerAppInner containerAppEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ContainerAppInner containerAppEnvelope, @HeaderParam("Accept") String accept, + @PathParam("containerAppName") String containerAppName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ContainerAppInner containerAppEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ContainerAppInner containerAppEnvelope, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ContainerAppInner containerAppEnvelope, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("containerAppName") String containerAppName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("containerAppName") String containerAppName, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}") - @ExpectedResponses({ 200, 202 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ContainerAppInner containerAppEnvelope, @HeaderParam("Accept") String accept, + Mono> listByResourceGroup(@HostParam("endpoint") 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" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}") - @ExpectedResponses({ 200, 202 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ContainerAppInner containerAppEnvelope, @HeaderParam("Accept") String accept, + Response listByResourceGroupSync(@HostParam("endpoint") 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}/providers/Microsoft.App/containerApps") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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}/providers/Microsoft.App/containerApps") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/listCustomHostNameAnalysis") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listCustomHostnameAnalysis( - @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, @QueryParam("customHostname") String customHostname, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/listCustomHostNameAnalysis") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listCustomHostnameAnalysisSync(@HostParam("$host") String endpoint, + Response listCustomHostnameAnalysisSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, @QueryParam("customHostname") String customHostname, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/listSecrets") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSecrets(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Mono> listSecrets(@HostParam("endpoint") 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); @@ -231,9 +226,9 @@ Mono> listSecrets(@HostParam("$host") String en @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/listSecrets") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSecretsSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Response listSecretsSync(@HostParam("endpoint") 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); @@ -242,9 +237,9 @@ Response listSecretsSync(@HostParam("$host") String endp @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 404 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAuthToken(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Mono> getAuthToken(@HostParam("endpoint") 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); @@ -253,9 +248,9 @@ Mono> getAuthToken(@HostParam("$host") Stri @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 404 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getAuthTokenSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Response getAuthTokenSync(@HostParam("endpoint") 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); @@ -263,9 +258,9 @@ Response getAuthTokenSync(@HostParam("$host") String @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/start") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Mono>> start(@HostParam("endpoint") 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); @@ -273,9 +268,9 @@ Mono>> start(@HostParam("$host") String endpoint, @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/start") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response startSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Response startSync(@HostParam("endpoint") 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); @@ -283,9 +278,9 @@ Response startSync(@HostParam("$host") String endpoint, @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/stop") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stop(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Mono>> stop(@HostParam("endpoint") 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); @@ -293,9 +288,9 @@ Mono>> stop(@HostParam("$host") String endpoint, @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/stop") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response stopSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Response stopSync(@HostParam("endpoint") 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); @@ -303,502 +298,345 @@ Response stopSync(@HostParam("$host") String endpoint, @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listBySubscriptionNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") 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, + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listByResourceGroupNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Get the Container Apps in a given subscription. + * Get the properties of a Container App. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Container Apps in a given subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the properties of a Container App along with {@link Response} 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.")); - } + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String containerAppName) { 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)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the Container Apps in a given subscription. - * - * @throws 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 Container Apps 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 Container Apps in a given subscription. + * Get the properties of a Container App. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Container Apps in a given subscription along with {@link PagedResponse}. + * @return the properties of a Container App on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage() { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + private Mono getByResourceGroupAsync(String resourceGroupName, String containerAppName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, containerAppName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get the Container Apps in a given subscription. + * Get the properties of a Container App. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. * @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 ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Container Apps in a given subscription along with {@link PagedResponse}. + * @return the properties of a Container App along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + public Response getByResourceGroupWithResponse(String resourceGroupName, String containerAppName, + Context context) { final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the Container Apps in a given subscription. - * - * @throws 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 Container Apps in a given subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, accept, context); } /** - * Get the Container Apps in a given subscription. + * Get the properties of a Container App. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Container Apps in a given subscription as paginated response with {@link PagedIterable}. + * @return the properties of a Container App. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(() -> listSinglePage(context), - nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAppInner getByResourceGroup(String resourceGroupName, String containerAppName) { + return getByResourceGroupWithResponse(resourceGroupName, containerAppName, Context.NONE).getValue(); } /** - * Get the Container Apps in a given resource group. + * Create or update a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Container Apps in a given resource group along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return container App along with {@link Response} 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.")); - } + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String containerAppName, ContainerAppInner containerAppEnvelope) { + final String contentType = "application/json"; 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)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, contentType, accept, + containerAppEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the Container Apps in a given 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 Container Apps in a given resource group 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 Container Apps in a given resource group. + * Create or update a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Container Apps in a given resource group along with {@link PagedResponse}. + * @return container App along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String containerAppName, + ContainerAppInner containerAppEnvelope) { + final String contentType = "application/json"; final String accept = "application/json"; - Response res = service.listByResourceGroupSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, contentType, accept, + containerAppEnvelope, Context.NONE); } /** - * Get the Container Apps in a given resource group. + * Create or update a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. * @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 Container Apps in a given resource group along with {@link PagedResponse}. + * @return container App along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String containerAppName, + ContainerAppInner containerAppEnvelope, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - Response res = service.listByResourceGroupSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, contentType, accept, + containerAppEnvelope, context); } /** - * Get the Container Apps in a given resource group. + * Create or update a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Container Apps in a given resource group as paginated response with {@link PagedIterable}. + * @return the {@link PollerFlux} for polling of container App. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePage(nextLink)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerAppInner> beginCreateOrUpdateAsync( + String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, containerAppName, containerAppEnvelope); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ContainerAppInner.class, ContainerAppInner.class, this.client.getContext()); } /** - * Get the Container Apps in a given resource group. + * Create or update a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. + * @param containerAppName Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Container Apps in a given resource group as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of container App. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerAppInner> beginCreateOrUpdate(String resourceGroupName, + String containerAppName, ContainerAppInner containerAppEnvelope) { + Response response + = createOrUpdateWithResponse(resourceGroupName, containerAppName, containerAppEnvelope); + return this.client.getLroResult(response, ContainerAppInner.class, + ContainerAppInner.class, Context.NONE); } /** - * Get the properties of a Container App. + * Create or update a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. + * @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 ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a Container App along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of container App. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(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.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerAppInner> beginCreateOrUpdate(String resourceGroupName, + String containerAppName, ContainerAppInner containerAppEnvelope, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, containerAppName, containerAppEnvelope, context); + return this.client.getLroResult(response, ContainerAppInner.class, + ContainerAppInner.class, context); } /** - * Get the properties of a Container App. + * Create or update a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. - * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a Container App on successful completion of {@link Mono}. + * @return container App on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String containerAppName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, containerAppName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono createOrUpdateAsync(String resourceGroupName, String containerAppName, + ContainerAppInner containerAppEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Get the properties of a Container App. + * Create or update a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param context The context to associate with this operation. + * @param containerAppEnvelope Properties used to create a container app. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. - * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a Container App along with {@link Response}. + * @return container App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String containerAppName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, this.client.getApiVersion(), accept, context); + public ContainerAppInner createOrUpdate(String resourceGroupName, String containerAppName, + ContainerAppInner containerAppEnvelope) { + return beginCreateOrUpdate(resourceGroupName, containerAppName, containerAppEnvelope).getFinalResult(); } /** - * Get the properties of a Container App. + * Create or update a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. + * @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 ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a Container App. + * @return container App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ContainerAppInner getByResourceGroup(String resourceGroupName, String containerAppName) { - return getByResourceGroupWithResponse(resourceGroupName, containerAppName, Context.NONE).getValue(); + public ContainerAppInner createOrUpdate(String resourceGroupName, String containerAppName, + ContainerAppInner containerAppEnvelope, Context context) { + return beginCreateOrUpdate(resourceGroupName, containerAppName, containerAppEnvelope, context).getFinalResult(); } /** - * Create or update a Container App. + * Update properties of a Container App + * + * Patches a Container App using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties used to create a container app. + * @param containerAppEnvelope Properties of a Container App that need 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 container App along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String containerAppName, ContainerAppInner containerAppEnvelope) { - 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 (containerAppEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter containerAppEnvelope is required and cannot be null.")); - } else { - containerAppEnvelope.validate(); - } + private Mono>> updateWithResponseAsync(String resourceGroupName, String containerAppName, + ContainerAppInner containerAppEnvelope) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, this.client.getApiVersion(), containerAppEnvelope, accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, contentType, accept, + containerAppEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update a Container App. + * Update properties of a Container App + * + * Patches a Container App using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties used to create a container app. + * @param containerAppEnvelope Properties of a Container App that need 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 container App along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String containerAppName, + private Response updateWithResponse(String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (containerAppEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppEnvelope is required and cannot be null.")); - } else { - containerAppEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, this.client.getApiVersion(), containerAppEnvelope, accept, Context.NONE); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, contentType, accept, + containerAppEnvelope, Context.NONE); } /** - * Create or update a Container App. + * Update properties of a Container App + * + * Patches a Container App using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties used to create a container app. + * @param containerAppEnvelope Properties of a Container App that need 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. @@ -806,83 +644,66 @@ private Response createOrUpdateWithResponse(String resourceGroupName * @return container App along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String containerAppName, + private Response updateWithResponse(String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (containerAppEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppEnvelope is required and cannot be null.")); - } else { - containerAppEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, this.client.getApiVersion(), containerAppEnvelope, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, contentType, accept, + containerAppEnvelope, context); } /** - * Create or update a Container App. + * Update properties of a Container App + * + * Patches a Container App using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties used to create a container app. + * @param containerAppEnvelope Properties of a Container App that need 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 container App. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ContainerAppInner> beginCreateOrUpdateAsync( - String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope) { + private PollerFlux, ContainerAppInner> beginUpdateAsync(String resourceGroupName, + String containerAppName, ContainerAppInner containerAppEnvelope) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, containerAppName, containerAppEnvelope); + = updateWithResponseAsync(resourceGroupName, containerAppName, containerAppEnvelope); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ContainerAppInner.class, ContainerAppInner.class, this.client.getContext()); } /** - * Create or update a Container App. + * Update properties of a Container App + * + * Patches a Container App using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties used to create a container app. + * @param containerAppEnvelope Properties of a Container App that need 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 container App. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ContainerAppInner> beginCreateOrUpdate(String resourceGroupName, + public SyncPoller, ContainerAppInner> beginUpdate(String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope) { - Response response - = createOrUpdateWithResponse(resourceGroupName, containerAppName, containerAppEnvelope); + Response response = updateWithResponse(resourceGroupName, containerAppName, containerAppEnvelope); return this.client.getLroResult(response, ContainerAppInner.class, ContainerAppInner.class, Context.NONE); } /** - * Create or update a Container App. + * Update properties of a Container App + * + * Patches a Container App using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties used to create a container app. + * @param containerAppEnvelope Properties of a Container App that need 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. @@ -890,55 +711,61 @@ public SyncPoller, ContainerAppInner> beginCreateO * @return the {@link SyncPoller} for polling of container App. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ContainerAppInner> beginCreateOrUpdate(String resourceGroupName, + public SyncPoller, ContainerAppInner> beginUpdate(String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope, Context context) { Response response - = createOrUpdateWithResponse(resourceGroupName, containerAppName, containerAppEnvelope, context); + = updateWithResponse(resourceGroupName, containerAppName, containerAppEnvelope, context); return this.client.getLroResult(response, ContainerAppInner.class, ContainerAppInner.class, context); } /** - * Create or update a Container App. + * Update properties of a Container App + * + * Patches a Container App using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties used to create a container app. + * @param containerAppEnvelope Properties of a Container App that need 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 container App on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String containerAppName, + private Mono updateAsync(String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope) { - return beginCreateOrUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope).last() + return beginUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update a Container App. + * Update properties of a Container App + * + * Patches a Container App using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties used to create a container app. + * @param containerAppEnvelope Properties of a Container App that need 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 container App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ContainerAppInner createOrUpdate(String resourceGroupName, String containerAppName, + public ContainerAppInner update(String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope) { - return beginCreateOrUpdate(resourceGroupName, containerAppName, containerAppEnvelope).getFinalResult(); + return beginUpdate(resourceGroupName, containerAppName, containerAppEnvelope).getFinalResult(); } /** - * Create or update a Container App. + * Update properties of a Container App + * + * Patches a Container App using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties used to create a container app. + * @param containerAppEnvelope Properties of a Container App that need 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. @@ -946,9 +773,9 @@ public ContainerAppInner createOrUpdate(String resourceGroupName, String contain * @return container App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ContainerAppInner createOrUpdate(String resourceGroupName, String containerAppName, + public ContainerAppInner update(String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope, Context context) { - return beginCreateOrUpdate(resourceGroupName, containerAppName, containerAppEnvelope, context).getFinalResult(); + return beginUpdate(resourceGroupName, containerAppName, containerAppEnvelope, context).getFinalResult(); } /** @@ -964,26 +791,9 @@ public ContainerAppInner createOrUpdate(String resourceGroupName, String contain @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(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.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -999,27 +809,8 @@ private Mono>> deleteWithResponseAsync(String resource */ @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String containerAppName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, this.client.getApiVersion(), accept, Context.NONE); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, Context.NONE); } /** @@ -1036,27 +827,8 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String containerAppName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, context); } /** @@ -1156,265 +928,200 @@ public void delete(String resourceGroupName, String containerAppName, Context co } /** - * Update properties of a Container App - * - * Patches a Container App using JSON Merge Patch. + * Get the Container Apps in a given resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties of a Container App that need 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 container App along with {@link Response} on successful completion of {@link Mono}. + * @return the Container Apps in a given resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String containerAppName, - ContainerAppInner containerAppEnvelope) { - 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 (containerAppEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter containerAppEnvelope is required and cannot be null.")); - } else { - containerAppEnvelope.validate(); - } + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, this.client.getApiVersion(), containerAppEnvelope, accept, context)) + .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())); } /** - * Update properties of a Container App + * Get the Container Apps in a given resource group. * - * Patches a Container App using JSON Merge Patch. + * @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 Container Apps in a given resource group 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 Container Apps in a given resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties of a Container App that need 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 container App along with {@link Response}. + * @return the Container Apps in a given resource group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String containerAppName, - ContainerAppInner containerAppEnvelope) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (containerAppEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppEnvelope is required and cannot be null.")); - } else { - containerAppEnvelope.validate(); - } + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, this.client.getApiVersion(), containerAppEnvelope, accept, Context.NONE); + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Update properties of a Container App - * - * Patches a Container App using JSON Merge Patch. + * Get the Container Apps in a given resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties of a Container App that need 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 container App along with {@link Response}. + * @return the Container Apps in a given resource group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String containerAppName, - ContainerAppInner containerAppEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (containerAppEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppEnvelope is required and cannot be null.")); - } else { - containerAppEnvelope.validate(); - } + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, this.client.getApiVersion(), containerAppEnvelope, accept, context); + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Update properties of a Container App - * - * Patches a Container App using JSON Merge Patch. + * Get the Container Apps in a given resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties of a Container App that need 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 container App. + * @return the Container Apps in a given resource group as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ContainerAppInner> beginUpdateAsync(String resourceGroupName, - String containerAppName, ContainerAppInner containerAppEnvelope) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, containerAppName, containerAppEnvelope); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ContainerAppInner.class, ContainerAppInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** - * Update properties of a Container App - * - * Patches a Container App using JSON Merge Patch. + * Get the Container Apps in a given resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties of a Container App that need 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 container App. + * @return the Container Apps in a given resource group as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ContainerAppInner> beginUpdate(String resourceGroupName, - String containerAppName, ContainerAppInner containerAppEnvelope) { - Response response = updateWithResponse(resourceGroupName, containerAppName, containerAppEnvelope); - return this.client.getLroResult(response, ContainerAppInner.class, - ContainerAppInner.class, Context.NONE); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** - * Update properties of a Container App - * - * Patches a Container App using JSON Merge Patch. + * Get the Container Apps in a given subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties of a Container App that need 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 container App. + * @return the Container Apps in a given subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ContainerAppInner> beginUpdate(String resourceGroupName, - String containerAppName, ContainerAppInner containerAppEnvelope, Context context) { - Response response - = updateWithResponse(resourceGroupName, containerAppName, containerAppEnvelope, context); - return this.client.getLroResult(response, ContainerAppInner.class, - ContainerAppInner.class, context); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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())); } /** - * Update properties of a Container App + * Get the Container Apps in a given subscription. * - * Patches a Container App using JSON Merge Patch. + * @throws 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 Container Apps 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 Container Apps in a given subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties of a Container App that need 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 container App on successful completion of {@link Mono}. + * @return the Container Apps in a given subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String containerAppName, - ContainerAppInner containerAppEnvelope) { - return beginUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope).last() - .flatMap(this.client::getLroFinalResultOrError); + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Update properties of a Container App - * - * Patches a Container App using JSON Merge Patch. + * Get the Container Apps in a given subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties of a Container App that need 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 container App. + * @return the Container Apps in a given subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ContainerAppInner update(String resourceGroupName, String containerAppName, - ContainerAppInner containerAppEnvelope) { - return beginUpdate(resourceGroupName, containerAppName, containerAppEnvelope).getFinalResult(); + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Update properties of a Container App + * Get the Container Apps in a given subscription. * - * Patches a Container App using JSON Merge Patch. + * @throws 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 Container Apps in a given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * Get the Container Apps in a given subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties of a Container App that need 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 container App. + * @return the Container Apps in a given subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ContainerAppInner update(String resourceGroupName, String containerAppName, - ContainerAppInner containerAppEnvelope, Context context) { - return beginUpdate(resourceGroupName, containerAppName, containerAppEnvelope, context).getFinalResult(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); } /** @@ -1431,27 +1138,11 @@ public ContainerAppInner update(String resourceGroupName, String containerAppNam @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listCustomHostnameAnalysisWithResponseAsync( String resourceGroupName, String containerAppName, String customHostname) { - 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.listCustomHostnameAnalysis(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, containerAppName, customHostname, - this.client.getApiVersion(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, containerAppName, + customHostname, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1488,27 +1179,9 @@ private Mono listCustomHostnameAnalysisAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Response listCustomHostnameAnalysisWithResponse(String resourceGroupName, String containerAppName, String customHostname, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } final String accept = "application/json"; - return service.listCustomHostnameAnalysisSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, customHostname, this.client.getApiVersion(), accept, context); + return service.listCustomHostnameAnalysisSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, customHostname, accept, context); } /** @@ -1543,26 +1216,10 @@ public CustomHostnameAnalysisResultInner listCustomHostnameAnalysis(String resou @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSecretsWithResponseAsync(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.listSecrets(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), containerAppName, accept, context)) + .withContext(context -> service.listSecrets(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1596,27 +1253,9 @@ private Mono listSecretsAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response listSecretsWithResponse(String resourceGroupName, String containerAppName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } final String accept = "application/json"; - return service.listSecretsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), containerAppName, accept, context); + return service.listSecretsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, accept, context); } /** @@ -1648,26 +1287,10 @@ public SecretsCollectionInner listSecrets(String resourceGroupName, String conta @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getAuthTokenWithResponseAsync(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.getAuthToken(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), containerAppName, accept, context)) + .withContext(context -> service.getAuthToken(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1703,27 +1326,9 @@ private Mono getAuthTokenAsync(String resourceGroupN @ServiceMethod(returns = ReturnType.SINGLE) public Response getAuthTokenWithResponse(String resourceGroupName, String containerAppName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getAuthTokenSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), containerAppName, accept, context); + return service.getAuthTokenSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, accept, context); } /** @@ -1754,26 +1359,10 @@ public ContainerAppAuthTokenInner getAuthToken(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> startWithResponseAsync(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.start(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), containerAppName, accept, context)) + .withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1789,27 +1378,9 @@ private Mono>> startWithResponseAsync(String resourceG */ @ServiceMethod(returns = ReturnType.SINGLE) private Response startWithResponse(String resourceGroupName, String containerAppName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } final String accept = "application/json"; - return service.startSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), containerAppName, accept, Context.NONE); + return service.startSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, accept, Context.NONE); } /** @@ -1825,27 +1396,9 @@ private Response startWithResponse(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) private Response startWithResponse(String resourceGroupName, String containerAppName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } final String accept = "application/json"; - return service.startSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), containerAppName, accept, context); + return service.startSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, accept, context); } /** @@ -1962,26 +1515,10 @@ public ContainerAppInner start(String resourceGroupName, String containerAppName */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> stopWithResponseAsync(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.stop(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), containerAppName, accept, context)) + .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1997,27 +1534,9 @@ private Mono>> stopWithResponseAsync(String resourceGr */ @ServiceMethod(returns = ReturnType.SINGLE) private Response stopWithResponse(String resourceGroupName, String containerAppName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } final String accept = "application/json"; - return service.stopSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), containerAppName, accept, Context.NONE); + return service.stopSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, accept, Context.NONE); } /** @@ -2033,27 +1552,9 @@ private Response stopWithResponse(String resourceGroupName, String c */ @ServiceMethod(returns = ReturnType.SINGLE) private Response stopWithResponse(String resourceGroupName, String containerAppName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } final String accept = "application/json"; - return service.stopSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), containerAppName, accept, context); + return service.stopSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, accept, context); } /** @@ -2159,7 +1660,7 @@ public ContainerAppInner stop(String resourceGroupName, String containerAppName, } /** - * Get the Container Apps in a given subscription. + * Get the Container Apps in a given resource group. * * Get the next page of items. * @@ -2167,29 +1668,22 @@ public ContainerAppInner stop(String resourceGroupName, String containerAppName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Container Apps in a given subscription along with {@link PagedResponse} on successful completion of + * @return the Container Apps in a given resource group 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.")); - } + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + 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 Container Apps in a given subscription. + * Get the Container Apps in a given resource group. * * Get the next page of items. * @@ -2197,28 +1691,19 @@ private Mono> listBySubscriptionNextSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Container Apps in a given subscription along with {@link PagedResponse}. + * @return the Container Apps in a given resource group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { final String accept = "application/json"; Response res - = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } /** - * Get the Container Apps in a given subscription. + * Get the Container Apps in a given resource group. * * Get the next page of items. * @@ -2227,28 +1712,19 @@ private PagedResponse listBySubscriptionNextSinglePage(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Container Apps in a given subscription along with {@link PagedResponse}. + * @return the Container Apps in a given resource group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; Response res - = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } /** - * Get the Container Apps in a given resource group. + * Get the Container Apps in a given subscription. * * Get the next page of items. * @@ -2256,29 +1732,22 @@ private PagedResponse listBySubscriptionNextSinglePage(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Container Apps in a given resource group along with {@link PagedResponse} on successful completion of + * @return the Container Apps in a given subscription 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.")); - } + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + 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 Container Apps in a given resource group. + * Get the Container Apps in a given subscription. * * Get the next page of items. * @@ -2286,28 +1755,19 @@ private Mono> listByResourceGroupNextSinglePage * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Container Apps in a given resource group along with {@link PagedResponse}. + * @return the Container Apps in a given subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { final String accept = "application/json"; Response res - = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } /** - * Get the Container Apps in a given resource group. + * Get the Container Apps in a given subscription. * * Get the next page of items. * @@ -2316,25 +1776,14 @@ private PagedResponse listByResourceGroupNextSinglePage(Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Container Apps in a given resource group along with {@link PagedResponse}. + * @return the Container Apps in a given subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; Response res - = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(ContainerAppsClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsDiagnosticsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsDiagnosticsClientImpl.java index 3148a1e7261e..90b8fd6e31ff 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsDiagnosticsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsDiagnosticsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -25,14 +25,13 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsDiagnosticsClient; import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppInner; import com.azure.resourcemanager.appcontainers.fluent.models.DiagnosticsCollectionInner; import com.azure.resourcemanager.appcontainers.fluent.models.DiagnosticsInner; import com.azure.resourcemanager.appcontainers.fluent.models.RevisionInner; +import com.azure.resourcemanager.appcontainers.implementation.models.RevisionCollection; import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.appcontainers.models.RevisionCollection; import reactor.core.publisher.Mono; /** @@ -64,463 +63,241 @@ public final class ContainerAppsDiagnosticsClientImpl implements ContainerAppsDi * The interface defining all the services for ContainerAppsApiClientContainerAppsDiagnostics to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientContainerAppsDiagnostics") public interface ContainerAppsDiagnosticsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectors") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/revisionsApi/revisions/{revisionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listDetectors(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getRevision(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion, + @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectors") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/revisionsApi/revisions/{revisionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listDetectorsSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getRevisionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion, + @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectors/{detectorName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/revisionsApi/revisions/") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getDetector(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listRevisions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @PathParam("detectorName") String detectorName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @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}/detectors/{detectorName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/revisionsApi/revisions/") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getDetectorSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listRevisionsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @PathParam("detectorName") String detectorName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @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}/detectorProperties/revisionsApi/revisions/") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/rootApi/") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 404 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listRevisions(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getRoot(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + @PathParam("containerAppName") String containerAppName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/revisionsApi/revisions/") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/rootApi/") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 404 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listRevisionsSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getRootSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + @PathParam("containerAppName") String containerAppName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/revisionsApi/revisions/{revisionName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectors") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getRevision(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listDetectors(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("containerAppName") String containerAppName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/revisionsApi/revisions/{revisionName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectors") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getRevisionSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listDetectorsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("containerAppName") String containerAppName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/rootApi/") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectors/{detectorName}") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 404 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getRoot(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getDetector(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion, + @PathParam("containerAppName") String containerAppName, @PathParam("detectorName") String detectorName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/rootApi/") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectors/{detectorName}") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 404 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getRootSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getDetectorSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion, + @PathParam("containerAppName") String containerAppName, @PathParam("detectorName") String detectorName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listDetectorsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Mono> listRevisionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listDetectorsNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listRevisionsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listRevisionsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Mono> listDetectorsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listRevisionsNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listDetectorsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Get the list of diagnostics for a given Container App. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which detector info is needed. - * @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 list of diagnostics for a given Container App along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDetectorsSinglePageAsync(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.listDetectors(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, 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 list of diagnostics for a given Container App. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which detector info is needed. - * @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 list of diagnostics for a given Container App as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDetectorsAsync(String resourceGroupName, String containerAppName) { - return new PagedFlux<>(() -> listDetectorsSinglePageAsync(resourceGroupName, containerAppName), - nextLink -> listDetectorsNextSinglePageAsync(nextLink)); - } - - /** - * Get the list of diagnostics for a given Container App. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which detector info is needed. - * @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 list of diagnostics for a given Container App along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listDetectorsSinglePage(String resourceGroupName, String containerAppName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listDetectorsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, this.client.getApiVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the list of diagnostics for a given Container App. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which detector info is needed. - * @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 list of diagnostics for a given Container App along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listDetectorsSinglePage(String resourceGroupName, String containerAppName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listDetectorsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, this.client.getApiVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the list of diagnostics for a given Container App. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which detector info is needed. - * @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 list of diagnostics for a given Container App as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDetectors(String resourceGroupName, String containerAppName) { - return new PagedIterable<>(() -> listDetectorsSinglePage(resourceGroupName, containerAppName), - nextLink -> listDetectorsNextSinglePage(nextLink)); - } - - /** - * Get the list of diagnostics for a given Container App. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which detector info is needed. - * @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 list of diagnostics for a given Container App as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDetectors(String resourceGroupName, String containerAppName, - Context context) { - return new PagedIterable<>(() -> listDetectorsSinglePage(resourceGroupName, containerAppName, context), - nextLink -> listDetectorsNextSinglePage(nextLink, context)); - } - - /** - * Get a diagnostics result of a Container App. + * Get a revision of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param detectorName Name of the Container App Detector. + * @param revisionName Name of the detector. * @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 diagnostics result of a Container App along with {@link Response} on successful completion of - * {@link Mono}. + * @return a revision of a Container App along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDetectorWithResponseAsync(String resourceGroupName, - String containerAppName, String detectorName) { - 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 (detectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter detectorName is required and cannot be null.")); - } + private Mono> getRevisionWithResponseAsync(String resourceGroupName, + String containerAppName, String revisionName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getDetector(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, detectorName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getRevision(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, revisionName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get a diagnostics result of a Container App. + * Get a revision of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param detectorName Name of the Container App Detector. + * @param revisionName Name of the detector. * @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 diagnostics result of a Container App on successful completion of {@link Mono}. + * @return a revision of a Container App on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getDetectorAsync(String resourceGroupName, String containerAppName, - String detectorName) { - return getDetectorWithResponseAsync(resourceGroupName, containerAppName, detectorName) + private Mono getRevisionAsync(String resourceGroupName, String containerAppName, + String revisionName) { + return getRevisionWithResponseAsync(resourceGroupName, containerAppName, revisionName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get a diagnostics result of a Container App. + * Get a revision of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param detectorName Name of the Container App Detector. + * @param revisionName Name of the detector. * @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 diagnostics result of a Container App along with {@link Response}. + * @return a revision of a Container App along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDetectorWithResponse(String resourceGroupName, String containerAppName, - String detectorName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (detectorName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter detectorName is required and cannot be null.")); - } + public Response getRevisionWithResponse(String resourceGroupName, String containerAppName, + String revisionName, Context context) { final String accept = "application/json"; - return service.getDetectorSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, detectorName, this.client.getApiVersion(), accept, context); + return service.getRevisionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, revisionName, accept, context); } /** - * Get a diagnostics result of a Container App. + * Get a revision of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param detectorName Name of the Container App Detector. + * @param revisionName Name of the detector. * @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 diagnostics result of a Container App. + * @return a revision of a Container App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DiagnosticsInner getDetector(String resourceGroupName, String containerAppName, String detectorName) { - return getDetectorWithResponse(resourceGroupName, containerAppName, detectorName, Context.NONE).getValue(); + public RevisionInner getRevision(String resourceGroupName, String containerAppName, String revisionName) { + return getRevisionWithResponse(resourceGroupName, containerAppName, revisionName, Context.NONE).getValue(); } /** * Get the Revisions for a given Container App. * + * A synchronous resource action. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. + * @param containerAppName Name of the Container App. * @param filter The filter to apply on the 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 Revisions for a given Container App along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the Revisions for a given Container App. + * + * A synchronous resource action along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listRevisionsSinglePageAsync(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.listRevisions(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, this.client.getApiVersion(), filter, accept, context)) + .withContext(context -> service.listRevisions(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())); @@ -529,13 +306,17 @@ private Mono> listRevisionsSinglePageAsync(String r /** * Get the Revisions for a given Container App. * + * A synchronous resource action. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. + * @param containerAppName Name of the Container App. * @param filter The filter to apply on the 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 Revisions for a given Container App as paginated response with {@link PagedFlux}. + * @return the Revisions for a given Container App. + * + * A synchronous resource action as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listRevisionsAsync(String resourceGroupName, String containerAppName, @@ -547,12 +328,16 @@ private PagedFlux listRevisionsAsync(String resourceGroupName, St /** * Get the Revisions for a given Container App. * + * A synchronous resource action. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. + * @param containerAppName 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 the Revisions for a given Container App as paginated response with {@link PagedFlux}. + * @return the Revisions for a given Container App. + * + * A synchronous resource action as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listRevisionsAsync(String resourceGroupName, String containerAppName) { @@ -564,39 +349,25 @@ private PagedFlux listRevisionsAsync(String resourceGroupName, St /** * Get the Revisions for a given Container App. * + * A synchronous resource action. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. + * @param containerAppName Name of the Container App. * @param filter The filter to apply on the 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 Revisions for a given Container App along with {@link PagedResponse}. + * @return the Revisions for a given Container App. + * + * A synchronous resource action along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listRevisionsSinglePage(String resourceGroupName, String containerAppName, String filter) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listRevisionsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, this.client.getApiVersion(), filter, accept, Context.NONE); + = service.listRevisionsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, filter, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -604,40 +375,26 @@ private PagedResponse listRevisionsSinglePage(String resourceGrou /** * Get the Revisions for a given Container App. * + * A synchronous resource action. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. + * @param containerAppName Name of the Container App. * @param filter The filter to apply on the operation. * @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 Revisions for a given Container App along with {@link PagedResponse}. + * @return the Revisions for a given Container App. + * + * A synchronous resource action along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listRevisionsSinglePage(String resourceGroupName, String containerAppName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listRevisionsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, this.client.getApiVersion(), filter, accept, context); + = service.listRevisionsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, filter, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -645,12 +402,16 @@ private PagedResponse listRevisionsSinglePage(String resourceGrou /** * Get the Revisions for a given Container App. * + * A synchronous resource action. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. + * @param containerAppName 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 the Revisions for a given Container App as paginated response with {@link PagedIterable}. + * @return the Revisions for a given Container App. + * + * A synchronous resource action as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listRevisions(String resourceGroupName, String containerAppName) { @@ -662,14 +423,18 @@ public PagedIterable listRevisions(String resourceGroupName, Stri /** * Get the Revisions for a given Container App. * + * A synchronous resource action. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. + * @param containerAppName Name of the Container App. * @param filter The filter to apply on the operation. * @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 Revisions for a given Container App as paginated response with {@link PagedIterable}. + * @return the Revisions for a given Container App. + * + * A synchronous resource action as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listRevisions(String resourceGroupName, String containerAppName, String filter, @@ -679,260 +444,295 @@ public PagedIterable listRevisions(String resourceGroupName, Stri } /** - * Get a revision of a Container App. + * Get the properties of a 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a revision of a Container App along with {@link Response} on successful completion of {@link Mono}. + * @return the properties of a Container App along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getRevisionWithResponseAsync(String resourceGroupName, - String containerAppName, String revisionName) { - 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.")); - } + private Mono> getRootWithResponseAsync(String resourceGroupName, + String containerAppName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getRevision(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, revisionName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getRoot(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get a revision of a Container App. + * Get the properties of a 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a revision of a Container App on successful completion of {@link Mono}. + * @return the properties of a Container App on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getRevisionAsync(String resourceGroupName, String containerAppName, - String revisionName) { - return getRevisionWithResponseAsync(resourceGroupName, containerAppName, revisionName) + private Mono getRootAsync(String resourceGroupName, String containerAppName) { + return getRootWithResponseAsync(resourceGroupName, containerAppName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get a revision of a Container App. + * Get the properties of a 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. * @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 ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a revision of a Container App along with {@link Response}. + * @return the properties of a Container App along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getRevisionWithResponse(String resourceGroupName, String containerAppName, - String revisionName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (revisionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter revisionName is required and cannot be null.")); - } + public Response getRootWithResponse(String resourceGroupName, String containerAppName, + Context context) { final String accept = "application/json"; - return service.getRevisionSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, revisionName, this.client.getApiVersion(), accept, context); + return service.getRootSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, accept, context); } /** - * Get a revision of a Container App. + * Get the properties of a 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a revision of a Container App. + * @return the properties of a Container App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RevisionInner getRevision(String resourceGroupName, String containerAppName, String revisionName) { - return getRevisionWithResponse(resourceGroupName, containerAppName, revisionName, Context.NONE).getValue(); + public ContainerAppInner getRoot(String resourceGroupName, String containerAppName) { + return getRootWithResponse(resourceGroupName, containerAppName, Context.NONE).getValue(); } /** - * Get the properties of a Container App. + * Get the list of diagnostics for a given Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a Container App along with {@link Response} on successful completion of {@link Mono}. + * @return the list of diagnostics for a given Container App along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getRootWithResponseAsync(String resourceGroupName, + private Mono> listDetectorsSinglePageAsync(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.getRoot(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.listDetectors(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())); } /** - * Get the properties of a Container App. + * Get the list of diagnostics for a given Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a Container App on successful completion of {@link Mono}. + * @return the list of diagnostics for a given Container App as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDetectorsAsync(String resourceGroupName, String containerAppName) { + return new PagedFlux<>(() -> listDetectorsSinglePageAsync(resourceGroupName, containerAppName), + nextLink -> listDetectorsNextSinglePageAsync(nextLink)); + } + + /** + * Get the list of diagnostics for a given Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the list of diagnostics for a given Container App along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getRootAsync(String resourceGroupName, String containerAppName) { - return getRootWithResponseAsync(resourceGroupName, containerAppName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listDetectorsSinglePage(String resourceGroupName, String containerAppName) { + final String accept = "application/json"; + Response res + = service.listDetectorsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Get the properties of a Container App. + * Get the list of diagnostics for a given Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName 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 ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a Container App along with {@link Response}. + * @return the list of diagnostics for a given Container App along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getRootWithResponse(String resourceGroupName, String containerAppName, + private PagedResponse listDetectorsSinglePage(String resourceGroupName, String containerAppName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getRootSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, this.client.getApiVersion(), accept, context); + Response res + = service.listDetectorsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Get the properties of a Container App. + * Get the list of diagnostics for a given Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a Container App. + * @return the list of diagnostics for a given Container App as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ContainerAppInner getRoot(String resourceGroupName, String containerAppName) { - return getRootWithResponse(resourceGroupName, containerAppName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDetectors(String resourceGroupName, String containerAppName) { + return new PagedIterable<>(() -> listDetectorsSinglePage(resourceGroupName, containerAppName), + nextLink -> listDetectorsNextSinglePage(nextLink)); } /** * Get the list of diagnostics for a given Container App. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the list of diagnostics for a given Container App as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDetectors(String resourceGroupName, String containerAppName, + Context context) { + return new PagedIterable<>(() -> listDetectorsSinglePage(resourceGroupName, containerAppName, context), + nextLink -> listDetectorsNextSinglePage(nextLink, context)); + } + + /** + * Get a diagnostics result of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param detectorName Name of the detector. + * @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 diagnostics result of a Container App along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDetectorWithResponseAsync(String resourceGroupName, + String containerAppName, String detectorName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getDetector(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, detectorName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a diagnostics result of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param detectorName Name of the detector. + * @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 diagnostics result of a Container App on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDetectorAsync(String resourceGroupName, String containerAppName, + String detectorName) { + return getDetectorWithResponseAsync(resourceGroupName, containerAppName, detectorName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a diagnostics result of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param detectorName Name of the detector. + * @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 diagnostics result of a Container App along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDetectorWithResponse(String resourceGroupName, String containerAppName, + String detectorName, Context context) { + final String accept = "application/json"; + return service.getDetectorSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, detectorName, accept, context); + } + + /** + * Get a diagnostics result of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param detectorName Name of the detector. + * @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 diagnostics result of a Container App. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiagnosticsInner getDetector(String resourceGroupName, String containerAppName, String detectorName) { + return getDetectorWithResponse(resourceGroupName, containerAppName, detectorName, Context.NONE).getValue(); + } + + /** + * Get the Revisions for a given Container App. + * * 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 the list of diagnostics for a given Container App along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the Revisions for a given Container App. + * + * A synchronous resource action along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDetectorsNextSinglePageAsync(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.")); - } + private Mono> listRevisionsNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listDetectorsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + .withContext(context -> service.listRevisionsNext(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 list of diagnostics for a given Container App. + * Get the Revisions for a given Container App. * * Get the next page of items. * @@ -940,28 +740,21 @@ private Mono> listDetectorsNextSinglePageAsync(S * @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 list of diagnostics for a given Container App along with {@link PagedResponse}. + * @return the Revisions for a given Container App. + * + * A synchronous resource action along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listDetectorsNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listRevisionsNextSinglePage(String nextLink) { final String accept = "application/json"; - Response res - = service.listDetectorsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + Response res + = service.listRevisionsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } /** - * Get the list of diagnostics for a given Container App. + * Get the Revisions for a given Container App. * * Get the next page of items. * @@ -970,28 +763,21 @@ private PagedResponse listDetectorsNextSinglePage(String nextL * @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 list of diagnostics for a given Container App along with {@link PagedResponse}. + * @return the Revisions for a given Container App. + * + * A synchronous resource action along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listDetectorsNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listRevisionsNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - Response res - = service.listDetectorsNextSync(nextLink, this.client.getEndpoint(), accept, context); + Response res + = service.listRevisionsNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } /** - * Get the Revisions for a given Container App. + * Get the list of diagnostics for a given Container App. * * Get the next page of items. * @@ -999,28 +785,21 @@ private PagedResponse listDetectorsNextSinglePage(String nextL * @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 Revisions for a given Container App along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list of diagnostics for a given Container App along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listRevisionsNextSinglePageAsync(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.")); - } + private Mono> listDetectorsNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listRevisionsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + .withContext(context -> service.listDetectorsNext(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 Revisions for a given Container App. + * Get the list of diagnostics for a given Container App. * * Get the next page of items. * @@ -1028,28 +807,19 @@ private Mono> listRevisionsNextSinglePageAsync(Stri * @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 Revisions for a given Container App along with {@link PagedResponse}. + * @return the list of diagnostics for a given Container App along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listRevisionsNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listDetectorsNextSinglePage(String nextLink) { final String accept = "application/json"; - Response res - = service.listRevisionsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + Response res + = service.listDetectorsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } /** - * Get the Revisions for a given Container App. + * Get the list of diagnostics for a given Container App. * * Get the next page of items. * @@ -1058,25 +828,14 @@ private PagedResponse listRevisionsNextSinglePage(String nextLink * @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 Revisions for a given Container App along with {@link PagedResponse}. + * @return the list of diagnostics for a given Container App along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listRevisionsNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listDetectorsNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - Response res - = service.listRevisionsNextSync(nextLink, this.client.getEndpoint(), accept, context); + Response res + = service.listDetectorsNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(ContainerAppsDiagnosticsClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsDiagnosticsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsDiagnosticsImpl.java index 32d1d19b0fe1..f89870db3ffa 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsDiagnosticsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsDiagnosticsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -31,34 +31,18 @@ public ContainerAppsDiagnosticsImpl(ContainerAppsDiagnosticsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listDetectors(String resourceGroupName, String containerAppName) { - PagedIterable inner = this.serviceClient().listDetectors(resourceGroupName, containerAppName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DiagnosticsImpl(inner1, this.manager())); - } - - public PagedIterable listDetectors(String resourceGroupName, String containerAppName, - Context context) { - PagedIterable inner - = this.serviceClient().listDetectors(resourceGroupName, containerAppName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DiagnosticsImpl(inner1, this.manager())); - } - - public Response getDetectorWithResponse(String resourceGroupName, String containerAppName, - String detectorName, Context context) { - Response inner - = this.serviceClient().getDetectorWithResponse(resourceGroupName, containerAppName, detectorName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DiagnosticsImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public Response getRevisionWithResponse(String resourceGroupName, String containerAppName, + String revisionName, Context context) { + Response inner + = this.serviceClient().getRevisionWithResponse(resourceGroupName, containerAppName, revisionName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RevisionImpl(inner.getValue(), this.manager())); } - public Diagnostics getDetector(String resourceGroupName, String containerAppName, String detectorName) { - DiagnosticsInner inner = this.serviceClient().getDetector(resourceGroupName, containerAppName, detectorName); + public Revision getRevision(String resourceGroupName, String containerAppName, String revisionName) { + RevisionInner inner = this.serviceClient().getRevision(resourceGroupName, containerAppName, revisionName); if (inner != null) { - return new DiagnosticsImpl(inner, this.manager()); + return new RevisionImpl(inner, this.manager()); } else { return null; } @@ -76,43 +60,47 @@ public PagedIterable listRevisions(String resourceGroupName, String co return ResourceManagerUtils.mapPage(inner, inner1 -> new RevisionImpl(inner1, this.manager())); } - public Response getRevisionWithResponse(String resourceGroupName, String containerAppName, - String revisionName, Context context) { - Response inner - = this.serviceClient().getRevisionWithResponse(resourceGroupName, containerAppName, revisionName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RevisionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public Response getRootWithResponse(String resourceGroupName, String containerAppName, + Context context) { + Response inner + = this.serviceClient().getRootWithResponse(resourceGroupName, containerAppName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ContainerAppImpl(inner.getValue(), this.manager())); } - public Revision getRevision(String resourceGroupName, String containerAppName, String revisionName) { - RevisionInner inner = this.serviceClient().getRevision(resourceGroupName, containerAppName, revisionName); + public ContainerApp getRoot(String resourceGroupName, String containerAppName) { + ContainerAppInner inner = this.serviceClient().getRoot(resourceGroupName, containerAppName); if (inner != null) { - return new RevisionImpl(inner, this.manager()); + return new ContainerAppImpl(inner, this.manager()); } else { return null; } } - public Response getRootWithResponse(String resourceGroupName, String containerAppName, + public PagedIterable listDetectors(String resourceGroupName, String containerAppName) { + PagedIterable inner = this.serviceClient().listDetectors(resourceGroupName, containerAppName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DiagnosticsImpl(inner1, this.manager())); + } + + public PagedIterable listDetectors(String resourceGroupName, String containerAppName, Context context) { - Response inner - = this.serviceClient().getRootWithResponse(resourceGroupName, containerAppName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ContainerAppImpl(inner.getValue(), this.manager())); - } else { - return null; - } + PagedIterable inner + = this.serviceClient().listDetectors(resourceGroupName, containerAppName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DiagnosticsImpl(inner1, this.manager())); } - public ContainerApp getRoot(String resourceGroupName, String containerAppName) { - ContainerAppInner inner = this.serviceClient().getRoot(resourceGroupName, containerAppName); + public Response getDetectorWithResponse(String resourceGroupName, String containerAppName, + String detectorName, Context context) { + Response inner + = this.serviceClient().getDetectorWithResponse(resourceGroupName, containerAppName, detectorName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DiagnosticsImpl(inner.getValue(), this.manager())); + } + + public Diagnostics getDetector(String resourceGroupName, String containerAppName, String detectorName) { + DiagnosticsInner inner = this.serviceClient().getDetector(resourceGroupName, containerAppName, detectorName); if (inner != null) { - return new ContainerAppImpl(inner, this.manager()); + return new DiagnosticsImpl(inner, this.manager()); } else { return null; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsFunctionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsFunctionImpl.java new file mode 100644 index 000000000000..096906580600 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsFunctionImpl.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsFunctionInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsFunction; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsFunctionState; + +public final class ContainerAppsFunctionImpl implements ContainerAppsFunction { + private ContainerAppsFunctionInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + ContainerAppsFunctionImpl(ContainerAppsFunctionInner 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 invokeUrlTemplate() { + return this.innerModel().invokeUrlTemplate(); + } + + public String triggerType() { + return this.innerModel().triggerType(); + } + + public String language() { + return this.innerModel().language(); + } + + public Boolean isDisabled() { + return this.innerModel().isDisabled(); + } + + public ContainerAppsFunctionState state() { + return this.innerModel().state(); + } + + public ContainerAppsFunctionInner 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/ContainerAppsFunctionsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsFunctionsClientImpl.java new file mode 100644 index 000000000000..1c480cdee386 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsFunctionsClientImpl.java @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsFunctionsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsFunctionInner; +import com.azure.resourcemanager.appcontainers.implementation.models.ContainerAppsFunctionCollection; +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 ContainerAppsFunctionsClient. + */ +public final class ContainerAppsFunctionsClientImpl implements ContainerAppsFunctionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ContainerAppsFunctionsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppsFunctionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppsFunctionsClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(ContainerAppsFunctionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerAppsFunctions to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ContainerAppsApiClientContainerAppsFunctions") + public interface ContainerAppsFunctionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/functions/{functionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("functionName") String functionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/functions/{functionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("functionName") String functionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/functions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list(@HostParam("endpoint") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/functions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response listSync(@HostParam("endpoint") 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(DefaultErrorResponseErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a specific function of a Container App from the latest Revision. + * + * Gets the details of a specific function from the latest Container App revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param functionName Name of the Function. + * @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 specific function of a Container App from the latest Revision. + * + * Gets the details of a specific function from the latest Container App revision along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String containerAppName, String functionName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, functionName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a specific function of a Container App from the latest Revision. + * + * Gets the details of a specific function from the latest Container App revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param functionName Name of the Function. + * @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 specific function of a Container App from the latest Revision. + * + * Gets the details of a specific function from the latest Container App revision on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String containerAppName, + String functionName) { + return getWithResponseAsync(resourceGroupName, containerAppName, functionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a specific function of a Container App from the latest Revision. + * + * Gets the details of a specific function from the latest Container App revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param functionName Name of the Function. + * @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 specific function of a Container App from the latest Revision. + * + * Gets the details of a specific function from the latest Container App revision along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String containerAppName, + String functionName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, functionName, accept, context); + } + + /** + * Get a specific function of a Container App from the latest Revision. + * + * Gets the details of a specific function from the latest Container App revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param functionName Name of the Function. + * @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 specific function of a Container App from the latest Revision. + * + * Gets the details of a specific function from the latest Container App revision. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAppsFunctionInner get(String resourceGroupName, String containerAppName, String functionName) { + return getWithResponse(resourceGroupName, containerAppName, functionName, Context.NONE).getValue(); + } + + /** + * List the functions for a given Container App from the latest Revision. + * + * Lists the functions available in the latest revision of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 container App Functions collection ARM resource along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String containerAppName) { + 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 the functions for a given Container App from the latest Revision. + * + * Lists the functions available in the latest revision of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 container App Functions collection ARM resource 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 the functions for a given Container App from the latest Revision. + * + * Lists the functions available in the latest revision of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 container App Functions collection ARM resource along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String containerAppName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the functions for a given Container App from the latest Revision. + * + * Lists the functions available in the latest revision of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 container App Functions collection ARM resource along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String containerAppName, + Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the functions for a given Container App from the latest Revision. + * + * Lists the functions available in the latest revision of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 container App Functions collection ARM resource as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String containerAppName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, containerAppName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List the functions for a given Container App from the latest Revision. + * + * Lists the functions available in the latest revision of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 container App Functions collection ARM resource as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String containerAppName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, containerAppName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * List the functions for a given Container App from the latest Revision. + * + * 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 container App Functions collection ARM resource along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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())); + } + + /** + * List the functions for a given Container App from the latest Revision. + * + * 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 container App Functions collection ARM resource along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the functions for a given Container App from the latest Revision. + * + * 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 container App Functions collection ARM resource along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/ContainerAppsFunctionsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsFunctionsImpl.java new file mode 100644 index 000000000000..a504787baaf4 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsFunctionsImpl.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ContainerAppsFunctionsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsFunctionInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsFunction; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsFunctions; + +public final class ContainerAppsFunctionsImpl implements ContainerAppsFunctions { + private static final ClientLogger LOGGER = new ClientLogger(ContainerAppsFunctionsImpl.class); + + private final ContainerAppsFunctionsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public ContainerAppsFunctionsImpl(ContainerAppsFunctionsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String containerAppName, + String functionName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, containerAppName, functionName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ContainerAppsFunctionImpl(inner.getValue(), this.manager())); + } + + public ContainerAppsFunction get(String resourceGroupName, String containerAppName, String functionName) { + ContainerAppsFunctionInner inner = this.serviceClient().get(resourceGroupName, containerAppName, functionName); + if (inner != null) { + return new ContainerAppsFunctionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String containerAppName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, containerAppName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ContainerAppsFunctionImpl(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 ContainerAppsFunctionImpl(inner1, this.manager())); + } + + private ContainerAppsFunctionsClient 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/ContainerAppsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsImpl.java index ca52900339af..c49c481a0be8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -33,36 +33,12 @@ public ContainerAppsImpl(ContainerAppsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ContainerAppImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ContainerAppImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ContainerAppImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ContainerAppImpl(inner1, this.manager())); - } - public Response getByResourceGroupWithResponse(String resourceGroupName, String containerAppName, Context context) { Response inner = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, containerAppName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ContainerAppImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ContainerAppImpl(inner.getValue(), this.manager())); } public ContainerApp getByResourceGroup(String resourceGroupName, String containerAppName) { @@ -82,16 +58,32 @@ public void delete(String resourceGroupName, String containerAppName, Context co this.serviceClient().delete(resourceGroupName, containerAppName, context); } + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ContainerAppImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ContainerAppImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ContainerAppImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ContainerAppImpl(inner1, this.manager())); + } + public Response listCustomHostnameAnalysisWithResponse(String resourceGroupName, String containerAppName, String customHostname, Context context) { Response inner = this.serviceClient() .listCustomHostnameAnalysisWithResponse(resourceGroupName, containerAppName, customHostname, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CustomHostnameAnalysisResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CustomHostnameAnalysisResultImpl(inner.getValue(), this.manager())); } public CustomHostnameAnalysisResult listCustomHostnameAnalysis(String resourceGroupName, String containerAppName) { @@ -108,12 +100,8 @@ public Response listSecretsWithResponse(String resourceGroupN Context context) { Response inner = this.serviceClient().listSecretsWithResponse(resourceGroupName, containerAppName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecretsCollectionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SecretsCollectionImpl(inner.getValue(), this.manager())); } public SecretsCollection listSecrets(String resourceGroupName, String containerAppName) { @@ -129,12 +117,8 @@ public Response getAuthTokenWithResponse(String resourceG Context context) { Response inner = this.serviceClient().getAuthTokenWithResponse(resourceGroupName, containerAppName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ContainerAppAuthTokenImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ContainerAppAuthTokenImpl(inner.getValue(), this.manager())); } public ContainerAppAuthToken getAuthToken(String resourceGroupName, String containerAppName) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsLabelHistoriesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsLabelHistoriesClientImpl.java new file mode 100644 index 000000000000..ce54021ac253 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsLabelHistoriesClientImpl.java @@ -0,0 +1,551 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.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.ContainerAppsLabelHistoriesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.LabelHistoryInner; +import com.azure.resourcemanager.appcontainers.implementation.models.LabelHistoryCollection; +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 ContainerAppsLabelHistoriesClient. + */ +public final class ContainerAppsLabelHistoriesClientImpl implements ContainerAppsLabelHistoriesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ContainerAppsLabelHistoriesService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppsLabelHistoriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppsLabelHistoriesClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(ContainerAppsLabelHistoriesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerAppsLabelHistories to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ContainerAppsApiClientContainerAppsLabelHistories") + public interface ContainerAppsLabelHistoriesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistories/{labelName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> getLabelHistory(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("labelName") String labelName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistories/{labelName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response getLabelHistorySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("labelName") String labelName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistories/{labelName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> deleteLabelHistory(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("labelName") String labelName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistories/{labelName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response deleteLabelHistorySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("labelName") String labelName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistories") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listLabelHistory(@HostParam("endpoint") 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}/labelHistories") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response listLabelHistorySync(@HostParam("endpoint") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listLabelHistoryNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response listLabelHistoryNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the history of a label. + * + * Gets the revision history associated with a Container App label. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param labelName Name of the label. + * @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 history of a label. + * + * Gets the revision history associated with a Container App label along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLabelHistoryWithResponseAsync(String resourceGroupName, + String containerAppName, String labelName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getLabelHistory(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, labelName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the history of a label. + * + * Gets the revision history associated with a Container App label. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param labelName Name of the label. + * @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 history of a label. + * + * Gets the revision history associated with a Container App label on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLabelHistoryAsync(String resourceGroupName, String containerAppName, + String labelName) { + return getLabelHistoryWithResponseAsync(resourceGroupName, containerAppName, labelName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the history of a label. + * + * Gets the revision history associated with a Container App label. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param labelName Name of the label. + * @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 history of a label. + * + * Gets the revision history associated with a Container App label along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLabelHistoryWithResponse(String resourceGroupName, String containerAppName, + String labelName, Context context) { + final String accept = "application/json"; + return service.getLabelHistorySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, labelName, accept, context); + } + + /** + * Get the history of a label. + * + * Gets the revision history associated with a Container App label. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param labelName Name of the label. + * @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 history of a label. + * + * Gets the revision history associated with a Container App label. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LabelHistoryInner getLabelHistory(String resourceGroupName, String containerAppName, String labelName) { + return getLabelHistoryWithResponse(resourceGroupName, containerAppName, labelName, Context.NONE).getValue(); + } + + /** + * Delete the history of a label. + * + * Deletes the revision history associated with a Container App label. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param labelName Name of the label. + * @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> deleteLabelHistoryWithResponseAsync(String resourceGroupName, String containerAppName, + String labelName) { + return FluxUtil + .withContext(context -> service.deleteLabelHistory(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, labelName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the history of a label. + * + * Deletes the revision history associated with a Container App label. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param labelName Name of the label. + * @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 deleteLabelHistoryAsync(String resourceGroupName, String containerAppName, String labelName) { + return deleteLabelHistoryWithResponseAsync(resourceGroupName, containerAppName, labelName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Delete the history of a label. + * + * Deletes the revision history associated with a Container App label. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param labelName Name of the label. + * @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 deleteLabelHistoryWithResponse(String resourceGroupName, String containerAppName, + String labelName, Context context) { + return service.deleteLabelHistorySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, labelName, context); + } + + /** + * Delete the history of a label. + * + * Deletes the revision history associated with a Container App label. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param labelName Name of the label. + * @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 deleteLabelHistory(String resourceGroupName, String containerAppName, String labelName) { + deleteLabelHistoryWithResponse(resourceGroupName, containerAppName, labelName, Context.NONE); + } + + /** + * Get the Label History for a given Container App. + * + * Lists the label revision histories 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 filter The filter to apply on the 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 Label History for a given Container App. + * + * Lists the label revision histories for a Container App along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listLabelHistorySinglePageAsync(String resourceGroupName, + String containerAppName, String filter) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listLabelHistory(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())); + } + + /** + * Get the Label History for a given Container App. + * + * Lists the label revision histories 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 filter The filter to apply on the 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 Label History for a given Container App. + * + * Lists the label revision histories for a Container App as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listLabelHistoryAsync(String resourceGroupName, String containerAppName, + String filter) { + return new PagedFlux<>(() -> listLabelHistorySinglePageAsync(resourceGroupName, containerAppName, filter), + nextLink -> listLabelHistoryNextSinglePageAsync(nextLink)); + } + + /** + * Get the Label History for a given Container App. + * + * Lists the label revision histories for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the Label History for a given Container App. + * + * Lists the label revision histories for a Container App as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listLabelHistoryAsync(String resourceGroupName, String containerAppName) { + final String filter = null; + return new PagedFlux<>(() -> listLabelHistorySinglePageAsync(resourceGroupName, containerAppName, filter), + nextLink -> listLabelHistoryNextSinglePageAsync(nextLink)); + } + + /** + * Get the Label History for a given Container App. + * + * Lists the label revision histories 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 filter The filter to apply on the 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 Label History for a given Container App. + * + * Lists the label revision histories for a Container App along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listLabelHistorySinglePage(String resourceGroupName, + String containerAppName, String filter) { + final String accept = "application/json"; + Response res + = service.listLabelHistorySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the Label History for a given Container App. + * + * Lists the label revision histories 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 filter The filter to apply on the operation. + * @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 Label History for a given Container App. + * + * Lists the label revision histories for a Container App along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listLabelHistorySinglePage(String resourceGroupName, + String containerAppName, String filter, Context context) { + final String accept = "application/json"; + Response res + = service.listLabelHistorySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the Label History for a given Container App. + * + * Lists the label revision histories for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the Label History for a given Container App. + * + * Lists the label revision histories for a Container App as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLabelHistory(String resourceGroupName, String containerAppName) { + final String filter = null; + return new PagedIterable<>(() -> listLabelHistorySinglePage(resourceGroupName, containerAppName, filter), + nextLink -> listLabelHistoryNextSinglePage(nextLink)); + } + + /** + * Get the Label History for a given Container App. + * + * Lists the label revision histories 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 filter The filter to apply on the operation. + * @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 Label History for a given Container App. + * + * Lists the label revision histories for a Container App as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLabelHistory(String resourceGroupName, String containerAppName, + String filter, Context context) { + return new PagedIterable<>( + () -> listLabelHistorySinglePage(resourceGroupName, containerAppName, filter, context), + nextLink -> listLabelHistoryNextSinglePage(nextLink, context)); + } + + /** + * Get the Label History for a given Container App. + * + * 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 the Label History for a given Container App. + * + * Lists the label revision histories for a Container App along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listLabelHistoryNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listLabelHistoryNext(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 Label History for a given Container App. + * + * 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 the Label History for a given Container App. + * + * Lists the label revision histories for a Container App along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listLabelHistoryNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listLabelHistoryNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the Label History for a given Container App. + * + * 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 the Label History for a given Container App. + * + * Lists the label revision histories for a Container App along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listLabelHistoryNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listLabelHistoryNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/ContainerAppsLabelHistoriesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsLabelHistoriesImpl.java new file mode 100644 index 000000000000..326ba4b79e01 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsLabelHistoriesImpl.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ContainerAppsLabelHistoriesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.LabelHistoryInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsLabelHistories; +import com.azure.resourcemanager.appcontainers.models.LabelHistory; + +public final class ContainerAppsLabelHistoriesImpl implements ContainerAppsLabelHistories { + private static final ClientLogger LOGGER = new ClientLogger(ContainerAppsLabelHistoriesImpl.class); + + private final ContainerAppsLabelHistoriesClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public ContainerAppsLabelHistoriesImpl(ContainerAppsLabelHistoriesClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getLabelHistoryWithResponse(String resourceGroupName, String containerAppName, + String labelName, Context context) { + Response inner + = this.serviceClient().getLabelHistoryWithResponse(resourceGroupName, containerAppName, labelName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LabelHistoryImpl(inner.getValue(), this.manager())); + } + + public LabelHistory getLabelHistory(String resourceGroupName, String containerAppName, String labelName) { + LabelHistoryInner inner = this.serviceClient().getLabelHistory(resourceGroupName, containerAppName, labelName); + if (inner != null) { + return new LabelHistoryImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteLabelHistoryWithResponse(String resourceGroupName, String containerAppName, + String labelName, Context context) { + return this.serviceClient() + .deleteLabelHistoryWithResponse(resourceGroupName, containerAppName, labelName, context); + } + + public void deleteLabelHistory(String resourceGroupName, String containerAppName, String labelName) { + this.serviceClient().deleteLabelHistory(resourceGroupName, containerAppName, labelName); + } + + public PagedIterable listLabelHistory(String resourceGroupName, String containerAppName) { + PagedIterable inner + = this.serviceClient().listLabelHistory(resourceGroupName, containerAppName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LabelHistoryImpl(inner1, this.manager())); + } + + public PagedIterable listLabelHistory(String resourceGroupName, String containerAppName, + String filter, Context context) { + PagedIterable inner + = this.serviceClient().listLabelHistory(resourceGroupName, containerAppName, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LabelHistoryImpl(inner1, this.manager())); + } + + private ContainerAppsLabelHistoriesClient 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/ContainerAppsRevisionFunctionsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionFunctionsClientImpl.java new file mode 100644 index 000000000000..5b8b5b3751a5 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionFunctionsClientImpl.java @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsRevisionFunctionsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsFunctionInner; +import com.azure.resourcemanager.appcontainers.implementation.models.ContainerAppsFunctionCollection; +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 ContainerAppsRevisionFunctionsClient. + */ +public final class ContainerAppsRevisionFunctionsClientImpl implements ContainerAppsRevisionFunctionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ContainerAppsRevisionFunctionsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppsRevisionFunctionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppsRevisionFunctionsClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(ContainerAppsRevisionFunctionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerAppsRevisionFunctions to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ContainerAppsApiClientContainerAppsRevisionFunctions") + public interface ContainerAppsRevisionFunctionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/functions/{functionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, + @PathParam("functionName") String functionName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/functions/{functionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, + @PathParam("functionName") String functionName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/functions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/functions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, + @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a specific function of a Container App Revision. + * + * Gets the details of a specific function in a Container App revision. + * + * @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. + * @param functionName Name of the Function. + * @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 specific function of a Container App Revision. + * + * Gets the details of a specific function in a Container App revision along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String containerAppName, String revisionName, String functionName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, revisionName, functionName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a specific function of a Container App Revision. + * + * Gets the details of a specific function in a Container App revision. + * + * @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. + * @param functionName Name of the Function. + * @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 specific function of a Container App Revision. + * + * Gets the details of a specific function in a Container App revision on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String containerAppName, + String revisionName, String functionName) { + return getWithResponseAsync(resourceGroupName, containerAppName, revisionName, functionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a specific function of a Container App Revision. + * + * Gets the details of a specific function in a Container App revision. + * + * @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. + * @param functionName Name of the Function. + * @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 specific function of a Container App Revision. + * + * Gets the details of a specific function in a Container App revision along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String containerAppName, + String revisionName, String functionName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, revisionName, functionName, accept, context); + } + + /** + * Get a specific function of a Container App Revision. + * + * Gets the details of a specific function in a Container App revision. + * + * @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. + * @param functionName Name of the Function. + * @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 specific function of a Container App Revision. + * + * Gets the details of a specific function in a Container App revision. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAppsFunctionInner get(String resourceGroupName, String containerAppName, String revisionName, + String functionName) { + return getWithResponse(resourceGroupName, containerAppName, revisionName, functionName, Context.NONE) + .getValue(); + } + + /** + * List the functions for a given Container App Revision. + * + * Lists the functions available in a specific Container App revision. + * + * @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. + * @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 Functions collection ARM resource along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String containerAppName, String revisionName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, revisionName, 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 functions for a given Container App Revision. + * + * Lists the functions available in a specific Container App revision. + * + * @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. + * @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 Functions collection ARM resource as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String containerAppName, + String revisionName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, containerAppName, revisionName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the functions for a given Container App Revision. + * + * Lists the functions available in a specific Container App revision. + * + * @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. + * @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 Functions collection ARM resource along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String containerAppName, + String revisionName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, revisionName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the functions for a given Container App Revision. + * + * Lists the functions available in a specific Container App revision. + * + * @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. + * @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 Functions collection ARM resource along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String containerAppName, + String revisionName, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, revisionName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the functions for a given Container App Revision. + * + * Lists the functions available in a specific Container App revision. + * + * @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. + * @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 Functions collection ARM resource as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String containerAppName, + String revisionName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, containerAppName, revisionName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List the functions for a given Container App Revision. + * + * Lists the functions available in a specific Container App revision. + * + * @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. + * @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 Functions collection ARM resource as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String containerAppName, + String revisionName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, containerAppName, revisionName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * List the functions for a given Container App Revision. + * + * 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 container App Functions collection ARM resource along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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())); + } + + /** + * List the functions for a given Container App Revision. + * + * 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 container App Functions collection ARM resource along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the functions for a given Container App Revision. + * + * 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 container App Functions collection ARM resource along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/ContainerAppsRevisionFunctionsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionFunctionsImpl.java new file mode 100644 index 000000000000..c2f7ed715bf6 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionFunctionsImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ContainerAppsRevisionFunctionsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsFunctionInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsFunction; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsRevisionFunctions; + +public final class ContainerAppsRevisionFunctionsImpl implements ContainerAppsRevisionFunctions { + private static final ClientLogger LOGGER = new ClientLogger(ContainerAppsRevisionFunctionsImpl.class); + + private final ContainerAppsRevisionFunctionsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public ContainerAppsRevisionFunctionsImpl(ContainerAppsRevisionFunctionsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String containerAppName, + String revisionName, String functionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, containerAppName, revisionName, functionName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ContainerAppsFunctionImpl(inner.getValue(), this.manager())); + } + + public ContainerAppsFunction get(String resourceGroupName, String containerAppName, String revisionName, + String functionName) { + ContainerAppsFunctionInner inner + = this.serviceClient().get(resourceGroupName, containerAppName, revisionName, functionName); + if (inner != null) { + return new ContainerAppsFunctionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String containerAppName, + String revisionName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, containerAppName, revisionName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ContainerAppsFunctionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String containerAppName, + String revisionName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, containerAppName, revisionName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ContainerAppsFunctionImpl(inner1, this.manager())); + } + + private ContainerAppsRevisionFunctionsClient 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/ContainerAppsRevisionReplicasClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionReplicasClientImpl.java index 92f50bbaa145..8808b183f6c7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionReplicasClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionReplicasClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -20,7 +20,6 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsRevisionReplicasClient; import com.azure.resourcemanager.appcontainers.fluent.models.ReplicaCollectionInner; import com.azure.resourcemanager.appcontainers.fluent.models.ReplicaInner; @@ -56,50 +55,48 @@ public final class ContainerAppsRevisionReplicasClientImpl implements ContainerA * The interface defining all the services for ContainerAppsApiClientContainerAppsRevisionReplicas to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientContainerAppsRevisionReplicas") public interface ContainerAppsRevisionReplicasService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/replicas/{replicaName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getReplica(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getReplica(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, - @PathParam("replicaName") String replicaName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("replicaName") String replicaName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/replicas/{replicaName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getReplicaSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getReplicaSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, - @PathParam("replicaName") String replicaName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("replicaName") String replicaName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/replicas") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listReplicas(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listReplicas(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/replicas") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listReplicasSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listReplicasSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -118,32 +115,10 @@ Response listReplicasSync(@HostParam("$host") String end @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getReplicaWithResponseAsync(String resourceGroupName, String containerAppName, String revisionName, String replicaName) { - 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 (replicaName == null) { - return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getReplica(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, revisionName, replicaName, this.client.getApiVersion(), accept, + .withContext(context -> service.getReplica(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, revisionName, replicaName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -183,35 +158,10 @@ private Mono getReplicaAsync(String resourceGroupName, String cont @ServiceMethod(returns = ReturnType.SINGLE) public Response getReplicaWithResponse(String resourceGroupName, String containerAppName, String revisionName, String replicaName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (revisionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter revisionName is required and cannot be null.")); - } - if (replicaName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getReplicaSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, revisionName, replicaName, this.client.getApiVersion(), accept, context); + return service.getReplicaSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, revisionName, replicaName, accept, + context); } /** @@ -248,29 +198,10 @@ public ReplicaInner getReplica(String resourceGroupName, String containerAppName @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listReplicasWithResponseAsync(String resourceGroupName, String containerAppName, String revisionName) { - 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.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listReplicas(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, revisionName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.listReplicas(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, revisionName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -307,31 +238,9 @@ private Mono listReplicasAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response listReplicasWithResponse(String resourceGroupName, String containerAppName, String revisionName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (revisionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter revisionName is required and cannot be null.")); - } final String accept = "application/json"; - return service.listReplicasSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, revisionName, this.client.getApiVersion(), accept, context); + return service.listReplicasSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, revisionName, accept, context); } /** @@ -349,6 +258,4 @@ public Response listReplicasWithResponse(String resource public ReplicaCollectionInner listReplicas(String resourceGroupName, String containerAppName, String revisionName) { return listReplicasWithResponse(resourceGroupName, containerAppName, revisionName, Context.NONE).getValue(); } - - private static final ClientLogger LOGGER = new ClientLogger(ContainerAppsRevisionReplicasClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionReplicasImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionReplicasImpl.java index 78840c5e4e64..5261ac19cdc3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionReplicasImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionReplicasImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -32,12 +32,8 @@ public Response getReplicaWithResponse(String resourceGroupName, String String revisionName, String replicaName, Context context) { Response inner = this.serviceClient() .getReplicaWithResponse(resourceGroupName, containerAppName, revisionName, replicaName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ReplicaImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ReplicaImpl(inner.getValue(), this.manager())); } public Replica getReplica(String resourceGroupName, String containerAppName, String revisionName, @@ -55,12 +51,8 @@ public Response listReplicasWithResponse(String resourceGroup String revisionName, Context context) { Response inner = this.serviceClient().listReplicasWithResponse(resourceGroupName, containerAppName, revisionName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ReplicaCollectionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ReplicaCollectionImpl(inner.getValue(), this.manager())); } public ReplicaCollection listReplicas(String resourceGroupName, String containerAppName, String revisionName) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionsClientImpl.java index d45936f3df3b..3847b1e48b86 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -25,11 +25,10 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsRevisionsClient; import com.azure.resourcemanager.appcontainers.fluent.models.RevisionInner; +import com.azure.resourcemanager.appcontainers.implementation.models.RevisionCollection; import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.appcontainers.models.RevisionCollection; import reactor.core.publisher.Mono; /** @@ -61,115 +60,115 @@ public final class ContainerAppsRevisionsClientImpl implements ContainerAppsRevi * The interface defining all the services for ContainerAppsApiClientContainerAppsRevisions to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientContainerAppsRevisions") public interface ContainerAppsRevisionsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listRevisions(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getRevision(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listRevisionsSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getRevisionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getRevision(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listRevisions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @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}/revisions/{revisionName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getRevisionSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listRevisionsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("containerAppName") String containerAppName, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/activate") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> activateRevision(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> activateRevision(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/activate") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response activateRevisionSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response activateRevisionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/deactivate") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> deactivateRevision(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> deactivateRevision(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/deactivate") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response deactivateRevisionSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deactivateRevisionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/restart") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> restartRevision(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> restartRevision(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/restart") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response restartRevisionSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response restartRevisionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> listRevisionsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -177,15 +176,90 @@ Mono> listRevisionsNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Response listRevisionsNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } + /** + * Get a revision of a 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. + * @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 revision of a Container App along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getRevisionWithResponseAsync(String resourceGroupName, + String containerAppName, String revisionName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getRevision(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, revisionName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a revision of a 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. + * @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 revision of a Container App on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getRevisionAsync(String resourceGroupName, String containerAppName, + String revisionName) { + return getRevisionWithResponseAsync(resourceGroupName, containerAppName, revisionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a revision of a 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. + * @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 revision of a Container App along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getRevisionWithResponse(String resourceGroupName, String containerAppName, + String revisionName, Context context) { + final String accept = "application/json"; + return service.getRevisionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, revisionName, accept, context); + } + + /** + * Get a revision of a 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. + * @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 revision of a Container App. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RevisionInner getRevision(String resourceGroupName, String containerAppName, String revisionName) { + return getRevisionWithResponse(resourceGroupName, containerAppName, revisionName, Context.NONE).getValue(); + } + /** * Get the Revisions for a given Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. + * @param containerAppName Name of the Container App. * @param filter The filter to apply on the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -196,26 +270,10 @@ Response listRevisionsNextSync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listRevisionsSinglePageAsync(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.listRevisions(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, this.client.getApiVersion(), filter, accept, context)) + .withContext(context -> service.listRevisions(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())); @@ -225,7 +283,7 @@ private Mono> listRevisionsSinglePageAsync(String r * Get the Revisions for a given Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. + * @param containerAppName Name of the Container App. * @param filter The filter to apply on the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -243,7 +301,7 @@ private PagedFlux listRevisionsAsync(String resourceGroupName, St * Get the Revisions for a given Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. + * @param containerAppName 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. @@ -260,7 +318,7 @@ private PagedFlux listRevisionsAsync(String resourceGroupName, St * Get the Revisions for a given Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. + * @param containerAppName Name of the Container App. * @param filter The filter to apply on the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -270,28 +328,10 @@ private PagedFlux listRevisionsAsync(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listRevisionsSinglePage(String resourceGroupName, String containerAppName, String filter) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listRevisionsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, this.client.getApiVersion(), filter, accept, Context.NONE); + = service.listRevisionsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, filter, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -300,7 +340,7 @@ private PagedResponse listRevisionsSinglePage(String resourceGrou * Get the Revisions for a given Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. + * @param containerAppName Name of the Container App. * @param filter The filter to apply on the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -311,28 +351,10 @@ private PagedResponse listRevisionsSinglePage(String resourceGrou @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listRevisionsSinglePage(String resourceGroupName, String containerAppName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listRevisionsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, this.client.getApiVersion(), filter, accept, context); + = service.listRevisionsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, filter, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -341,7 +363,7 @@ private PagedResponse listRevisionsSinglePage(String resourceGrou * Get the Revisions for a given Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. + * @param containerAppName 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. @@ -358,7 +380,7 @@ public PagedIterable listRevisions(String resourceGroupName, Stri * Get the Revisions for a given Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. + * @param containerAppName Name of the Container App. * @param filter The filter to apply on the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -373,122 +395,6 @@ public PagedIterable listRevisions(String resourceGroupName, Stri nextLink -> listRevisionsNextSinglePage(nextLink, context)); } - /** - * Get a revision of a 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. - * @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 revision of a Container App along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getRevisionWithResponseAsync(String resourceGroupName, - String containerAppName, String revisionName) { - 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getRevision(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, revisionName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a revision of a 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. - * @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 revision of a Container App on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getRevisionAsync(String resourceGroupName, String containerAppName, - String revisionName) { - return getRevisionWithResponseAsync(resourceGroupName, containerAppName, revisionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a revision of a 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. - * @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 revision of a Container App along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getRevisionWithResponse(String resourceGroupName, String containerAppName, - String revisionName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (revisionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter revisionName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.getRevisionSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, revisionName, this.client.getApiVersion(), accept, context); - } - - /** - * Get a revision of a 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. - * @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 revision of a Container App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RevisionInner getRevision(String resourceGroupName, String containerAppName, String revisionName) { - return getRevisionWithResponse(resourceGroupName, containerAppName, revisionName, Context.NONE).getValue(); - } - /** * Activates a revision for a Container App. * @@ -503,29 +409,9 @@ public RevisionInner getRevision(String resourceGroupName, String containerAppNa @ServiceMethod(returns = ReturnType.SINGLE) private Mono> activateRevisionWithResponseAsync(String resourceGroupName, String containerAppName, String revisionName) { - 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.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.activateRevision(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, revisionName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.activateRevision(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, revisionName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -561,31 +447,8 @@ private Mono activateRevisionAsync(String resourceGroupName, String contai @ServiceMethod(returns = ReturnType.SINGLE) public Response activateRevisionWithResponse(String resourceGroupName, String containerAppName, String revisionName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (revisionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter revisionName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.activateRevisionSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, revisionName, this.client.getApiVersion(), accept, context); + return service.activateRevisionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, revisionName, context); } /** @@ -617,30 +480,9 @@ public void activateRevision(String resourceGroupName, String containerAppName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deactivateRevisionWithResponseAsync(String resourceGroupName, String containerAppName, String revisionName) { - 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.")); - } - final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.deactivateRevision(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, revisionName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.deactivateRevision(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, revisionName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -676,31 +518,8 @@ private Mono deactivateRevisionAsync(String resourceGroupName, String cont @ServiceMethod(returns = ReturnType.SINGLE) public Response deactivateRevisionWithResponse(String resourceGroupName, String containerAppName, String revisionName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (revisionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter revisionName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deactivateRevisionSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, revisionName, this.client.getApiVersion(), accept, context); + return service.deactivateRevisionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, revisionName, context); } /** @@ -732,29 +551,9 @@ public void deactivateRevision(String resourceGroupName, String containerAppName @ServiceMethod(returns = ReturnType.SINGLE) private Mono> restartRevisionWithResponseAsync(String resourceGroupName, String containerAppName, String revisionName) { - 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.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.restartRevision(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, revisionName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.restartRevision(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, revisionName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -790,31 +589,8 @@ private Mono restartRevisionAsync(String resourceGroupName, String contain @ServiceMethod(returns = ReturnType.SINGLE) public Response restartRevisionWithResponse(String resourceGroupName, String containerAppName, String revisionName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (revisionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter revisionName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.restartRevisionSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, revisionName, this.client.getApiVersion(), accept, context); + return service.restartRevisionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, revisionName, context); } /** @@ -846,13 +622,6 @@ public void restartRevision(String resourceGroupName, String containerAppName, S */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listRevisionsNextSinglePageAsync(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.listRevisionsNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -874,15 +643,6 @@ private Mono> listRevisionsNextSinglePageAsync(Stri */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listRevisionsNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listRevisionsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -904,21 +664,10 @@ private PagedResponse listRevisionsNextSinglePage(String nextLink */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listRevisionsNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listRevisionsNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(ContainerAppsRevisionsClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionsImpl.java index c882280ca305..8e75413aaa47 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -27,28 +27,12 @@ public ContainerAppsRevisionsImpl(ContainerAppsRevisionsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listRevisions(String resourceGroupName, String containerAppName) { - PagedIterable inner = this.serviceClient().listRevisions(resourceGroupName, containerAppName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RevisionImpl(inner1, this.manager())); - } - - public PagedIterable listRevisions(String resourceGroupName, String containerAppName, String filter, - Context context) { - PagedIterable inner - = this.serviceClient().listRevisions(resourceGroupName, containerAppName, filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RevisionImpl(inner1, this.manager())); - } - public Response getRevisionWithResponse(String resourceGroupName, String containerAppName, String revisionName, Context context) { Response inner = this.serviceClient().getRevisionWithResponse(resourceGroupName, containerAppName, revisionName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RevisionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RevisionImpl(inner.getValue(), this.manager())); } public Revision getRevision(String resourceGroupName, String containerAppName, String revisionName) { @@ -60,6 +44,18 @@ public Revision getRevision(String resourceGroupName, String containerAppName, S } } + public PagedIterable listRevisions(String resourceGroupName, String containerAppName) { + PagedIterable inner = this.serviceClient().listRevisions(resourceGroupName, containerAppName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RevisionImpl(inner1, this.manager())); + } + + public PagedIterable listRevisions(String resourceGroupName, String containerAppName, String filter, + Context context) { + PagedIterable inner + = this.serviceClient().listRevisions(resourceGroupName, containerAppName, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RevisionImpl(inner1, this.manager())); + } + public Response activateRevisionWithResponse(String resourceGroupName, String containerAppName, String revisionName, Context context) { return this.serviceClient() 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 index c689b4f6c6b7..6d473ec44bcc 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -31,12 +31,11 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; 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.SessionPoolCollection; +import com.azure.resourcemanager.appcontainers.implementation.models.SessionPoolCollection; import com.azure.resourcemanager.appcontainers.models.SessionPoolUpdatableProperties; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -71,141 +70,119 @@ public final class ContainerAppsSessionPoolsClientImpl implements ContainerAppsS * The interface defining all the services for ContainerAppsApiClientContainerAppsSessionPools to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientContainerAppsSessionPools") public interface ContainerAppsSessionPoolsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/sessionPools") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.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}/providers/Microsoft.App/sessionPools") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@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(ManagementException.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") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listByResourceGroupSync(@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(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("sessionPoolName") String sessionPoolName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("sessionPoolName") String sessionPoolName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getByResourceGroupSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("sessionPoolName") String sessionPoolName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("sessionPoolName") String sessionPoolName, @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(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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, + @PathParam("sessionPoolName") String sessionPoolName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") SessionPoolInner sessionPoolEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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, + @PathParam("sessionPoolName") String sessionPoolName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") SessionPoolInner sessionPoolEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @PathParam("sessionPoolName") String sessionPoolName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") SessionPoolUpdatableProperties sessionPoolEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @PathParam("sessionPoolName") String sessionPoolName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") SessionPoolUpdatableProperties sessionPoolEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("sessionPoolName") String sessionPoolName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("sessionPoolName") String sessionPoolName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("sessionPoolName") String sessionPoolName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("sessionPoolName") String sessionPoolName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Mono> listByResourceGroup(@HostParam("endpoint") 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/sessionPools") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") 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}/providers/Microsoft.App/sessionPools") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/sessionPools") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listBySubscriptionNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -213,7 +190,7 @@ Response listBySubscriptionNextSync( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -221,276 +198,24 @@ Mono> listByResourceGroupNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listByResourceGroupNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get the session pools in a given subscription. - * - * @throws 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 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. - * - * @throws 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 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. - * - * @throws 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 session pools in a given subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage() { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * 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 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 session pools in a given subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the session pools in a given subscription. - * - * @throws 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 session pools in a given subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(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 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 session pools in a given subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(() -> listSinglePage(context), - nextLink -> listBySubscriptionNextSinglePage(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 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 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 session pools in a given resource group of a subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listByResourceGroupSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, Context.NONE); - return 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. - * @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 session pools in a given resource group of a subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listByResourceGroupSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context); - return 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 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 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<>(() -> listByResourceGroupSinglePage(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePage(nextLink)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, 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. - * @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 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<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -506,27 +231,10 @@ public PagedIterable listByResourceGroup(String resourceGroupN @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)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sessionPoolName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -560,27 +268,9 @@ private Mono getByResourceGroupAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String sessionPoolName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (sessionPoolName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, sessionPoolName, this.client.getApiVersion(), accept, context); + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sessionPoolName, accept, context); } /** @@ -614,32 +304,12 @@ public SessionPoolInner getByResourceGroup(String resourceGroupName, String sess @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 contentType = "application/json"; 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)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sessionPoolName, contentType, accept, + sessionPoolEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -659,33 +329,11 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String sessionPoolName, SessionPoolInner sessionPoolEnvelope) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (sessionPoolName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); - } - if (sessionPoolEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter sessionPoolEnvelope is required and cannot be null.")); - } else { - sessionPoolEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - sessionPoolName, this.client.getApiVersion(), sessionPoolEnvelope, accept, Context.NONE); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sessionPoolName, contentType, accept, + sessionPoolEnvelope, Context.NONE); } /** @@ -705,33 +353,11 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String sessionPoolName, SessionPoolInner sessionPoolEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (sessionPoolName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); - } - if (sessionPoolEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter sessionPoolEnvelope is required and cannot be null.")); - } else { - sessionPoolEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - sessionPoolName, this.client.getApiVersion(), sessionPoolEnvelope, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sessionPoolName, contentType, accept, + sessionPoolEnvelope, context); } /** @@ -876,32 +502,12 @@ public SessionPoolInner createOrUpdate(String resourceGroupName, String sessionP @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 contentType = "application/json"; 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)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sessionPoolName, contentType, accept, + sessionPoolEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -921,33 +527,11 @@ private Mono>> updateWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String sessionPoolName, SessionPoolUpdatableProperties sessionPoolEnvelope) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (sessionPoolName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); - } - if (sessionPoolEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter sessionPoolEnvelope is required and cannot be null.")); - } else { - sessionPoolEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - sessionPoolName, this.client.getApiVersion(), sessionPoolEnvelope, accept, Context.NONE); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sessionPoolName, contentType, accept, + sessionPoolEnvelope, Context.NONE); } /** @@ -967,33 +551,11 @@ private Response updateWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String sessionPoolName, SessionPoolUpdatableProperties sessionPoolEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (sessionPoolName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); - } - if (sessionPoolEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter sessionPoolEnvelope is required and cannot be null.")); - } else { - sessionPoolEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - sessionPoolName, this.client.getApiVersion(), sessionPoolEnvelope, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sessionPoolName, contentType, accept, + sessionPoolEnvelope, context); } /** @@ -1135,26 +697,9 @@ public SessionPoolInner update(String resourceGroupName, String sessionPoolName, */ @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)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sessionPoolName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1172,27 +717,8 @@ private Mono>> deleteWithResponseAsync(String resource */ @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String sessionPoolName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (sessionPoolName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - sessionPoolName, this.client.getApiVersion(), accept, Context.NONE); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sessionPoolName, Context.NONE); } /** @@ -1210,27 +736,8 @@ private Response deleteWithResponse(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String sessionPoolName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (sessionPoolName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter sessionPoolName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - sessionPoolName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sessionPoolName, context); } /** @@ -1342,30 +849,126 @@ public void delete(String resourceGroupName, String sessionPoolName, Context con } /** - * Get the session pools in a given subscription. + * Get the session pools in a given resource group of a subscription. * - * Get the next page of items. + * @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 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) { + 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())); + } + + /** + * Get the session pools in a given resource group of a subscription. * - * @param nextLink The URL to get the next list of items. + * @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 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 session pools in a given resource group of a subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return 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. + * @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 session pools in a given resource group of a subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return 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 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 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<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(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 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 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<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * Get the session pools in a given subscription. + * + * @throws 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 session pools in a given subscription 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.")); - } + private Mono> listSinglePageAsync() { final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .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())); @@ -1374,28 +977,28 @@ private Mono> listBySubscriptionNextSinglePageAs /** * Get the session pools in a given subscription. * - * Get the next page of items. + * @throws 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 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 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 session pools in a given subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listSinglePage() { final String accept = "application/json"; - Response res - = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -1403,9 +1006,6 @@ private PagedResponse listBySubscriptionNextSinglePage(String /** * Get the session pools in a given subscription. * - * 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. @@ -1413,23 +1013,41 @@ private PagedResponse listBySubscriptionNextSinglePage(String * @return the session pools in a given subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listSinglePage(Context context) { final String accept = "application/json"; - Response res - = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } + /** + * Get the session pools in a given subscription. + * + * @throws 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 session pools in a given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(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 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 session pools in a given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + /** * Get the session pools in a given resource group of a subscription. * @@ -1444,13 +1062,6 @@ private PagedResponse listBySubscriptionNextSinglePage(String */ @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( @@ -1473,15 +1084,6 @@ private Mono> listByResourceGroupNextSinglePageA */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -1503,15 +1105,6 @@ private PagedResponse listByResourceGroupNextSinglePage(String */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); @@ -1519,5 +1112,67 @@ private PagedResponse listByResourceGroupNextSinglePage(String res.getValue().nextLink(), null); } - private static final ClientLogger LOGGER = new ClientLogger(ContainerAppsSessionPoolsClientImpl.class); + /** + * Get the session pools in a given subscription. + * + * 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 session pools in a given subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + 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 session pools in a given subscription. + * + * 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 session pools in a given subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the session pools in a given subscription. + * + * 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 session pools in a given subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 index d2d3a49315af..e82f002bbc2b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -27,36 +27,12 @@ public ContainerAppsSessionPoolsImpl(ContainerAppsSessionPoolsClient 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SessionPoolImpl(inner.getValue(), this.manager())); } public SessionPool getByResourceGroup(String resourceGroupName, String sessionPoolName) { @@ -76,6 +52,26 @@ public void delete(String resourceGroupName, String sessionPoolName, Context con this.serviceClient().delete(resourceGroupName, sessionPoolName, context); } + 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 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 SessionPool 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/ContainerAppsSourceControlsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSourceControlsClientImpl.java index efcf2617c2cb..7a8ab46b5d04 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -29,13 +29,12 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsSourceControlsClient; import com.azure.resourcemanager.appcontainers.fluent.models.SourceControlInner; +import com.azure.resourcemanager.appcontainers.implementation.models.SourceControlCollection; import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.appcontainers.models.SourceControlCollection; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -69,103 +68,99 @@ public final class ContainerAppsSourceControlsClientImpl implements ContainerApp * The interface defining all the services for ContainerAppsApiClientContainerAppsSourceControls to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientContainerAppsSourceControls") public interface ContainerAppsSourceControlsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listByContainerApp(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @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}/sourcecontrols") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listByContainerAppSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerAppName") String containerAppName, @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}/sourcecontrols/{sourceControlName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, - @PathParam("sourceControlName") String sourceControlName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("sourceControlName") String sourceControlName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{sourceControlName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, - @PathParam("sourceControlName") String sourceControlName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("sourceControlName") String sourceControlName, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{sourceControlName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, - @PathParam("sourceControlName") String sourceControlName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SourceControlInner sourceControlEnvelope, - @HeaderParam("Accept") String accept, Context context); + @PathParam("sourceControlName") String sourceControlName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") SourceControlInner sourceControlEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{sourceControlName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, - @PathParam("sourceControlName") String sourceControlName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SourceControlInner sourceControlEnvelope, - @HeaderParam("Accept") String accept, Context context); + @PathParam("sourceControlName") String sourceControlName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") SourceControlInner sourceControlEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{sourceControlName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, - @PathParam("sourceControlName") String sourceControlName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("sourceControlName") String sourceControlName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{sourceControlName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("containerAppName") String containerAppName, - @PathParam("sourceControlName") String sourceControlName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("sourceControlName") String sourceControlName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listByContainerApp(@HostParam("endpoint") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response listByContainerAppSync(@HostParam("endpoint") 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(DefaultErrorResponseErrorException.class) Mono> listByContainerAppNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -173,181 +168,10 @@ Mono> listByContainerAppNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Response listByContainerAppNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } - /** - * Get the Container App SourceControls in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName 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 the Container App SourceControls in a given resource group along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByContainerAppSinglePageAsync(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.listByContainerApp(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, 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 Container App SourceControls in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName 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 the Container App SourceControls in a given resource group as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByContainerAppAsync(String resourceGroupName, String containerAppName) { - return new PagedFlux<>(() -> listByContainerAppSinglePageAsync(resourceGroupName, containerAppName), - nextLink -> listByContainerAppNextSinglePageAsync(nextLink)); - } - - /** - * Get the Container App SourceControls in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName 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 the Container App SourceControls in a given resource group along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByContainerAppSinglePage(String resourceGroupName, - String containerAppName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listByContainerAppSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, this.client.getApiVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the Container App SourceControls in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName 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 the Container App SourceControls in a given resource group along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByContainerAppSinglePage(String resourceGroupName, - String containerAppName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listByContainerAppSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, this.client.getApiVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the Container App SourceControls in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName 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 the Container App SourceControls in a given resource group as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName) { - return new PagedIterable<>(() -> listByContainerAppSinglePage(resourceGroupName, containerAppName), - nextLink -> listByContainerAppNextSinglePage(nextLink)); - } - - /** - * Get the Container App SourceControls in a given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName 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 the Container App SourceControls in a given resource group as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, - Context context) { - return new PagedIterable<>(() -> listByContainerAppSinglePage(resourceGroupName, containerAppName, context), - nextLink -> listByContainerAppNextSinglePage(nextLink, context)); - } - /** * Get a SourceControl of a Container App. * @@ -362,30 +186,9 @@ public PagedIterable listByContainerApp(String resourceGroup @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String containerAppName, String sourceControlName) { - 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 (sourceControlName == null) { - return Mono - .error(new IllegalArgumentException("Parameter sourceControlName 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, sourceControlName, this.client.getApiVersion(), accept, context)) + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, sourceControlName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -422,31 +225,9 @@ private Mono getAsync(String resourceGroupName, String conta @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String containerAppName, String sourceControlName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (sourceControlName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter sourceControlName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, sourceControlName, this.client.getApiVersion(), accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, sourceControlName, accept, context); } /** @@ -480,37 +261,12 @@ public SourceControlInner get(String resourceGroupName, String containerAppName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String containerAppName, String sourceControlName, SourceControlInner sourceControlEnvelope) { - 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 (sourceControlName == null) { - return Mono - .error(new IllegalArgumentException("Parameter sourceControlName is required and cannot be null.")); - } - if (sourceControlEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter sourceControlEnvelope is required and cannot be null.")); - } else { - sourceControlEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, sourceControlName, this.client.getApiVersion(), - sourceControlEnvelope, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, sourceControlName, contentType, + accept, sourceControlEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -529,38 +285,11 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String containerAppName, String sourceControlName, SourceControlInner sourceControlEnvelope) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (sourceControlName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter sourceControlName is required and cannot be null.")); - } - if (sourceControlEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter sourceControlEnvelope is required and cannot be null.")); - } else { - sourceControlEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, sourceControlName, this.client.getApiVersion(), sourceControlEnvelope, accept, - Context.NONE); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, sourceControlName, contentType, + accept, sourceControlEnvelope, Context.NONE); } /** @@ -579,37 +308,11 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String containerAppName, String sourceControlName, SourceControlInner sourceControlEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (sourceControlName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter sourceControlName is required and cannot be null.")); - } - if (sourceControlEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter sourceControlEnvelope is required and cannot be null.")); - } else { - sourceControlEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, sourceControlName, this.client.getApiVersion(), sourceControlEnvelope, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, sourceControlName, contentType, + accept, sourceControlEnvelope, context); } /** @@ -750,30 +453,9 @@ public SourceControlInner createOrUpdate(String resourceGroupName, String contai @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String containerAppName, String sourceControlName) { - 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 (sourceControlName == null) { - return Mono - .error(new IllegalArgumentException("Parameter sourceControlName 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, sourceControlName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, sourceControlName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -791,31 +473,8 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String containerAppName, String sourceControlName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (sourceControlName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter sourceControlName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, sourceControlName, this.client.getApiVersion(), accept, Context.NONE); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, sourceControlName, Context.NONE); } /** @@ -833,31 +492,8 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String containerAppName, String sourceControlName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (sourceControlName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter sourceControlName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, sourceControlName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, sourceControlName, context); } /** @@ -966,6 +602,124 @@ public void delete(String resourceGroupName, String containerAppName, String sou beginDelete(resourceGroupName, containerAppName, sourceControlName, context).getFinalResult(); } + /** + * Get the Container App SourceControls in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the Container App SourceControls in a given resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByContainerAppSinglePageAsync(String resourceGroupName, + String containerAppName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByContainerApp(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())); + } + + /** + * Get the Container App SourceControls in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the Container App SourceControls in a given resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByContainerAppAsync(String resourceGroupName, String containerAppName) { + return new PagedFlux<>(() -> listByContainerAppSinglePageAsync(resourceGroupName, containerAppName), + nextLink -> listByContainerAppNextSinglePageAsync(nextLink)); + } + + /** + * Get the Container App SourceControls in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the Container App SourceControls in a given resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByContainerAppSinglePage(String resourceGroupName, + String containerAppName) { + final String accept = "application/json"; + Response res + = service.listByContainerAppSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the Container App SourceControls in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the Container App SourceControls in a given resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByContainerAppSinglePage(String resourceGroupName, + String containerAppName, Context context) { + final String accept = "application/json"; + Response res + = service.listByContainerAppSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the Container App SourceControls in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the Container App SourceControls in a given resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName) { + return new PagedIterable<>(() -> listByContainerAppSinglePage(resourceGroupName, containerAppName), + nextLink -> listByContainerAppNextSinglePage(nextLink)); + } + + /** + * Get the Container App SourceControls in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the Container App SourceControls in a given resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, + Context context) { + return new PagedIterable<>(() -> listByContainerAppSinglePage(resourceGroupName, containerAppName, context), + nextLink -> listByContainerAppNextSinglePage(nextLink, context)); + } + /** * Get the Container App SourceControls in a given resource group. * @@ -980,13 +734,6 @@ public void delete(String resourceGroupName, String containerAppName, String sou */ @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( @@ -1009,15 +756,6 @@ private Mono> listByContainerAppNextSinglePage */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByContainerAppNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listByContainerAppNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -1039,21 +777,10 @@ private PagedResponse listByContainerAppNextSinglePage(Strin */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByContainerAppNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listByContainerAppNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(ContainerAppsSourceControlsClientImpl.class); } 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 4f33cd3ab477..3ebdadb44acd 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -27,29 +27,12 @@ public ContainerAppsSourceControlsImpl(ContainerAppsSourceControlsClient innerCl this.serviceManager = serviceManager; } - public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName) { - PagedIterable inner - = this.serviceClient().listByContainerApp(resourceGroupName, containerAppName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SourceControlImpl(inner1, this.manager())); - } - - public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, - Context context) { - PagedIterable inner - = this.serviceClient().listByContainerApp(resourceGroupName, containerAppName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SourceControlImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String containerAppName, String sourceControlName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, containerAppName, sourceControlName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SourceControlImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SourceControlImpl(inner.getValue(), this.manager())); } public SourceControl get(String resourceGroupName, String containerAppName, String sourceControlName) { @@ -69,6 +52,19 @@ public void delete(String resourceGroupName, String containerAppName, String sou this.serviceClient().delete(resourceGroupName, containerAppName, sourceControlName, context); } + public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName) { + PagedIterable inner + = this.serviceClient().listByContainerApp(resourceGroupName, containerAppName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SourceControlImpl(inner1, this.manager())); + } + + public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, + Context context) { + PagedIterable inner + = this.serviceClient().listByContainerApp(resourceGroupName, containerAppName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SourceControlImpl(inner1, this.manager())); + } + public SourceControl 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/CustomHostnameAnalysisResultImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CustomHostnameAnalysisResultImpl.java index 189b97144b22..b3658cdd6e00 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CustomHostnameAnalysisResultImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CustomHostnameAnalysisResultImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; 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 892c270a15d9..fd92e30adee2 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; 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 000000000000..85d747c1b402 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPoliciesClientImpl.java @@ -0,0 +1,664 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.implementation.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("{endpoint}") + @ServiceInterface(name = "ContainerAppsApiClientDaprComponentResiliencyPolicies") + public interface DaprComponentResiliencyPoliciesService { + @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("componentName") String componentName, + @PathParam("name") String name, @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) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("componentName") String componentName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("componentName") String componentName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") DaprComponentResiliencyPolicyInner daprComponentResiliencyPolicyEnvelope, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("componentName") String componentName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") DaprComponentResiliencyPolicyInner daprComponentResiliencyPolicyEnvelope, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("componentName") String componentName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("componentName") String componentName, + @PathParam("name") String name, Context context); + + @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("componentName") String componentName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("componentName") String componentName, + @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a Dapr component resiliency policy. + * + * Gets the details of 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 Dapr component resiliency policy. + * + * Gets the details of a resiliency policy for a Dapr component 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) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, componentName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Dapr component resiliency policy. + * + * Gets the details of 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 Dapr component resiliency policy. + * + * Gets the details of a resiliency policy for a Dapr component 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. + * + * Gets the details of 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 a Dapr component resiliency policy. + * + * Gets the details of a resiliency policy for a Dapr component along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String environmentName, String componentName, String name, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, componentName, name, accept, context); + } + + /** + * Get a Dapr component resiliency policy. + * + * Gets the details of 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 Dapr component resiliency policy. + * + * Gets the details of a resiliency policy for a Dapr component. + */ + @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) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, componentName, name, contentType, + accept, daprComponentResiliencyPolicyEnvelope, 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. + * @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) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, componentName, name, contentType, + accept, daprComponentResiliencyPolicyEnvelope, 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. + */ + @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) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, componentName, name, 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. + * @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 service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, componentName, name, 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String environmentName, String componentName, String name) { + deleteWithResponse(resourceGroupName, environmentName, componentName, name, Context.NONE); + } + + /** + * Get the resiliency policies for a Dapr component. + * + * Lists the resiliency policies configured 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. + * + * Lists the resiliency policies configured 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) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, componentName, 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. + * + * Lists the resiliency policies configured 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. + * + * Lists the resiliency policies configured 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. + * + * Lists the resiliency policies configured 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. + * + * Lists the resiliency policies configured for a Dapr component along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String environmentName, String componentName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, componentName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the resiliency policies for a Dapr component. + * + * Lists the resiliency policies configured 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. + * + * Lists the resiliency policies configured for a Dapr component along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String environmentName, String componentName, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, componentName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the resiliency policies for a Dapr component. + * + * Lists the resiliency policies configured 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. + * + * Lists the resiliency policies configured 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<>(() -> listSinglePage(resourceGroupName, environmentName, componentName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Get the resiliency policies for a Dapr component. + * + * Lists the resiliency policies configured 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. + * + * Lists the resiliency policies configured 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<>(() -> listSinglePage(resourceGroupName, environmentName, componentName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the resiliency policies for a Dapr component. + * + * 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 the resiliency policies for a Dapr component. + * + * Lists the resiliency policies configured for a Dapr component along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 resiliency policies for a Dapr component. + * + * 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 the resiliency policies for a Dapr component. + * + * Lists the resiliency policies configured for a Dapr component along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the resiliency policies for a Dapr component. + * + * 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 the resiliency policies for a Dapr component. + * + * Lists the resiliency policies configured for a Dapr component along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 000000000000..822800df15fe --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentResiliencyPoliciesImpl.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 Response getWithResponse(String resourceGroupName, String environmentName, + String componentName, String name, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, environmentName, componentName, name, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DaprComponentResiliencyPolicyImpl(inner.getValue(), this.manager())); + } + + 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 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 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 000000000000..cc128bb1b076 --- /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) TypeSpec 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/DaprComponentsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsClientImpl.java index 7644d17cfabe..12c616974095 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -28,11 +28,10 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.DaprComponentsClient; import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentInner; import com.azure.resourcemanager.appcontainers.fluent.models.DaprSecretsCollectionInner; -import com.azure.resourcemanager.appcontainers.models.DaprComponentsCollection; +import com.azure.resourcemanager.appcontainers.implementation.models.DaprComponentsCollection; import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; import reactor.core.publisher.Mono; @@ -65,119 +64,115 @@ public final class DaprComponentsClientImpl implements DaprComponentsClient { * The interface defining all the services for ContainerAppsApiClientDaprComponents to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientDaprComponents") public interface DaprComponentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents") - @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}/daprComponents") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listSync(@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}/daprComponents/{componentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("componentName") String componentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DaprComponentInner daprComponentEnvelope, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DaprComponentInner daprComponentEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("componentName") String componentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DaprComponentInner daprComponentEnvelope, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DaprComponentInner daprComponentEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response deleteSync(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @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); + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/listSecrets") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSecrets(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listSecrets(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/listSecrets") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listSecretsSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listSecretsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @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, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -185,173 +180,7 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get the Dapr 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 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 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 Dapr 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 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 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 Dapr 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 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 Components for a managed environment along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String environmentName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the Dapr 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 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 Components for a managed environment along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String environmentName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the Dapr 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 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 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<>(() -> listSinglePage(resourceGroupName, environmentName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Get the Dapr 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 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 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<>(() -> listSinglePage(resourceGroupName, environmentName, context), - nextLink -> listNextSinglePage(nextLink, context)); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -368,29 +197,10 @@ public PagedIterable list(String resourceGroupName, String e @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(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.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, componentName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, componentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -426,31 +236,9 @@ private Mono getAsync(String resourceGroupName, String envir @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String environmentName, String componentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (componentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, componentName, this.client.getApiVersion(), accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, componentName, accept, context); } /** @@ -486,36 +274,12 @@ public DaprComponentInner get(String resourceGroupName, String environmentName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String environmentName, String componentName, DaprComponentInner daprComponentEnvelope) { - 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 (daprComponentEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter daprComponentEnvelope is required and cannot be null.")); - } else { - daprComponentEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, componentName, this.client.getApiVersion(), daprComponentEnvelope, - accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, componentName, contentType, accept, + daprComponentEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -558,37 +322,11 @@ private Mono createOrUpdateAsync(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, String componentName, DaprComponentInner daprComponentEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (componentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); - } - if (daprComponentEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter daprComponentEnvelope is required and cannot be null.")); - } else { - daprComponentEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, componentName, this.client.getApiVersion(), daprComponentEnvelope, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, componentName, contentType, accept, + daprComponentEnvelope, context); } /** @@ -628,29 +366,9 @@ public DaprComponentInner createOrUpdate(String resourceGroupName, String enviro @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(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.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, componentName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, componentName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -690,31 +408,8 @@ private Mono deleteAsync(String resourceGroupName, String environmentName, @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String environmentName, String componentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (componentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, componentName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, componentName, context); } /** @@ -734,6 +429,120 @@ public void delete(String resourceGroupName, String environmentName, String comp deleteWithResponse(resourceGroupName, environmentName, componentName, Context.NONE); } + /** + * Get the Dapr 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 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 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) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, 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 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 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 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 Dapr 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 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 Components for a managed environment along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String environmentName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the Dapr 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 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 Components for a managed environment along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String environmentName, + Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the Dapr 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 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 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<>(() -> listSinglePage(resourceGroupName, environmentName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Get the Dapr 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 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 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<>(() -> listSinglePage(resourceGroupName, environmentName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + /** * List secrets for a dapr component. * @@ -749,29 +558,10 @@ public void delete(String resourceGroupName, String environmentName, String comp @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSecretsWithResponseAsync(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.listSecrets(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, componentName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.listSecrets(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, componentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -808,31 +598,9 @@ private Mono listSecretsAsync(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) public Response listSecretsWithResponse(String resourceGroupName, String environmentName, String componentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (componentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter componentName is required and cannot be null.")); - } final String accept = "application/json"; - return service.listSecretsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, componentName, this.client.getApiVersion(), accept, context); + return service.listSecretsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, componentName, accept, context); } /** @@ -866,13 +634,6 @@ public DaprSecretsCollectionInner listSecrets(String resourceGroupName, String e */ @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(), @@ -893,15 +654,6 @@ private Mono> listNextSinglePageAsync(String n */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -923,21 +675,10 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(DaprComponentsClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsImpl.java index e08035e86f85..1d4d98340abc 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -29,27 +29,12 @@ public DaprComponentsImpl(DaprComponentsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String environmentName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, environmentName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DaprComponentImpl(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 DaprComponentImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String environmentName, String componentName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, environmentName, componentName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DaprComponentImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DaprComponentImpl(inner.getValue(), this.manager())); } public DaprComponent get(String resourceGroupName, String environmentName, String componentName) { @@ -66,12 +51,8 @@ public Response createOrUpdateWithResponse(String resourceGroupNa Response inner = this.serviceClient() .createOrUpdateWithResponse(resourceGroupName, environmentName, componentName, daprComponentEnvelope, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DaprComponentImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DaprComponentImpl(inner.getValue(), this.manager())); } public DaprComponent createOrUpdate(String resourceGroupName, String environmentName, String componentName, @@ -94,16 +75,23 @@ public void delete(String resourceGroupName, String environmentName, String comp this.serviceClient().delete(resourceGroupName, environmentName, componentName); } + public PagedIterable list(String resourceGroupName, String environmentName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, environmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DaprComponentImpl(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 DaprComponentImpl(inner1, this.manager())); + } + public Response listSecretsWithResponse(String resourceGroupName, String environmentName, String componentName, Context context) { Response inner = this.serviceClient().listSecretsWithResponse(resourceGroupName, environmentName, componentName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DaprSecretsCollectionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DaprSecretsCollectionImpl(inner.getValue(), this.manager())); } public DaprSecretsCollection listSecrets(String resourceGroupName, String environmentName, String componentName) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSecretsCollectionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSecretsCollectionImpl.java index 2aa4eff3aa20..fa9877ddd7f1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSecretsCollectionImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSecretsCollectionImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DiagnosticsCollectionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DiagnosticsCollectionImpl.java index b9602fa4b966..6c0ba2e325b7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DiagnosticsCollectionImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DiagnosticsCollectionImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DiagnosticsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DiagnosticsImpl.java index 30dee7a892ec..9fcb82ad1fab 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DiagnosticsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DiagnosticsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; 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 000000000000..6bd094fc4b11 --- /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) TypeSpec 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 000000000000..66b139ebc64e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DotNetComponentsClientImpl.java @@ -0,0 +1,1080 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.BinaryData; +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.implementation.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("{endpoint}") + @ServiceInterface(name = "ContainerAppsApiClientDotNetComponents") + public interface DotNetComponentsService { + @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("name") String name, + @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) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DotNetComponentInner dotNetComponentEnvelope, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DotNetComponentInner dotNetComponentEnvelope, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DotNetComponentInner dotNetComponentEnvelope, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DotNetComponentInner dotNetComponentEnvelope, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @PathParam("name") String name, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a .NET Component. + * + * Gets the details of 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + * + * Gets the details of a .NET component in a managed environment along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String environmentName, + String name) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a .NET Component. + * + * Gets the details of 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + * + * Gets the details of a .NET component in a managed environment 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. + * + * Gets the details of 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 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. + * + * Gets the details of a .NET component in a managed environment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String environmentName, String name, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, name, accept, context); + } + + /** + * Get a .NET Component. + * + * Gets the details of 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + * + * Gets the details of a .NET component in a managed environment. + */ + @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) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, name, contentType, accept, + dotNetComponentEnvelope, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, + String name, DotNetComponentInner dotNetComponentEnvelope) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, name, contentType, accept, + dotNetComponentEnvelope, Context.NONE); + } + + /** + * 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, + String name, DotNetComponentInner dotNetComponentEnvelope, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, name, contentType, accept, + dotNetComponentEnvelope, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) { + Response response + = createOrUpdateWithResponse(resourceGroupName, environmentName, name, dotNetComponentEnvelope); + return this.client.getLroResult(response, + DotNetComponentInner.class, DotNetComponentInner.class, Context.NONE); + } + + /** + * 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) { + Response response + = createOrUpdateWithResponse(resourceGroupName, environmentName, name, dotNetComponentEnvelope, context); + return this.client.getLroResult(response, + 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 .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 beginCreateOrUpdate(resourceGroupName, environmentName, name, dotNetComponentEnvelope).getFinalResult(); + } + + /** + * 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 beginCreateOrUpdate(resourceGroupName, environmentName, name, dotNetComponentEnvelope, context) + .getFinalResult(); + } + + /** + * 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) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, name, contentType, accept, + dotNetComponentEnvelope, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String environmentName, String name, + DotNetComponentInner dotNetComponentEnvelope) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, name, contentType, accept, + dotNetComponentEnvelope, Context.NONE); + } + + /** + * 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String environmentName, String name, + DotNetComponentInner dotNetComponentEnvelope, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, name, contentType, accept, + dotNetComponentEnvelope, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) { + Response response + = updateWithResponse(resourceGroupName, environmentName, name, dotNetComponentEnvelope); + return this.client.getLroResult(response, + DotNetComponentInner.class, DotNetComponentInner.class, Context.NONE); + } + + /** + * 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) { + Response response + = updateWithResponse(resourceGroupName, environmentName, name, dotNetComponentEnvelope, context); + return this.client.getLroResult(response, + 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 .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 beginUpdate(resourceGroupName, environmentName, name, dotNetComponentEnvelope).getFinalResult(); + } + + /** + * 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 beginUpdate(resourceGroupName, environmentName, name, dotNetComponentEnvelope, context).getFinalResult(); + } + + /** + * Delete a .NET Component. + * + * Deletes a .NET component 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 .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) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, name, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a .NET Component. + * + * Deletes a .NET component 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 .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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String environmentName, String name) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, name, Context.NONE); + } + + /** + * Delete a .NET Component. + * + * Deletes a .NET component 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 .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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String environmentName, String name, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, name, context); + } + + /** + * Delete a .NET Component. + * + * Deletes a .NET component 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 .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. + * + * Deletes a .NET component 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 .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) { + Response response = deleteWithResponse(resourceGroupName, environmentName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a .NET Component. + * + * Deletes a .NET component 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 .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) { + Response response = deleteWithResponse(resourceGroupName, environmentName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a .NET Component. + * + * Deletes a .NET component 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 .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. + * + * Deletes a .NET component 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 .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) { + beginDelete(resourceGroupName, environmentName, name).getFinalResult(); + } + + /** + * Delete a .NET Component. + * + * Deletes a .NET component 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 .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) { + beginDelete(resourceGroupName, environmentName, name, context).getFinalResult(); + } + + /** + * Get the .NET Components for a managed environment. + * + * Lists the .NET components in 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. + * + * Lists the .NET components in a managed environment along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String environmentName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, 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. + * + * Lists the .NET components in 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. + * + * Lists the .NET components in 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. + * + * Lists the .NET components in 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. + * + * Lists the .NET components in a managed environment along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String environmentName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the .NET Components for a managed environment. + * + * Lists the .NET components 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 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. + * + * Lists the .NET components in a managed environment along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String environmentName, + Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the .NET Components for a managed environment. + * + * Lists the .NET components in 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. + * + * Lists the .NET components in a managed environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, environmentName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Get the .NET Components for a managed environment. + * + * Lists the .NET components 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 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. + * + * Lists the .NET components in 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<>(() -> listSinglePage(resourceGroupName, environmentName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the .NET Components for a managed environment. + * + * 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 .NET Components for a managed environment. + * + * Lists the .NET components in a managed environment along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 .NET Components for a managed environment. + * + * 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 .NET Components for a managed environment. + * + * Lists the .NET components in a managed environment along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the .NET Components for a managed environment. + * + * 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 .NET Components for a managed environment. + * + * Lists the .NET components in a managed environment along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 000000000000..f1971b1fc1ca --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DotNetComponentsImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 Response getWithResponse(String resourceGroupName, String environmentName, String name, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, environmentName, name, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DotNetComponentImpl(inner.getValue(), this.manager())); + } + + 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 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 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/EnvironmentAuthTokenImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/EnvironmentAuthTokenImpl.java index 3e719b07d22a..2d651888a355 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/EnvironmentAuthTokenImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/EnvironmentAuthTokenImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; 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 000000000000..372cea68dbbd --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/FunctionsExtensionsClientImpl.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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("{endpoint}") + @ServiceInterface(name = "ContainerAppsApiClientFunctionsExtensions") + 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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, + @PathParam("functionAppName") String functionAppName, @HeaderParam("Accept") String accept, + Context context); + + @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) + Response invokeFunctionsHostSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, @PathParam("revisionName") String revisionName, + @PathParam("functionAppName") String functionAppName, @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. + * @param functionAppName Name of the Function. + * @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 sequence of textual characters 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) { + final String accept = "text/plain"; + return FluxUtil + .withContext(context -> service.invokeFunctionsHost(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, revisionName, functionAppName, + 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. + * @param functionAppName Name of the Function. + * @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 sequence of textual characters 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. + * @param functionAppName Name of the Function. + * @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 sequence of textual characters along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response invokeFunctionsHostWithResponse(String resourceGroupName, String containerAppName, + String revisionName, String functionAppName, Context context) { + final String accept = "text/plain"; + return service.invokeFunctionsHostSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, revisionName, functionAppName, 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. + * @param functionAppName Name of the Function. + * @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 sequence of textual characters. + */ + @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 000000000000..cfbf97fd9cb7 --- /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) TypeSpec 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/HttpRouteConfigImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/HttpRouteConfigImpl.java index 223c66ee38d3..91a98f7634f1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/HttpRouteConfigImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/HttpRouteConfigImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/HttpRouteConfigsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/HttpRouteConfigsClientImpl.java index 70294a332b89..09e691021dc7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/HttpRouteConfigsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/HttpRouteConfigsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -31,13 +31,12 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.appcontainers.fluent.HttpRouteConfigsClient; import com.azure.resourcemanager.appcontainers.fluent.models.HttpRouteConfigInner; +import com.azure.resourcemanager.appcontainers.implementation.models.HttpRouteConfigCollection; import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.appcontainers.models.HttpRouteConfigCollection; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -71,123 +70,117 @@ public final class HttpRouteConfigsClientImpl implements HttpRouteConfigsClient * The interface defining all the services for ContainerAppsApiClientHttpRouteConfigs to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientHttpRouteConfigs") public interface HttpRouteConfigsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("httpRouteName") String httpRouteName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("httpRouteName") String httpRouteName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("httpRouteName") String httpRouteName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") HttpRouteConfigInner httpRouteConfigEnvelope, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, + @BodyParam("application/json") HttpRouteConfigInner httpRouteConfigEnvelope, Context context); @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("httpRouteName") String httpRouteName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") HttpRouteConfigInner httpRouteConfigEnvelope, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, + @BodyParam("application/json") HttpRouteConfigInner httpRouteConfigEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("httpRouteName") String httpRouteName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") HttpRouteConfigInner httpRouteConfigEnvelope, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HttpRouteConfigInner httpRouteConfigEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response updateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("httpRouteName") String httpRouteName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") HttpRouteConfigInner httpRouteConfigEnvelope, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HttpRouteConfigInner httpRouteConfigEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("httpRouteName") String httpRouteName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("httpRouteName") String httpRouteName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @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, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -195,59 +188,48 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Get the specified Http Route Config. * + * Get the specified Managed Http Route Config. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. - * @param httpRouteName Name of the Http Route Config Resource. + * @param environmentName Name of the managed environment. + * @param httpRouteName Name of the Http Route Config. * @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 specified Http Route Config along with {@link Response} on successful completion of {@link Mono}. + * @return the specified Http Route Config. + * + * Get the specified Managed Http Route Config along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String environmentName, String httpRouteName) { - 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 (httpRouteName == null) { - return Mono.error(new IllegalArgumentException("Parameter httpRouteName 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, httpRouteName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, httpRouteName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the specified Http Route Config. * + * Get the specified Managed Http Route Config. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. - * @param httpRouteName Name of the Http Route Config Resource. + * @param environmentName Name of the managed environment. + * @param httpRouteName Name of the Http Route Config. * @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 specified Http Route Config on successful completion of {@link Mono}. + * @return the specified Http Route Config. + * + * Get the specified Managed Http Route Config on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String environmentName, @@ -259,55 +241,41 @@ private Mono getAsync(String resourceGroupName, String env /** * Get the specified Http Route Config. * + * Get the specified Managed Http Route Config. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. - * @param httpRouteName Name of the Http Route Config Resource. + * @param environmentName Name of the managed environment. + * @param httpRouteName Name of the Http Route Config. * @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 specified Http Route Config along with {@link Response}. + * @return the specified Http Route Config. + * + * Get the specified Managed Http Route Config along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String environmentName, String httpRouteName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (httpRouteName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter httpRouteName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, httpRouteName, this.client.getApiVersion(), accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, httpRouteName, accept, context); } /** * Get the specified Http Route Config. * + * Get the specified Managed Http Route Config. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. - * @param httpRouteName Name of the Http Route Config Resource. + * @param environmentName Name of the managed environment. + * @param httpRouteName Name of the Http Route Config. * @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 specified Http Route Config. + * + * Get the specified Managed Http Route Config. */ @ServiceMethod(returns = ReturnType.SINGLE) public HttpRouteConfigInner get(String resourceGroupName, String environmentName, String httpRouteName) { @@ -318,9 +286,9 @@ public HttpRouteConfigInner get(String resourceGroupName, String environmentName * Create or Update a Http Route Config. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. - * @param httpRouteName Name of the Http Route Config Resource. - * @param httpRouteConfigEnvelope Http Route Config to be created or updated. + * @param environmentName Name of the managed environment. + * @param httpRouteName Name of the Http Route Config. + * @param httpRouteConfigEnvelope Http Route config to be created or updated. * @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. @@ -330,33 +298,11 @@ public HttpRouteConfigInner get(String resourceGroupName, String environmentName @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String environmentName, String httpRouteName, HttpRouteConfigInner httpRouteConfigEnvelope) { - 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 (httpRouteName == null) { - return Mono.error(new IllegalArgumentException("Parameter httpRouteName is required and cannot be null.")); - } - if (httpRouteConfigEnvelope != null) { - httpRouteConfigEnvelope.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, httpRouteName, this.client.getApiVersion(), httpRouteConfigEnvelope, - accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, httpRouteName, accept, + httpRouteConfigEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -364,8 +310,8 @@ private Mono> createOrUpdateWithResponseAsync(Str * Create or Update a Http Route Config. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. - * @param httpRouteName Name of the Http Route Config Resource. + * @param environmentName Name of the managed environment. + * @param httpRouteName Name of the Http Route Config. * @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. @@ -384,9 +330,9 @@ private Mono createOrUpdateAsync(String resourceGroupName, * Create or Update a Http Route Config. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. - * @param httpRouteName Name of the Http Route Config Resource. - * @param httpRouteConfigEnvelope Http Route Config to be created or updated. + * @param environmentName Name of the managed environment. + * @param httpRouteName Name of the Http Route Config. + * @param httpRouteConfigEnvelope Http Route config to be created or updated. * @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. @@ -397,42 +343,18 @@ private Mono createOrUpdateAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, String httpRouteName, HttpRouteConfigInner httpRouteConfigEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (httpRouteName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter httpRouteName is required and cannot be null.")); - } - if (httpRouteConfigEnvelope != null) { - httpRouteConfigEnvelope.validate(); - } final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, httpRouteName, this.client.getApiVersion(), httpRouteConfigEnvelope, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, httpRouteName, accept, + httpRouteConfigEnvelope, context); } /** * Create or Update a Http Route Config. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. - * @param httpRouteName Name of the Http Route Config Resource. + * @param environmentName Name of the managed environment. + * @param httpRouteName Name of the Http Route Config. * @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. @@ -448,10 +370,10 @@ public HttpRouteConfigInner createOrUpdate(String resourceGroupName, String envi /** * Update tags of a Http Route Config object * - * Patches a Http Route Config resource. Only patching of tags is supported. + * Patches an http route config resource. Only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param httpRouteName Name of the Http Route Config Resource. * @param httpRouteConfigEnvelope Properties of http route config that need to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -463,46 +385,22 @@ public HttpRouteConfigInner createOrUpdate(String resourceGroupName, String envi @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String environmentName, String httpRouteName, HttpRouteConfigInner httpRouteConfigEnvelope) { - 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 (httpRouteName == null) { - return Mono.error(new IllegalArgumentException("Parameter httpRouteName is required and cannot be null.")); - } - if (httpRouteConfigEnvelope == null) { - return Mono.error( - new IllegalArgumentException("Parameter httpRouteConfigEnvelope is required and cannot be null.")); - } else { - httpRouteConfigEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, httpRouteName, this.client.getApiVersion(), httpRouteConfigEnvelope, - accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, httpRouteName, contentType, accept, + httpRouteConfigEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update tags of a Http Route Config object * - * Patches a Http Route Config resource. Only patching of tags is supported. + * Patches an http route config resource. Only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param httpRouteName Name of the Http Route Config Resource. * @param httpRouteConfigEnvelope Properties of http route config that need to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -521,10 +419,10 @@ private Mono updateAsync(String resourceGroupName, String /** * Update tags of a Http Route Config object * - * Patches a Http Route Config resource. Only patching of tags is supported. + * Patches an http route config resource. Only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param httpRouteName Name of the Http Route Config Resource. * @param httpRouteConfigEnvelope Properties of http route config that need to be updated. * @param context The context to associate with this operation. @@ -537,46 +435,20 @@ private Mono updateAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse(String resourceGroupName, String environmentName, String httpRouteName, HttpRouteConfigInner httpRouteConfigEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (httpRouteName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter httpRouteName is required and cannot be null.")); - } - if (httpRouteConfigEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter httpRouteConfigEnvelope is required and cannot be null.")); - } else { - httpRouteConfigEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, httpRouteName, this.client.getApiVersion(), httpRouteConfigEnvelope, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, httpRouteName, contentType, accept, + httpRouteConfigEnvelope, context); } /** * Update tags of a Http Route Config object * - * Patches a Http Route Config resource. Only patching of tags is supported. + * Patches an http route config resource. Only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param httpRouteName Name of the Http Route Config Resource. * @param httpRouteConfigEnvelope Properties of http route config that need to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -594,8 +466,10 @@ public HttpRouteConfigInner update(String resourceGroupName, String environmentN /** * Deletes the specified Http Route Config. * + * Deletes the specified Managed Http Route. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param httpRouteName Name of the Http Route Config Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -605,37 +479,19 @@ public HttpRouteConfigInner update(String resourceGroupName, String environmentN @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String environmentName, String httpRouteName) { - 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 (httpRouteName == null) { - return Mono.error(new IllegalArgumentException("Parameter httpRouteName 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, httpRouteName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, httpRouteName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes the specified Http Route Config. * + * Deletes the specified Managed Http Route. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param httpRouteName Name of the Http Route Config Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -645,38 +501,17 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String environmentName, String httpRouteName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (httpRouteName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter httpRouteName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, httpRouteName, this.client.getApiVersion(), accept, Context.NONE); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, httpRouteName, Context.NONE); } /** * Deletes the specified Http Route Config. * + * Deletes the specified Managed Http Route. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param httpRouteName Name of the Http Route Config Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -687,38 +522,17 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String environmentName, String httpRouteName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (httpRouteName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter httpRouteName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, httpRouteName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, httpRouteName, context); } /** * Deletes the specified Http Route Config. * + * Deletes the specified Managed Http Route. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param httpRouteName Name of the Http Route Config Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -737,8 +551,10 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup /** * Deletes the specified Http Route Config. * + * Deletes the specified Managed Http Route. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param httpRouteName Name of the Http Route Config Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -755,8 +571,10 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Deletes the specified Http Route Config. * + * Deletes the specified Managed Http Route. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param httpRouteName Name of the Http Route Config Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -774,8 +592,10 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Deletes the specified Http Route Config. * + * Deletes the specified Managed Http Route. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param httpRouteName Name of the Http Route Config Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -791,8 +611,10 @@ private Mono deleteAsync(String resourceGroupName, String environmentName, /** * Deletes the specified Http Route Config. * + * Deletes the specified Managed Http Route. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param httpRouteName Name of the Http Route Config Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -806,8 +628,10 @@ public void delete(String resourceGroupName, String environmentName, String http /** * Deletes the specified Http Route Config. * + * Deletes the specified Managed Http Route. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param httpRouteName Name of the Http Route Config Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -822,8 +646,10 @@ public void delete(String resourceGroupName, String environmentName, String http /** * List the Http Route Configs in a given managed environment. * + * Get the Managed Http Routes in 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 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. @@ -833,26 +659,10 @@ public void delete(String resourceGroupName, String environmentName, String http @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)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, 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())); @@ -861,8 +671,10 @@ private Mono> listSinglePageAsync(String res /** * List the Http Route Configs in a given managed environment. * + * Get the Managed Http Routes in 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 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. @@ -877,8 +689,10 @@ private PagedFlux listAsync(String resourceGroupName, Stri /** * List the Http Route Configs in a given managed environment. * + * Get the Managed Http Routes in 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 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. @@ -886,28 +700,10 @@ private PagedFlux listAsync(String resourceGroupName, Stri */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String environmentName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, Context.NONE); + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -915,8 +711,10 @@ private PagedResponse listSinglePage(String resourceGroupN /** * List the Http Route Configs in a given managed environment. * + * Get the Managed Http Routes in 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 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. @@ -926,28 +724,10 @@ private PagedResponse listSinglePage(String resourceGroupN @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String environmentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, context); + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -955,8 +735,10 @@ private PagedResponse listSinglePage(String resourceGroupN /** * List the Http Route Configs in a given managed environment. * + * Get the Managed Http Routes in 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 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. @@ -971,8 +753,10 @@ public PagedIterable list(String resourceGroupName, String /** * List the Http Route Configs in a given managed environment. * + * Get the Managed Http Routes in 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 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. @@ -999,13 +783,6 @@ public PagedIterable list(String resourceGroupName, String */ @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(), @@ -1026,15 +803,6 @@ private Mono> listNextSinglePageAsync(String */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -1056,21 +824,10 @@ private PagedResponse listNextSinglePage(String nextLink) */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(HttpRouteConfigsClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/HttpRouteConfigsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/HttpRouteConfigsImpl.java index 51abc3eb72d6..cc5550274173 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/HttpRouteConfigsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/HttpRouteConfigsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -31,12 +31,8 @@ public Response getWithResponse(String resourceGroupName, Strin String httpRouteName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, environmentName, httpRouteName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new HttpRouteConfigImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HttpRouteConfigImpl(inner.getValue(), this.manager())); } public HttpRouteConfig get(String resourceGroupName, String environmentName, String httpRouteName) { 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 index e061b5f4d088..bf3a536bad2b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; 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 index 7917b69dd7be..21ea9b8edac8 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -31,12 +31,11 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; 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 com.azure.resourcemanager.appcontainers.implementation.models.JavaComponentsCollection; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -70,123 +69,113 @@ public final class JavaComponentsClientImpl implements JavaComponentsClient { * The interface defining all the services for ContainerAppsApiClientJavaComponents to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientJavaComponents") 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") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@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, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @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) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @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, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") JavaComponentInner javaComponentEnvelope, 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) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") JavaComponentInner javaComponentEnvelope, 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, + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") JavaComponentInner javaComponentEnvelope, 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) - Response updateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") JavaComponentInner javaComponentEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "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, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @PathParam("environmentName") String environmentName, @PathParam("name") String name, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents/{name}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @PathParam("environmentName") String environmentName, @PathParam("name") String name, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @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, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -194,180 +183,14 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String environmentName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, Context.NONE); - return 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. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String environmentName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, context); - return 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 PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String environmentName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, environmentName), - nextLink -> listNextSinglePage(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 PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String environmentName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, environmentName, context), - nextLink -> listNextSinglePage(nextLink, context)); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, 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 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. @@ -377,29 +200,10 @@ public PagedIterable list(String resourceGroupName, String e @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)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, name, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -407,7 +211,7 @@ private Mono> getWithResponseAsync(String resourceG * 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 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. @@ -424,7 +228,7 @@ private Mono getAsync(String resourceGroupName, String envir * 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 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. @@ -435,37 +239,16 @@ private Mono getAsync(String resourceGroupName, String envir @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String environmentName, String name, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (name == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, name, this.client.getApiVersion(), accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, name, 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 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. @@ -483,7 +266,7 @@ public JavaComponentInner get(String resourceGroupName, String environmentName, * 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 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. @@ -494,36 +277,12 @@ public JavaComponentInner get(String resourceGroupName, String environmentName, @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 contentType = "application/json"; 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)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, name, contentType, accept, + javaComponentEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -533,7 +292,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * 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 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. @@ -544,36 +303,11 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, String name, JavaComponentInner javaComponentEnvelope) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (name == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (javaComponentEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter javaComponentEnvelope is required and cannot be null.")); - } else { - javaComponentEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, name, this.client.getApiVersion(), javaComponentEnvelope, accept, Context.NONE); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, name, contentType, accept, + javaComponentEnvelope, Context.NONE); } /** @@ -582,7 +316,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName * 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 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. @@ -594,36 +328,11 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, String name, JavaComponentInner javaComponentEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (name == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (javaComponentEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter javaComponentEnvelope is required and cannot be null.")); - } else { - javaComponentEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, name, this.client.getApiVersion(), javaComponentEnvelope, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, name, contentType, accept, + javaComponentEnvelope, context); } /** @@ -632,7 +341,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName * 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 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. @@ -655,7 +364,7 @@ private PollerFlux, JavaComponentInner> beginCrea * 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 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. @@ -678,7 +387,7 @@ public SyncPoller, JavaComponentInner> beginCreat * 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 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. @@ -702,7 +411,7 @@ public SyncPoller, JavaComponentInner> beginCreat * 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 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. @@ -723,7 +432,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, S * 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 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. @@ -743,7 +452,7 @@ public JavaComponentInner createOrUpdate(String resourceGroupName, String enviro * 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 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. @@ -765,7 +474,7 @@ public JavaComponentInner createOrUpdate(String resourceGroupName, String enviro * 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 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. @@ -776,36 +485,12 @@ public JavaComponentInner createOrUpdate(String resourceGroupName, String enviro @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 contentType = "application/json"; 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)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, name, contentType, accept, + javaComponentEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -815,7 +500,7 @@ private Mono>> updateWithResponseAsync(String resource * 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 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. @@ -826,36 +511,11 @@ private Mono>> updateWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String environmentName, String name, JavaComponentInner javaComponentEnvelope) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (name == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (javaComponentEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter javaComponentEnvelope is required and cannot be null.")); - } else { - javaComponentEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, name, this.client.getApiVersion(), javaComponentEnvelope, accept, Context.NONE); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, name, contentType, accept, + javaComponentEnvelope, Context.NONE); } /** @@ -864,7 +524,7 @@ private Response updateWithResponse(String resourceGroupName, String * 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 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. @@ -876,36 +536,11 @@ private Response updateWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String environmentName, String name, JavaComponentInner javaComponentEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (name == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (javaComponentEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter javaComponentEnvelope is required and cannot be null.")); - } else { - javaComponentEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, name, this.client.getApiVersion(), javaComponentEnvelope, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, name, contentType, accept, + javaComponentEnvelope, context); } /** @@ -914,7 +549,7 @@ private Response updateWithResponse(String resourceGroupName, String * 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 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. @@ -937,7 +572,7 @@ private PollerFlux, JavaComponentInner> beginUpda * 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 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. @@ -960,7 +595,7 @@ public SyncPoller, JavaComponentInner> beginUpdat * 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 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. @@ -984,7 +619,7 @@ public SyncPoller, JavaComponentInner> beginUpdat * 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 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. @@ -1005,7 +640,7 @@ private Mono updateAsync(String resourceGroupName, String en * 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 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. @@ -1025,7 +660,7 @@ public JavaComponentInner update(String resourceGroupName, String environmentNam * 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 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. @@ -1046,7 +681,7 @@ public JavaComponentInner update(String resourceGroupName, String environmentNam * 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 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. @@ -1056,29 +691,9 @@ public JavaComponentInner update(String resourceGroupName, String environmentNam @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)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1088,7 +703,7 @@ private Mono>> deleteWithResponseAsync(String resource * 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 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. @@ -1097,30 +712,8 @@ private Mono>> deleteWithResponseAsync(String resource */ @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String environmentName, String name) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (name == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, name, this.client.getApiVersion(), accept, Context.NONE); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, name, Context.NONE); } /** @@ -1129,7 +722,7 @@ private Response deleteWithResponse(String resourceGroupName, String * 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 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. @@ -1140,30 +733,8 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String environmentName, String name, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (name == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, name, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, name, context); } /** @@ -1172,7 +743,7 @@ private Response deleteWithResponse(String resourceGroupName, String * 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 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. @@ -1193,7 +764,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * 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 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. @@ -1213,7 +784,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * 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 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. @@ -1234,7 +805,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * 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 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. @@ -1253,7 +824,7 @@ private Mono deleteAsync(String resourceGroupName, String environmentName, * 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 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. @@ -1270,7 +841,7 @@ public 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 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. @@ -1282,6 +853,120 @@ public void delete(String resourceGroupName, String environmentName, String name beginDelete(resourceGroupName, environmentName, name, context).getFinalResult(); } + /** + * 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) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String environmentName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, accept, Context.NONE); + return 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. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String environmentName, + Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, accept, context); + return 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 PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, environmentName), + nextLink -> listNextSinglePage(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 PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, environmentName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + /** * Get the Java Components for a managed environment. * @@ -1296,13 +981,6 @@ public void delete(String resourceGroupName, String environmentName, String name */ @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(), @@ -1323,15 +1001,6 @@ private Mono> listNextSinglePageAsync(String n */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -1353,21 +1022,10 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(JavaComponentsClientImpl.class); } 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 index 1c820fa61d33..fae762960c1d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -27,27 +27,12 @@ public JavaComponentsImpl(JavaComponentsClient 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new JavaComponentImpl(inner.getValue(), this.manager())); } public JavaComponent get(String resourceGroupName, String environmentName, String name) { @@ -67,6 +52,17 @@ public void delete(String resourceGroupName, String environmentName, String name this.serviceClient().delete(resourceGroupName, environmentName, name, context); } + 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 JavaComponent 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/JobExecutionBaseImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobExecutionBaseImpl.java index 6f069589b1a4..c0b6f1d960c0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobExecutionBaseImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobExecutionBaseImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; 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 a763cde3740e..f289fdd3f087 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 @@ -1,10 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; +import com.azure.core.management.SystemData; 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; @@ -21,18 +23,22 @@ public final class JobExecutionImpl implements JobExecution { this.serviceManager = serviceManager; } - public String name() { - return this.innerModel().name(); - } - 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 JobExecutionRunningState status() { return this.innerModel().status(); } @@ -49,6 +55,18 @@ public JobExecutionTemplate template() { return this.innerModel().template(); } + public ExecutionStatus detailedStatus() { + return this.innerModel().detailedStatus(); + } + + public String reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + 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 4cc06702a95a..cd10e77b59b1 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -17,6 +17,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; @@ -66,6 +67,10 @@ public JobProvisioningState provisioningState() { return this.innerModel().provisioningState(); } + public JobRunningState runningState() { + return this.innerModel().runningState(); + } + public String environmentId() { return this.innerModel().environmentId(); } @@ -211,6 +216,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; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobSecretsCollectionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobSecretsCollectionImpl.java index ebec3ac60e34..00621ff79d4d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobSecretsCollectionImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobSecretsCollectionImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; 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 bc247c3f8078..ee4df2a03688 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -27,11 +27,11 @@ 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.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.appcontainers.fluent.JobsClient; @@ -41,10 +41,10 @@ import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionBaseInner; import com.azure.resourcemanager.appcontainers.fluent.models.JobInner; import com.azure.resourcemanager.appcontainers.fluent.models.JobSecretsCollectionInner; +import com.azure.resourcemanager.appcontainers.implementation.models.JobsCollection; import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; import com.azure.resourcemanager.appcontainers.models.JobExecutionTemplate; import com.azure.resourcemanager.appcontainers.models.JobPatchProperties; -import com.azure.resourcemanager.appcontainers.models.JobsCollection; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -77,267 +77,293 @@ public final class JobsClientImpl implements JobsClient { * The interface defining all the services for ContainerAppsApiClientJobs to be used by the proxy service to perform * REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientJobs") public interface JobsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/detectors") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listDetectors(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/detectors") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listDetectorsSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/detectors/{detectorName}") - @ExpectedResponses({ 200 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getDetector(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, - @PathParam("detectorName") String detectorName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") JobInner jobEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/detectors/{detectorName}") - @ExpectedResponses({ 200 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getDetectorSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, - @PathParam("detectorName") String detectorName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") JobInner jobEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/detectorProperties/{apiName}") - @ExpectedResponses({ 200 }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> proxyGet(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, - @PathParam("apiName") String apiName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") JobPatchProperties jobEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/detectorProperties/{apiName}") - @ExpectedResponses({ 200 }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response proxyGetSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, - @PathParam("apiName") String apiName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") JobPatchProperties jobEnvelope, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/jobs") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs") @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); + Mono> listByResourceGroup(@HostParam("endpoint") 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}/providers/Microsoft.App/jobs") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Response listByResourceGroupSync(@HostParam("endpoint") 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/jobs") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/jobs") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Mono> list(@HostParam("endpoint") 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/jobs") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/jobs") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listByResourceGroupSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + Response listSync(@HostParam("endpoint") 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/jobs/{jobName}") - @ExpectedResponses({ 200 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/start") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> start(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, @BodyParam("application/json") JobExecutionTemplate template, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}") - @ExpectedResponses({ 200 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/start") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getByResourceGroupSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response startSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, @BodyParam("application/json") JobExecutionTemplate template, + Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}") - @ExpectedResponses({ 200, 201 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/stop") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> stopMultipleExecutions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") JobInner jobEnvelope, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}") - @ExpectedResponses({ 200, 201 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/stop") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response stopMultipleExecutionsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") JobInner jobEnvelope, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}") - @ExpectedResponses({ 200, 202, 204 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/listSecrets") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listSecrets(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}") - @ExpectedResponses({ 200, 202, 204 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/listSecrets") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listSecretsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/resume") @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resume(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") JobPatchProperties jobEnvelope, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/resume") @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response updateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Response resumeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") JobPatchProperties jobEnvelope, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/start") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/suspend") @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> start(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> suspend(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") JobExecutionTemplate template, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/start") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/suspend") @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response startSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Response suspendSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") JobExecutionTemplate template, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions/{jobExecutionName}/stop") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> stopExecution(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("jobName") String jobName, @PathParam("jobExecutionName") String jobExecutionName, - @HeaderParam("Accept") String accept, Context context); + Mono>> stopExecution(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, + @PathParam("jobExecutionName") String jobExecutionName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions/{jobExecutionName}/stop") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response stopExecutionSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("jobName") String jobName, @PathParam("jobExecutionName") String jobExecutionName, - @HeaderParam("Accept") String accept, Context context); + Response stopExecutionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, + @PathParam("jobExecutionName") String jobExecutionName, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/stop") - @ExpectedResponses({ 200, 202 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/detectorProperties/{apiName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> stopMultipleExecutions(@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); + Mono> proxyGet(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, + @PathParam("apiName") String apiName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/stop") - @ExpectedResponses({ 200, 202 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/detectorProperties/{apiName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response stopMultipleExecutionsSync(@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); + Response proxyGetSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, + @PathParam("apiName") String apiName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/listSecrets") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/detectors") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listDetectors(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/detectors") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listSecrets(@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); + Response listDetectorsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @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}/listSecrets") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/detectors/{detectorName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> getDetector(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, + @PathParam("detectorName") String detectorName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/detectors/{detectorName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listSecretsSync(@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); + Response getDetectorSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, + @PathParam("detectorName") String detectorName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listDetectorsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listDetectorsNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -345,7 +371,7 @@ Response listDetectorsNextSync( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -353,559 +379,598 @@ Mono> listBySubscriptionNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Response listBySubscriptionNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") 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, + Mono> listDetectorsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listByResourceGroupNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listDetectorsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Get the list of diagnostics for a given Container App Job. - * - * Get the list of diagnostics for a Container App Job. + * Get the properties of a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 the list of diagnostics for a Container App Job along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the properties of a Container Apps Job along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDetectorsSinglePageAsync(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.")); - } + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String jobName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listDetectors(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, jobName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the list of diagnostics for a given Container App Job. - * - * Get the list of diagnostics for a Container App Job. + * Get the properties of a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 the list of diagnostics for a Container App Job as paginated response with {@link PagedFlux}. + * @return the properties of a Container Apps Job on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDetectorsAsync(String resourceGroupName, String jobName) { - return new PagedFlux<>(() -> listDetectorsSinglePageAsync(resourceGroupName, jobName), - nextLink -> listDetectorsNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String jobName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get the list of diagnostics for a given Container App Job. - * - * Get the list of diagnostics for a Container App Job. + * Get the properties of a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 the list of diagnostics for a Container App Job along with {@link PagedResponse}. + * @return the properties of a Container Apps Job along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listDetectorsSinglePage(String resourceGroupName, String jobName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (jobName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); - } + public Response getByResourceGroupWithResponse(String resourceGroupName, String jobName, + Context context) { final String accept = "application/json"; - Response res - = service.listDetectorsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - jobName, this.client.getApiVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, accept, context); } /** - * Get the list of diagnostics for a given Container App Job. - * - * Get the list of diagnostics for a Container App Job. + * Get the properties of a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 the list of diagnostics for a Container App Job along with {@link PagedResponse}. + * @return the properties of a Container Apps Job. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listDetectorsSinglePage(String resourceGroupName, String jobName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (jobName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listDetectorsSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, jobName, this.client.getApiVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + public JobInner getByResourceGroup(String resourceGroupName, String jobName) { + return getByResourceGroupWithResponse(resourceGroupName, jobName, Context.NONE).getValue(); } /** - * Get the list of diagnostics for a given Container App Job. - * - * Get the list of diagnostics for a Container App Job. + * Create or Update a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. + * @param jobEnvelope Properties used to create a container apps 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 list of diagnostics for a Container App Job as paginated response with {@link PagedIterable}. + * @return container App Job along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDetectors(String resourceGroupName, String jobName) { - return new PagedIterable<>(() -> listDetectorsSinglePage(resourceGroupName, jobName), - nextLink -> listDetectorsNextSinglePage(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String jobName, + JobInner jobEnvelope) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, contentType, accept, jobEnvelope, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the list of diagnostics for a given Container App Job. - * - * Get the list of diagnostics for a Container App Job. + * Create or Update a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param context The context to associate with this operation. + * @param jobEnvelope Properties used to create a container apps 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 list of diagnostics for a Container App Job as paginated response with {@link PagedIterable}. + * @return container App Job along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDetectors(String resourceGroupName, String jobName, Context context) { - return new PagedIterable<>(() -> listDetectorsSinglePage(resourceGroupName, jobName, context), - nextLink -> listDetectorsNextSinglePage(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String jobName, + JobInner jobEnvelope) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, contentType, accept, jobEnvelope, + Context.NONE); } /** - * Get the diagnostics data for a given Container App Job. - * - * Get the diagnostics data for a Container App Job. + * Create or Update a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param detectorName Name of the Container App Job detector. + * @param jobEnvelope Properties used to create a container apps 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the diagnostics data for a Container App Job along with {@link Response} on successful completion of - * {@link Mono}. + * @return container App Job along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDetectorWithResponseAsync(String resourceGroupName, String jobName, - String detectorName) { - 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.")); - } - if (detectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter detectorName is required and cannot be null.")); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String jobName, + JobInner jobEnvelope, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getDetector(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, jobName, detectorName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, contentType, accept, jobEnvelope, context); } /** - * Get the diagnostics data for a given Container App Job. - * - * Get the diagnostics data for a Container App Job. + * Create or Update a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param detectorName Name of the Container App Job detector. + * @param jobEnvelope Properties used to create a container apps 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 diagnostics data for a Container App Job on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of container App Job. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getDetectorAsync(String resourceGroupName, String jobName, String detectorName) { - return getDetectorWithResponseAsync(resourceGroupName, jobName, detectorName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobInner> beginCreateOrUpdateAsync(String resourceGroupName, + String jobName, JobInner jobEnvelope) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, jobName, jobEnvelope); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), JobInner.class, + JobInner.class, this.client.getContext()); } /** - * Get the diagnostics data for a given Container App Job. - * - * Get the diagnostics data for a Container App Job. + * Create or Update a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param detectorName Name of the Container App Job detector. - * @param context The context to associate with this operation. + * @param jobEnvelope Properties used to create a container apps 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 diagnostics data for a Container App Job along with {@link Response}. + * @return the {@link SyncPoller} for polling of container App Job. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDetectorWithResponse(String resourceGroupName, String jobName, - String detectorName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (jobName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); - } - if (detectorName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter detectorName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.getDetectorSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - jobName, detectorName, this.client.getApiVersion(), accept, context); - } - - /** - * Get the diagnostics data for a given Container App Job. + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobInner> beginCreateOrUpdate(String resourceGroupName, String jobName, + JobInner jobEnvelope) { + Response response = createOrUpdateWithResponse(resourceGroupName, jobName, jobEnvelope); + return this.client.getLroResult(response, JobInner.class, JobInner.class, Context.NONE); + } + + /** + * Create or Update a Container Apps Job. * - * Get the diagnostics data for a Container App Job. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param jobEnvelope Properties used to create a container apps 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. + * @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> beginCreateOrUpdate(String resourceGroupName, String jobName, + JobInner jobEnvelope, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, jobName, jobEnvelope, context); + return this.client.getLroResult(response, JobInner.class, JobInner.class, context); + } + + /** + * Create or Update a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param detectorName Name of the Container App Job detector. + * @param jobEnvelope Properties used to create a container apps 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 diagnostics data for a Container App Job. + * @return container App Job on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DiagnosticsInner getDetector(String resourceGroupName, String jobName, String detectorName) { - return getDetectorWithResponse(resourceGroupName, jobName, detectorName, Context.NONE).getValue(); + private Mono createOrUpdateAsync(String resourceGroupName, String jobName, JobInner jobEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, jobName, jobEnvelope).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Get the properties of a Container App Job. + * Create or Update a Container Apps 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 jobEnvelope Properties used to create a container apps 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 along with {@link Response} on successful completion of - * {@link Mono}. + * @return container App Job. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> proxyGetWithResponseAsync(String resourceGroupName, String jobName, - String apiName) { - 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.")); - } - if (apiName == null) { - return Mono.error(new IllegalArgumentException("Parameter apiName is required and cannot be null.")); - } + public JobInner createOrUpdate(String resourceGroupName, String jobName, JobInner jobEnvelope) { + return beginCreateOrUpdate(resourceGroupName, jobName, jobEnvelope).getFinalResult(); + } + + /** + * Create or Update a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param jobEnvelope Properties used to create a container apps 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner createOrUpdate(String resourceGroupName, String jobName, JobInner jobEnvelope, Context context) { + return beginCreateOrUpdate(resourceGroupName, jobName, jobEnvelope, context).getFinalResult(); + } + + /** + * Update properties of a Container Apps Job + * + * Patches a Container Apps Job using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param jobEnvelope Properties used to create a container apps 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 container App Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String jobName, + JobPatchProperties jobEnvelope) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.proxyGet(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, jobName, apiName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, contentType, accept, jobEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the properties of a Container App Job. + * Update properties of a Container Apps Job + * + * Patches a Container Apps Job using JSON Merge Patch. * * @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 jobEnvelope Properties used to create a container apps 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}. + * @return container App Job along with {@link Response}. */ @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 Response updateWithResponse(String resourceGroupName, String jobName, + JobPatchProperties jobEnvelope) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, contentType, accept, jobEnvelope, + Context.NONE); } /** - * Get the properties of a Container App Job. + * Update properties of a Container Apps Job + * + * Patches a Container Apps Job using JSON Merge Patch. * * @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 jobEnvelope Properties used to create a container apps 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. * @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}. + * @return container App Job along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response proxyGetWithResponse(String resourceGroupName, String jobName, String apiName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (jobName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); - } - if (apiName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter apiName is required and cannot be null.")); - } + private Response updateWithResponse(String resourceGroupName, String jobName, + JobPatchProperties jobEnvelope, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.proxyGetSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - jobName, apiName, this.client.getApiVersion(), accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, contentType, accept, jobEnvelope, context); } /** - * Get the properties of a Container App Job. + * Update properties of a Container Apps Job + * + * Patches a Container Apps Job using JSON Merge Patch. * * @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 jobEnvelope Properties used to create a container apps 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. + * @return the {@link PollerFlux} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobInner> beginUpdateAsync(String resourceGroupName, String jobName, + JobPatchProperties jobEnvelope) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, jobName, jobEnvelope); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), JobInner.class, + JobInner.class, this.client.getContext()); + } + + /** + * Update properties of a Container Apps Job + * + * Patches a Container Apps Job using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param jobEnvelope Properties used to create a container apps 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 {@link SyncPoller} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobInner> beginUpdate(String resourceGroupName, String jobName, + JobPatchProperties jobEnvelope) { + Response response = updateWithResponse(resourceGroupName, jobName, jobEnvelope); + return this.client.getLroResult(response, JobInner.class, JobInner.class, Context.NONE); + } + + /** + * Update properties of a Container Apps Job + * + * Patches a Container Apps Job using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param jobEnvelope Properties used to create a container apps 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. + * @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> beginUpdate(String resourceGroupName, String jobName, + JobPatchProperties jobEnvelope, Context context) { + Response response = updateWithResponse(resourceGroupName, jobName, jobEnvelope, context); + return this.client.getLroResult(response, JobInner.class, JobInner.class, context); + } + + /** + * Update properties of a Container Apps Job + * + * Patches a Container Apps Job using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param jobEnvelope Properties used to create a container apps 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 container App Job on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public JobInner proxyGet(String resourceGroupName, String jobName, String apiName) { - return proxyGetWithResponse(resourceGroupName, jobName, apiName, Context.NONE).getValue(); + private Mono updateAsync(String resourceGroupName, String jobName, JobPatchProperties jobEnvelope) { + return beginUpdateAsync(resourceGroupName, jobName, jobEnvelope).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Get the Container Apps Jobs in a given subscription. + * Update properties of a Container Apps Job * + * Patches a Container Apps Job using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param jobEnvelope Properties used to create a container apps 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 Container Apps Jobs in a given subscription along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return container App Job. */ @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"; + public JobInner update(String resourceGroupName, String jobName, JobPatchProperties jobEnvelope) { + return beginUpdate(resourceGroupName, jobName, jobEnvelope).getFinalResult(); + } + + /** + * Update properties of a Container Apps Job + * + * Patches a Container Apps Job using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param jobEnvelope Properties used to create a container apps 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner update(String resourceGroupName, String jobName, JobPatchProperties jobEnvelope, Context context) { + return beginUpdate(resourceGroupName, jobName, jobEnvelope, context).getFinalResult(); + } + + /** + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String jobName) { 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)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the Container Apps Jobs in a given subscription. + * Delete a Container Apps Job. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job 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 the Container Apps Jobs in a given subscription as paginated response with {@link PagedFlux}. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String jobName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, Context.NONE); } /** - * Get the Container Apps Jobs in a given subscription. + * Delete a Container Apps Job. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job 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 the Container Apps Jobs in a given subscription along with {@link PagedResponse}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage() { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + private Response deleteWithResponse(String resourceGroupName, String jobName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, context); } /** - * Get the Container Apps Jobs in a given subscription. + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String jobName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, jobName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String jobName) { + Response response = deleteWithResponse(resourceGroupName, jobName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a Container Apps Job. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job 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 the Container Apps Jobs in a given subscription along with {@link PagedResponse}. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String jobName, Context context) { + Response response = deleteWithResponse(resourceGroupName, jobName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job 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 A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + private Mono deleteAsync(String resourceGroupName, String jobName) { + return beginDeleteAsync(resourceGroupName, jobName).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Get the Container Apps Jobs in a given subscription. + * Delete a Container Apps Job. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job 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 the Container Apps Jobs in a given subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String jobName) { + beginDelete(resourceGroupName, jobName).getFinalResult(); } /** - * Get the Container Apps Jobs in a given subscription. + * Delete a Container Apps Job. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job 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 the Container Apps Jobs in a given subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(() -> listSinglePage(context), - nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String jobName, Context context) { + beginDelete(resourceGroupName, jobName, context).getFinalResult(); } /** @@ -920,22 +985,10 @@ public PagedIterable list(Context context) { */ @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)) + .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())); @@ -967,23 +1020,9 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupName) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listByResourceGroupSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, Context.NONE); + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -1000,23 +1039,9 @@ private PagedResponse listByResourceGroupSinglePage(String resourceGro */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listByResourceGroupSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context); + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -1053,1080 +1078,894 @@ public PagedIterable listByResourceGroup(String resourceGroupName, Con } /** - * Get the properties of a Container Apps Job. + * Get the Container Apps Jobs 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 Container Apps Jobs in a given subscription along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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())); + } + + /** + * Get the Container Apps Jobs 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 Container Apps Jobs 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 Container Apps Jobs 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 Container Apps Jobs in a given subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the Container Apps Jobs 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 Container Apps Jobs in a given subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the Container Apps Jobs 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 Container Apps Jobs in a given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * Get the Container Apps Jobs 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 Container Apps Jobs in a given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + + /** + * Start a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. + * @param template Properties used to start a job execution. * @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 Apps Job along with {@link Response} on successful completion of - * {@link Mono}. + * @return container App's Job execution name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(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.")); - } + private Mono>> startWithResponseAsync(String resourceGroupName, String jobName, + JobExecutionTemplate template) { final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, jobName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, accept, template, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the properties of a Container Apps Job. + * Start a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param template Properties used to start a job execution. + * @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's Job execution name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response startWithResponse(String resourceGroupName, String jobName, + JobExecutionTemplate template) { + final String accept = "application/json"; + return service.startSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, accept, template, Context.NONE); + } + + /** + * Start a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param template Properties used to start a job execution. + * @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's Job execution name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response startWithResponse(String resourceGroupName, String jobName, + JobExecutionTemplate template, Context context) { + final String accept = "application/json"; + return service.startSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, accept, template, context); + } + + /** + * Start a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param template Properties used to start a job execution. + * @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's Job execution name. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobExecutionBaseInner> + beginStartAsync(String resourceGroupName, String jobName, JobExecutionTemplate template) { + Mono>> mono = startWithResponseAsync(resourceGroupName, jobName, template); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), JobExecutionBaseInner.class, JobExecutionBaseInner.class, + this.client.getContext()); + } + + /** + * Start a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 the properties of a Container Apps Job on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of container App's Job execution name. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String jobName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, jobName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobExecutionBaseInner> + beginStartAsync(String resourceGroupName, String jobName) { + final JobExecutionTemplate template = null; + Mono>> mono = startWithResponseAsync(resourceGroupName, jobName, template); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), JobExecutionBaseInner.class, JobExecutionBaseInner.class, + this.client.getContext()); } /** - * Get the properties of a Container Apps Job. + * Start a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param context The context to associate with this operation. + * @param template Properties used to start a job execution. * @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 Apps Job along with {@link Response}. + * @return the {@link SyncPoller} for polling of container App's Job execution name. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String jobName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (jobName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, jobName, this.client.getApiVersion(), accept, context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobExecutionBaseInner> beginStart(String resourceGroupName, + String jobName, JobExecutionTemplate template) { + Response response = startWithResponse(resourceGroupName, jobName, template); + return this.client.getLroResult(response, + JobExecutionBaseInner.class, JobExecutionBaseInner.class, Context.NONE); } /** - * Get the properties of a Container Apps Job. + * Start a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 the properties of a Container Apps Job. + * @return the {@link SyncPoller} for polling of container App's Job execution name. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public JobInner getByResourceGroup(String resourceGroupName, String jobName) { - return getByResourceGroupWithResponse(resourceGroupName, jobName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobExecutionBaseInner> beginStart(String resourceGroupName, + String jobName) { + final JobExecutionTemplate template = null; + Response response = startWithResponse(resourceGroupName, jobName, template); + return this.client.getLroResult(response, + JobExecutionBaseInner.class, JobExecutionBaseInner.class, Context.NONE); } /** - * Create or Update a Container Apps Job. + * Start a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps job. + * @param template Properties used to start a job execution. + * @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 Job along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of container App's Job execution name. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String jobName, - JobInner jobEnvelope) { - 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.")); - } - if (jobEnvelope == null) { - return Mono.error(new IllegalArgumentException("Parameter jobEnvelope is required and cannot be null.")); - } else { - jobEnvelope.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, jobName, this.client.getApiVersion(), jobEnvelope, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobExecutionBaseInner> beginStart(String resourceGroupName, + String jobName, JobExecutionTemplate template, Context context) { + Response response = startWithResponse(resourceGroupName, jobName, template, context); + return this.client.getLroResult(response, + JobExecutionBaseInner.class, JobExecutionBaseInner.class, context); } /** - * Create or Update a Container Apps Job. + * Start a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps job. + * @param template Properties used to start a job execution. * @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 Job along with {@link Response}. + * @return container App's Job execution name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String jobName, - JobInner jobEnvelope) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (jobName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); - } - if (jobEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobEnvelope is required and cannot be null.")); - } else { - jobEnvelope.validate(); - } - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - jobName, this.client.getApiVersion(), jobEnvelope, accept, Context.NONE); + private Mono startAsync(String resourceGroupName, String jobName, + JobExecutionTemplate template) { + return beginStartAsync(resourceGroupName, jobName, template).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or Update a Container Apps Job. + * Start a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container App Job along with {@link Response}. + * @return container App's Job execution name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String jobName, - JobInner jobEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (jobName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); - } - if (jobEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobEnvelope is required and cannot be null.")); - } else { - jobEnvelope.validate(); - } - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - jobName, this.client.getApiVersion(), jobEnvelope, accept, context); + private Mono startAsync(String resourceGroupName, String jobName) { + final JobExecutionTemplate template = null; + return beginStartAsync(resourceGroupName, jobName, template).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or Update a Container Apps Job. + * Start a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps 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 {@link PollerFlux} for polling of container App Job. + * @return container App's Job execution name. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, JobInner> beginCreateOrUpdateAsync(String resourceGroupName, - String jobName, JobInner jobEnvelope) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, jobName, jobEnvelope); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), JobInner.class, - JobInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + public JobExecutionBaseInner start(String resourceGroupName, String jobName) { + final JobExecutionTemplate template = null; + return beginStart(resourceGroupName, jobName, template).getFinalResult(); } /** - * Create or Update a Container Apps Job. + * Start a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps job. + * @param template Properties used to start a job execution. + * @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 Job. + * @return container App's Job execution name. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, JobInner> beginCreateOrUpdate(String resourceGroupName, String jobName, - JobInner jobEnvelope) { - Response response = createOrUpdateWithResponse(resourceGroupName, jobName, jobEnvelope); - return this.client.getLroResult(response, JobInner.class, JobInner.class, Context.NONE); + @ServiceMethod(returns = ReturnType.SINGLE) + public JobExecutionBaseInner start(String resourceGroupName, String jobName, JobExecutionTemplate template, + Context context) { + return beginStart(resourceGroupName, jobName, template, context).getFinalResult(); } /** - * Create or Update a Container Apps Job. + * Terminates execution of a running container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of container App Job. + * @return container App executions collection ARM resource along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, JobInner> beginCreateOrUpdate(String resourceGroupName, String jobName, - JobInner jobEnvelope, Context context) { - Response response = createOrUpdateWithResponse(resourceGroupName, jobName, jobEnvelope, context); - return this.client.getLroResult(response, JobInner.class, JobInner.class, context); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopMultipleExecutionsWithResponseAsync(String resourceGroupName, + String jobName) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.stopMultipleExecutions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or Update a Container Apps Job. + * Terminates execution of a running container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps 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 container App Job on successful completion of {@link Mono}. + * @return container App executions collection ARM resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String jobName, JobInner jobEnvelope) { - return beginCreateOrUpdateAsync(resourceGroupName, jobName, jobEnvelope).last() - .flatMap(this.client::getLroFinalResultOrError); + private Response stopMultipleExecutionsWithResponse(String resourceGroupName, String jobName) { + final String accept = "application/json"; + return service.stopMultipleExecutionsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, accept, Context.NONE); } /** - * Create or Update a Container Apps Job. + * Terminates execution of a running container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container App Job. + * @return container App executions collection ARM resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public JobInner createOrUpdate(String resourceGroupName, String jobName, JobInner jobEnvelope) { - return beginCreateOrUpdate(resourceGroupName, jobName, jobEnvelope).getFinalResult(); + private Response stopMultipleExecutionsWithResponse(String resourceGroupName, String jobName, + Context context) { + final String accept = "application/json"; + return service.stopMultipleExecutionsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, accept, context); } /** - * Create or Update a Container Apps Job. + * Terminates execution of a running container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container App Job. + * @return the {@link PollerFlux} for polling of container App executions collection ARM resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public JobInner createOrUpdate(String resourceGroupName, String jobName, JobInner jobEnvelope, Context context) { - return beginCreateOrUpdate(resourceGroupName, jobName, jobEnvelope, context).getFinalResult(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerAppJobExecutionsInner> + beginStopMultipleExecutionsAsync(String resourceGroupName, String jobName) { + Mono>> mono = stopMultipleExecutionsWithResponseAsync(resourceGroupName, jobName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ContainerAppJobExecutionsInner.class, ContainerAppJobExecutionsInner.class, + this.client.getContext()); } /** - * Delete a Container Apps Job. + * Terminates execution of a running container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 the {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of container App executions collection ARM resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(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.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, jobName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerAppJobExecutionsInner> + beginStopMultipleExecutions(String resourceGroupName, String jobName) { + Response response = stopMultipleExecutionsWithResponse(resourceGroupName, jobName); + return this.client.getLroResult(response, + ContainerAppJobExecutionsInner.class, ContainerAppJobExecutionsInner.class, Context.NONE); } /** - * Delete a Container Apps Job. + * Terminates execution of a running container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 the response body along with {@link Response}. + * @return the {@link SyncPoller} for polling of container App executions collection ARM resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String jobName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (jobName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - jobName, this.client.getApiVersion(), accept, Context.NONE); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerAppJobExecutionsInner> + beginStopMultipleExecutions(String resourceGroupName, String jobName, Context context) { + Response response = stopMultipleExecutionsWithResponse(resourceGroupName, jobName, context); + return this.client.getLroResult(response, + ContainerAppJobExecutionsInner.class, ContainerAppJobExecutionsInner.class, context); } /** - * Delete a Container Apps Job. + * Terminates execution of a running container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 the response body along with {@link Response}. + * @return container App executions collection ARM resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String jobName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (jobName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - jobName, this.client.getApiVersion(), accept, context); + private Mono stopMultipleExecutionsAsync(String resourceGroupName, String jobName) { + return beginStopMultipleExecutionsAsync(resourceGroupName, jobName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Delete a Container Apps Job. + * Terminates execution of a running container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 the {@link PollerFlux} for polling of long-running operation. + * @return container App executions collection ARM resource. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String jobName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, jobName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAppJobExecutionsInner stopMultipleExecutions(String resourceGroupName, String jobName) { + return beginStopMultipleExecutions(resourceGroupName, jobName).getFinalResult(); } /** - * Delete a Container Apps Job. + * Terminates execution of a running container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 the {@link SyncPoller} for polling of long-running operation. + * @return container App executions collection ARM resource. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String jobName) { - Response response = deleteWithResponse(resourceGroupName, jobName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAppJobExecutionsInner stopMultipleExecutions(String resourceGroupName, String jobName, + Context context) { + return beginStopMultipleExecutions(resourceGroupName, jobName, context).getFinalResult(); } /** - * Delete a Container Apps Job. + * List secrets for a container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 the {@link SyncPoller} for polling of long-running operation. + * @return container Apps Job Secrets Collection ARM resource along with {@link Response} on successful completion + * of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String jobName, Context context) { - Response response = deleteWithResponse(resourceGroupName, jobName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSecretsWithResponseAsync(String resourceGroupName, + String jobName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listSecrets(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete a Container Apps Job. + * List secrets for a container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 A {@link Mono} that completes when a successful response is received. + * @return container Apps Job Secrets Collection ARM resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String jobName) { - return beginDeleteAsync(resourceGroupName, jobName).last().flatMap(this.client::getLroFinalResultOrError); + private Mono listSecretsAsync(String resourceGroupName, String jobName) { + return listSecretsWithResponseAsync(resourceGroupName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Delete a Container Apps Job. + * List secrets for a container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 container Apps Job Secrets Collection ARM resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String jobName) { - beginDelete(resourceGroupName, jobName).getFinalResult(); + public Response listSecretsWithResponse(String resourceGroupName, String jobName, + Context context) { + final String accept = "application/json"; + return service.listSecretsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, accept, context); } /** - * Delete a Container Apps Job. + * List secrets for a container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 container Apps Job Secrets Collection ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String jobName, Context context) { - beginDelete(resourceGroupName, jobName, context).getFinalResult(); + public JobSecretsCollectionInner listSecrets(String resourceGroupName, String jobName) { + return listSecretsWithResponse(resourceGroupName, jobName, Context.NONE).getValue(); } /** - * Update properties of a Container Apps Job + * Resumes a suspended job * - * Patches a Container Apps Job using JSON Merge Patch. + * Resumes execution for a suspended Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps job. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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>> updateWithResponseAsync(String resourceGroupName, String jobName, - JobPatchProperties jobEnvelope) { - 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.")); - } - if (jobEnvelope == null) { - return Mono.error(new IllegalArgumentException("Parameter jobEnvelope is required and cannot be null.")); - } else { - jobEnvelope.validate(); - } + private Mono>> resumeWithResponseAsync(String resourceGroupName, String jobName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, jobName, this.client.getApiVersion(), jobEnvelope, accept, context)) + .withContext(context -> service.resume(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update properties of a Container Apps Job + * Resumes a suspended job * - * Patches a Container Apps Job using JSON Merge Patch. + * Resumes execution for a suspended Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps job. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String jobName, - JobPatchProperties jobEnvelope) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (jobName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); - } - if (jobEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobEnvelope is required and cannot be null.")); - } else { - jobEnvelope.validate(); - } + private Response resumeWithResponse(String resourceGroupName, String jobName) { final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - jobName, this.client.getApiVersion(), jobEnvelope, accept, Context.NONE); + return service.resumeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, accept, Context.NONE); } /** - * Update properties of a Container Apps Job + * Resumes a suspended job * - * Patches a Container Apps Job using JSON Merge Patch. + * Resumes execution for a suspended Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps 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. + * @throws 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String jobName, - JobPatchProperties jobEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (jobName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); - } - if (jobEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobEnvelope is required and cannot be null.")); - } else { - jobEnvelope.validate(); - } + private Response resumeWithResponse(String resourceGroupName, String jobName, Context context) { final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - jobName, this.client.getApiVersion(), jobEnvelope, accept, context); + return service.resumeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, accept, context); } /** - * Update properties of a Container Apps Job + * Resumes a suspended job * - * Patches a Container Apps Job using JSON Merge Patch. + * Resumes execution for a suspended Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps job. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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> beginUpdateAsync(String resourceGroupName, String jobName, - JobPatchProperties jobEnvelope) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, jobName, jobEnvelope); + 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()); } /** - * Update properties of a Container Apps Job + * Resumes a suspended job * - * Patches a Container Apps Job using JSON Merge Patch. + * Resumes execution for a suspended Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps job. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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> beginUpdate(String resourceGroupName, String jobName, - JobPatchProperties jobEnvelope) { - Response response = updateWithResponse(resourceGroupName, jobName, jobEnvelope); + public SyncPoller, JobInner> beginResume(String resourceGroupName, String jobName) { + Response response = resumeWithResponse(resourceGroupName, jobName); return this.client.getLroResult(response, JobInner.class, JobInner.class, Context.NONE); } /** - * Update properties of a Container Apps Job + * Resumes a suspended job * - * Patches a Container Apps Job using JSON Merge Patch. + * Resumes execution for a suspended Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps 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. + * @throws 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> beginUpdate(String resourceGroupName, String jobName, - JobPatchProperties jobEnvelope, Context context) { - Response response = updateWithResponse(resourceGroupName, jobName, jobEnvelope, context); + public SyncPoller, JobInner> beginResume(String resourceGroupName, String jobName, + Context context) { + Response response = resumeWithResponse(resourceGroupName, jobName, context); return this.client.getLroResult(response, JobInner.class, JobInner.class, context); } /** - * Update properties of a Container Apps Job + * Resumes a suspended job * - * Patches a Container Apps Job using JSON Merge Patch. + * Resumes execution for a suspended Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps job. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 updateAsync(String resourceGroupName, String jobName, JobPatchProperties jobEnvelope) { - return beginUpdateAsync(resourceGroupName, jobName, jobEnvelope).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono resumeAsync(String resourceGroupName, String jobName) { + return beginResumeAsync(resourceGroupName, jobName).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Update properties of a Container Apps Job + * Resumes a suspended job * - * Patches a Container Apps Job using JSON Merge Patch. + * Resumes execution for a suspended Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps job. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 update(String resourceGroupName, String jobName, JobPatchProperties jobEnvelope) { - return beginUpdate(resourceGroupName, jobName, jobEnvelope).getFinalResult(); + public JobInner resume(String resourceGroupName, String jobName) { + return beginResume(resourceGroupName, jobName).getFinalResult(); } /** - * Update properties of a Container Apps Job + * Resumes a suspended job * - * Patches a Container Apps Job using JSON Merge Patch. + * Resumes execution for a suspended Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param jobEnvelope Properties used to create a container apps 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. + * @throws 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 update(String resourceGroupName, String jobName, JobPatchProperties jobEnvelope, Context context) { - return beginUpdate(resourceGroupName, jobName, jobEnvelope, context).getFinalResult(); + public JobInner resume(String resourceGroupName, String jobName, Context context) { + return beginResume(resourceGroupName, jobName, context).getFinalResult(); } /** - * Start a Container Apps Job. + * Suspends a job + * + * Suspends execution for a running Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param template Properties used to start a job execution. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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's Job execution name along with {@link Response} on successful completion of {@link Mono}. + * @return container App Job along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync(String resourceGroupName, String jobName, - JobExecutionTemplate template) { - 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.")); - } - if (template != null) { - template.validate(); - } + private Mono>> suspendWithResponseAsync(String resourceGroupName, String jobName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.start(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, jobName, this.client.getApiVersion(), template, accept, context)) + .withContext(context -> service.suspend(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Start a Container Apps Job. + * Suspends a job + * + * Suspends execution for a running Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param template Properties used to start a job execution. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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's Job execution name along with {@link Response}. + * @return container App Job along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response startWithResponse(String resourceGroupName, String jobName, - JobExecutionTemplate template) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (jobName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); - } - if (template != null) { - template.validate(); - } + private Response suspendWithResponse(String resourceGroupName, String jobName) { final String accept = "application/json"; - return service.startSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, jobName, - this.client.getApiVersion(), template, accept, Context.NONE); + return service.suspendSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, accept, Context.NONE); } /** - * Start a Container Apps Job. + * Suspends a job + * + * Suspends execution for a running Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param template Properties used to start a job execution. * @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 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's Job execution name along with {@link Response}. + * @return container App Job along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response startWithResponse(String resourceGroupName, String jobName, - JobExecutionTemplate template, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (jobName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); - } - if (template != null) { - template.validate(); - } + private Response suspendWithResponse(String resourceGroupName, String jobName, Context context) { final String accept = "application/json"; - return service.startSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, jobName, - this.client.getApiVersion(), template, accept, context); + return service.suspendSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, accept, context); } /** - * Start a Container Apps Job. + * Suspends a job * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. - * @param template Properties used to start a job execution. - * @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's Job execution name. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, JobExecutionBaseInner> - beginStartAsync(String resourceGroupName, String jobName, JobExecutionTemplate template) { - Mono>> mono = startWithResponseAsync(resourceGroupName, jobName, template); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), JobExecutionBaseInner.class, JobExecutionBaseInner.class, - this.client.getContext()); - } - - /** - * Start a Container Apps Job. + * Suspends execution for a running Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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's Job execution name. + * @return the {@link PollerFlux} for polling of container App Job. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, JobExecutionBaseInner> - beginStartAsync(String resourceGroupName, String jobName) { - final JobExecutionTemplate template = null; - Mono>> mono = startWithResponseAsync(resourceGroupName, jobName, template); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), JobExecutionBaseInner.class, JobExecutionBaseInner.class, - this.client.getContext()); + 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()); } /** - * Start a Container Apps Job. + * Suspends a job * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. - * @param template Properties used to start a job execution. - * @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's Job execution name. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, JobExecutionBaseInner> beginStart(String resourceGroupName, - String jobName, JobExecutionTemplate template) { - Response response = startWithResponse(resourceGroupName, jobName, template); - return this.client.getLroResult(response, - JobExecutionBaseInner.class, JobExecutionBaseInner.class, Context.NONE); - } - - /** - * Start a Container Apps Job. + * Suspends execution for a running Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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's Job execution name. + * @return the {@link SyncPoller} for polling of container App Job. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, JobExecutionBaseInner> beginStart(String resourceGroupName, - String jobName) { - final JobExecutionTemplate template = null; - Response response = startWithResponse(resourceGroupName, jobName, template); - return this.client.getLroResult(response, - JobExecutionBaseInner.class, JobExecutionBaseInner.class, Context.NONE); + public SyncPoller, JobInner> beginSuspend(String resourceGroupName, String jobName) { + Response response = suspendWithResponse(resourceGroupName, jobName); + return this.client.getLroResult(response, JobInner.class, JobInner.class, Context.NONE); } /** - * Start a Container Apps Job. + * Suspends a job + * + * Suspends execution for a running Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param template Properties used to start a job execution. * @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 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's Job execution name. + * @return the {@link SyncPoller} for polling of container App Job. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, JobExecutionBaseInner> beginStart(String resourceGroupName, - String jobName, JobExecutionTemplate template, Context context) { - Response response = startWithResponse(resourceGroupName, jobName, template, context); - return this.client.getLroResult(response, - JobExecutionBaseInner.class, JobExecutionBaseInner.class, context); + public SyncPoller, JobInner> beginSuspend(String resourceGroupName, String jobName, + Context context) { + Response response = suspendWithResponse(resourceGroupName, jobName, context); + return this.client.getLroResult(response, JobInner.class, JobInner.class, context); } /** - * Start a Container Apps Job. + * Suspends a job * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. - * @param template Properties used to start a job execution. - * @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's Job execution name on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String resourceGroupName, String jobName, - JobExecutionTemplate template) { - return beginStartAsync(resourceGroupName, jobName, template).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Start a Container Apps Job. + * Suspends execution for a running Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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's Job execution name on successful completion of {@link Mono}. + * @return container App Job on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String resourceGroupName, String jobName) { - final JobExecutionTemplate template = null; - return beginStartAsync(resourceGroupName, jobName, template).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono suspendAsync(String resourceGroupName, String jobName) { + return beginSuspendAsync(resourceGroupName, jobName).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Start a Container Apps Job. + * Suspends a job + * + * Suspends execution for a running Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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's Job execution name. + * @return container App Job. */ @ServiceMethod(returns = ReturnType.SINGLE) - public JobExecutionBaseInner start(String resourceGroupName, String jobName) { - final JobExecutionTemplate template = null; - return beginStart(resourceGroupName, jobName, template).getFinalResult(); + public JobInner suspend(String resourceGroupName, String jobName) { + return beginSuspend(resourceGroupName, jobName).getFinalResult(); } /** - * Start a Container Apps Job. + * Suspends a job + * + * Suspends execution for a running Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param template Properties used to start a job execution. * @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 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's Job execution name. + * @return container App Job. */ @ServiceMethod(returns = ReturnType.SINGLE) - public JobExecutionBaseInner start(String resourceGroupName, String jobName, JobExecutionTemplate template, - Context context) { - return beginStart(resourceGroupName, jobName, template, context).getFinalResult(); + public JobInner suspend(String resourceGroupName, String jobName, Context context) { + return beginSuspend(resourceGroupName, jobName, context).getFinalResult(); } /** @@ -2143,29 +1982,9 @@ public JobExecutionBaseInner start(String resourceGroupName, String jobName, Job @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> stopExecutionWithResponseAsync(String resourceGroupName, String jobName, String jobExecutionName) { - 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.")); - } - if (jobExecutionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter jobExecutionName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.stopExecution(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), jobName, jobExecutionName, accept, context)) + .withContext(context -> service.stopExecution(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, jobExecutionName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2183,31 +2002,8 @@ private Mono>> stopExecutionWithResponseAsync(String r @ServiceMethod(returns = ReturnType.SINGLE) private Response stopExecutionWithResponse(String resourceGroupName, String jobName, String jobExecutionName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (jobName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); - } - if (jobExecutionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobExecutionName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.stopExecutionSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), jobName, jobExecutionName, accept, Context.NONE); + return service.stopExecutionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, jobExecutionName, Context.NONE); } /** @@ -2225,31 +2021,8 @@ private Response stopExecutionWithResponse(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Response stopExecutionWithResponse(String resourceGroupName, String jobName, String jobExecutionName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (jobName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); - } - if (jobExecutionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobExecutionName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.stopExecutionSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), jobName, jobExecutionName, accept, context); + return service.stopExecutionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, jobExecutionName, context); } /** @@ -2359,324 +2132,326 @@ public void stopExecution(String resourceGroupName, String jobName, String jobEx } /** - * Terminates execution of a running container apps job. + * Get the properties of a Container App Job. + * + * Get the properties for a given 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. + * + * Get the properties for a given Container App Job along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> proxyGetWithResponseAsync(String resourceGroupName, String jobName, + String apiName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.proxyGet(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, apiName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the properties of a Container App Job. + * + * Get the properties for a given 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 container App executions collection ARM resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return the properties of a Container App Job. + * + * Get the properties for a given Container App Job on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopMultipleExecutionsWithResponseAsync(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.stopMultipleExecutions(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), jobName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono proxyGetAsync(String resourceGroupName, String jobName, String apiName) { + return proxyGetWithResponseAsync(resourceGroupName, jobName, apiName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Terminates execution of a running container apps job. + * Get the properties of a Container App Job. + * + * Get the properties for a given 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container App executions collection ARM resource along with {@link Response}. + * @return the properties of a Container App Job. + * + * Get the properties for a given Container App Job along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response stopMultipleExecutionsWithResponse(String resourceGroupName, String jobName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (jobName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); - } + public Response proxyGetWithResponse(String resourceGroupName, String jobName, String apiName, + Context context) { final String accept = "application/json"; - return service.stopMultipleExecutionsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), jobName, accept, Context.NONE); + return service.proxyGetSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, apiName, accept, context); } /** - * Terminates execution of a running container apps job. + * Get the properties of a Container App Job. + * + * Get the properties for a given Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param context The context to associate with this operation. + * @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 container App executions collection ARM resource along with {@link Response}. + * @return the properties of a Container App Job. + * + * Get the properties for a given Container App Job. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response stopMultipleExecutionsWithResponse(String resourceGroupName, String jobName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (jobName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.stopMultipleExecutionsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), jobName, accept, context); + public JobInner proxyGet(String resourceGroupName, String jobName, String apiName) { + return proxyGetWithResponse(resourceGroupName, jobName, apiName, Context.NONE).getValue(); } /** - * Terminates execution of a running container apps job. + * Get the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. + * @param jobName Name of the 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 {@link PollerFlux} for polling of container App executions collection ARM resource. + * @return the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ContainerAppJobExecutionsInner> - beginStopMultipleExecutionsAsync(String resourceGroupName, String jobName) { - Mono>> mono = stopMultipleExecutionsWithResponseAsync(resourceGroupName, jobName); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ContainerAppJobExecutionsInner.class, ContainerAppJobExecutionsInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDetectorsSinglePageAsync(String resourceGroupName, + String jobName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listDetectors(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, 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())); } /** - * Terminates execution of a running container apps job. + * Get the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. + * @param jobName Name of the 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 {@link SyncPoller} for polling of container App executions collection ARM resource. + * @return the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ContainerAppJobExecutionsInner> - beginStopMultipleExecutions(String resourceGroupName, String jobName) { - Response response = stopMultipleExecutionsWithResponse(resourceGroupName, jobName); - return this.client.getLroResult(response, - ContainerAppJobExecutionsInner.class, ContainerAppJobExecutionsInner.class, Context.NONE); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDetectorsAsync(String resourceGroupName, String jobName) { + return new PagedFlux<>(() -> listDetectorsSinglePageAsync(resourceGroupName, jobName), + nextLink -> listDetectorsNextSinglePageAsync(nextLink)); } /** - * Terminates execution of a running container apps job. + * Get the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. - * @param context The context to associate with this operation. + * @param jobName Name of the 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 {@link SyncPoller} for polling of container App executions collection ARM resource. + * @return the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ContainerAppJobExecutionsInner> - beginStopMultipleExecutions(String resourceGroupName, String jobName, Context context) { - Response response = stopMultipleExecutionsWithResponse(resourceGroupName, jobName, context); - return this.client.getLroResult(response, - ContainerAppJobExecutionsInner.class, ContainerAppJobExecutionsInner.class, context); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listDetectorsSinglePage(String resourceGroupName, String jobName) { + final String accept = "application/json"; + Response res + = service.listDetectorsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Terminates execution of a running container apps job. + * Get the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. + * @param jobName Name of the 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container App executions collection ARM resource on successful completion of {@link Mono}. + * @return the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopMultipleExecutionsAsync(String resourceGroupName, String jobName) { - return beginStopMultipleExecutionsAsync(resourceGroupName, jobName).last() - .flatMap(this.client::getLroFinalResultOrError); + private PagedResponse listDetectorsSinglePage(String resourceGroupName, String jobName, + Context context) { + final String accept = "application/json"; + Response res = service.listDetectorsSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, jobName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Terminates execution of a running container apps job. + * Get the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. + * @param jobName Name of the 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 container App executions collection ARM resource. + * @return the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ContainerAppJobExecutionsInner stopMultipleExecutions(String resourceGroupName, String jobName) { - return beginStopMultipleExecutions(resourceGroupName, jobName).getFinalResult(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDetectors(String resourceGroupName, String jobName) { + return new PagedIterable<>(() -> listDetectorsSinglePage(resourceGroupName, jobName), + nextLink -> listDetectorsNextSinglePage(nextLink)); } /** - * Terminates execution of a running container apps job. + * Get the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. + * @param jobName Name of the 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container App executions collection ARM resource. + * @return the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ContainerAppJobExecutionsInner stopMultipleExecutions(String resourceGroupName, String jobName, - Context context) { - return beginStopMultipleExecutions(resourceGroupName, jobName, context).getFinalResult(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDetectors(String resourceGroupName, String jobName, Context context) { + return new PagedIterable<>(() -> listDetectorsSinglePage(resourceGroupName, jobName, context), + nextLink -> listDetectorsNextSinglePage(nextLink, context)); } /** - * List secrets for a container apps job. + * Get the diagnostics data for a given Container App Job. + * + * Get the diagnostics data for a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. + * @param jobName Name of the Container App Job. + * @param detectorName 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 container Apps Job Secrets Collection ARM resource along with {@link Response} on successful completion - * of {@link Mono}. + * @return the diagnostics data for a given Container App Job. + * + * Get the diagnostics data for a Container App Job along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSecretsWithResponseAsync(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.")); - } + private Mono> getDetectorWithResponseAsync(String resourceGroupName, String jobName, + String detectorName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listSecrets(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), jobName, accept, context)) + .withContext(context -> service.getDetector(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, detectorName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List secrets for a container apps job. + * Get the diagnostics data for a given Container App Job. + * + * Get the diagnostics data for a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. + * @param jobName Name of the Container App Job. + * @param detectorName 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 container Apps Job Secrets Collection ARM resource on successful completion of {@link Mono}. + * @return the diagnostics data for a given Container App Job. + * + * Get the diagnostics data for a Container App Job on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listSecretsAsync(String resourceGroupName, String jobName) { - return listSecretsWithResponseAsync(resourceGroupName, jobName) + private Mono getDetectorAsync(String resourceGroupName, String jobName, String detectorName) { + return getDetectorWithResponseAsync(resourceGroupName, jobName, detectorName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List secrets for a container apps job. + * Get the diagnostics data for a given Container App Job. + * + * Get the diagnostics data for a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. + * @param jobName Name of the Container App Job. + * @param detectorName 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container Apps Job Secrets Collection ARM resource along with {@link Response}. + * @return the diagnostics data for a given Container App Job. + * + * Get the diagnostics data for a Container App Job along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listSecretsWithResponse(String resourceGroupName, String jobName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (jobName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); - } + public Response getDetectorWithResponse(String resourceGroupName, String jobName, + String detectorName, Context context) { final String accept = "application/json"; - return service.listSecretsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), jobName, accept, context); + return service.getDetectorSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, detectorName, accept, context); } /** - * List secrets for a container apps job. + * Get the diagnostics data for a given Container App Job. + * + * Get the diagnostics data for a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. + * @param jobName Name of the Container App Job. + * @param detectorName 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 container Apps Job Secrets Collection ARM resource. + * @return the diagnostics data for a given Container App Job. + * + * Get the diagnostics data for a Container App Job. */ @ServiceMethod(returns = ReturnType.SINGLE) - public JobSecretsCollectionInner listSecrets(String resourceGroupName, String jobName) { - return listSecretsWithResponse(resourceGroupName, jobName, Context.NONE).getValue(); + public DiagnosticsInner getDetector(String resourceGroupName, String jobName, String detectorName) { + return getDetectorWithResponse(resourceGroupName, jobName, detectorName, Context.NONE).getValue(); } /** - * Get the list of diagnostics for a given Container App Job. + * Get the Container Apps Jobs in a given resource group. * * Get the next page of items. * @@ -2684,28 +2459,22 @@ public JobSecretsCollectionInner listSecrets(String resourceGroupName, String jo * @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 list of diagnostics for a Container App Job along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the Container Apps Jobs in a given resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDetectorsNextSinglePageAsync(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.")); - } + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listDetectorsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + .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 list of diagnostics for a given Container App Job. + * Get the Container Apps Jobs in a given resource group. * * Get the next page of items. * @@ -2713,28 +2482,19 @@ private Mono> listDetectorsNextSinglePageAsync(S * @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 list of diagnostics for a Container App Job along with {@link PagedResponse}. + * @return the Container Apps Jobs in a given resource group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listDetectorsNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { final String accept = "application/json"; - Response res - = service.listDetectorsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } /** - * Get the list of diagnostics for a given Container App Job. + * Get the Container Apps Jobs in a given resource group. * * Get the next page of items. * @@ -2743,22 +2503,13 @@ private PagedResponse listDetectorsNextSinglePage(String nextL * @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 list of diagnostics for a Container App Job along with {@link PagedResponse}. + * @return the Container Apps Jobs in a given resource group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listDetectorsNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - Response res - = service.listDetectorsNextSync(nextLink, this.client.getEndpoint(), accept, context); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -2777,13 +2528,6 @@ private PagedResponse listDetectorsNextSinglePage(String nextL */ @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( @@ -2806,15 +2550,6 @@ private Mono> listBySubscriptionNextSinglePageAsync(Stri */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -2836,15 +2571,6 @@ private PagedResponse listBySubscriptionNextSinglePage(String nextLink */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); @@ -2853,7 +2579,7 @@ private PagedResponse listBySubscriptionNextSinglePage(String nextLink } /** - * Get the Container Apps Jobs in a given resource group. + * Get the list of diagnostics for a given Container App Job. * * Get the next page of items. * @@ -2861,29 +2587,23 @@ private PagedResponse listBySubscriptionNextSinglePage(String nextLink * @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 Container Apps Jobs in a given resource group along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job 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.")); - } + private Mono> listDetectorsNextSinglePageAsync(String nextLink) { 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(), + .withContext(context -> service.listDetectorsNext(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 Container Apps Jobs in a given resource group. + * Get the list of diagnostics for a given Container App Job. * * Get the next page of items. * @@ -2891,28 +2611,21 @@ private Mono> listByResourceGroupNextSinglePageAsync(Str * @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 Container Apps Jobs in a given resource group along with {@link PagedResponse}. + * @return the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listDetectorsNextSinglePage(String nextLink) { final String accept = "application/json"; - Response res - = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + Response res + = service.listDetectorsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } /** - * Get the Container Apps Jobs in a given resource group. + * Get the list of diagnostics for a given Container App Job. * * Get the next page of items. * @@ -2921,25 +2634,16 @@ private PagedResponse listByResourceGroupNextSinglePage(String nextLin * @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 Container Apps Jobs in a given resource group along with {@link PagedResponse}. + * @return the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listDetectorsNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - Response res - = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + Response res + = service.listDetectorsNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(JobsClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsExecutionsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsExecutionsClientImpl.java index 9ff5d099e39e..01f670c5c1e3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsExecutionsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsExecutionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -24,7 +24,6 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.JobsExecutionsClient; import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppJobExecutionsInner; import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionInner; @@ -60,35 +59,33 @@ public final class JobsExecutionsClientImpl implements JobsExecutionsClient { * The interface defining all the services for ContainerAppsApiClientJobsExecutions to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientJobsExecutions") public interface JobsExecutionsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); + @QueryParam("$filter") String filter, @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, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -96,7 +93,7 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -115,25 +112,10 @@ Response listNextSync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String jobName, 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 (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.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, jobName, this.client.getApiVersion(), filter, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, 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())); @@ -186,28 +168,10 @@ private PagedFlux listAsync(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String jobName, String filter) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (jobName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, jobName, - this.client.getApiVersion(), filter, accept, Context.NONE); + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, jobName, filter, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -227,28 +191,10 @@ private PagedResponse listSinglePage(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String jobName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (jobName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, jobName, - this.client.getApiVersion(), filter, accept, context); + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, jobName, filter, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -303,13 +249,6 @@ public PagedIterable list(String resourceGroupName, String jo */ @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(), @@ -330,15 +269,6 @@ private Mono> listNextSinglePageAsync(String ne */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -360,21 +290,10 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(JobsExecutionsClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsExecutionsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsExecutionsImpl.java index eb3cb8fe223a..7886906da4d9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsExecutionsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsExecutionsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; 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 65b50c4a1b06..5070f6e1238b 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -36,91 +36,107 @@ public JobsImpl(JobsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listDetectors(String resourceGroupName, String jobName) { - PagedIterable inner = this.serviceClient().listDetectors(resourceGroupName, jobName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DiagnosticsImpl(inner1, this.manager())); - } - - public PagedIterable listDetectors(String resourceGroupName, String jobName, Context context) { - PagedIterable inner = this.serviceClient().listDetectors(resourceGroupName, jobName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DiagnosticsImpl(inner1, this.manager())); + public Response getByResourceGroupWithResponse(String resourceGroupName, String jobName, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, jobName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new JobImpl(inner.getValue(), this.manager())); } - public Response getDetectorWithResponse(String resourceGroupName, String jobName, String detectorName, - Context context) { - Response inner - = this.serviceClient().getDetectorWithResponse(resourceGroupName, jobName, detectorName, context); + public Job getByResourceGroup(String resourceGroupName, String jobName) { + JobInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, jobName); if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DiagnosticsImpl(inner.getValue(), this.manager())); + return new JobImpl(inner, this.manager()); } else { return null; } } - public Diagnostics getDetector(String resourceGroupName, String jobName, String detectorName) { - DiagnosticsInner inner = this.serviceClient().getDetector(resourceGroupName, jobName, detectorName); + public void deleteByResourceGroup(String resourceGroupName, String jobName) { + this.serviceClient().delete(resourceGroupName, jobName); + } + + public void delete(String resourceGroupName, String jobName, Context context) { + this.serviceClient().delete(resourceGroupName, jobName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); + } + + public JobExecutionBase start(String resourceGroupName, String jobName) { + JobExecutionBaseInner inner = this.serviceClient().start(resourceGroupName, jobName); if (inner != null) { - return new DiagnosticsImpl(inner, this.manager()); + return new JobExecutionBaseImpl(inner, this.manager()); } else { return null; } } - public Response proxyGetWithResponse(String resourceGroupName, String jobName, String apiName, + public JobExecutionBase start(String resourceGroupName, String jobName, JobExecutionTemplate template, Context context) { - Response inner - = this.serviceClient().proxyGetWithResponse(resourceGroupName, jobName, apiName, context); + JobExecutionBaseInner inner = this.serviceClient().start(resourceGroupName, jobName, template, context); if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new JobImpl(inner.getValue(), this.manager())); + return new JobExecutionBaseImpl(inner, this.manager()); } else { return null; } } - public Job proxyGet(String resourceGroupName, String jobName, String apiName) { - JobInner inner = this.serviceClient().proxyGet(resourceGroupName, jobName, apiName); + public ContainerAppJobExecutions stopMultipleExecutions(String resourceGroupName, String jobName) { + ContainerAppJobExecutionsInner inner = this.serviceClient().stopMultipleExecutions(resourceGroupName, jobName); if (inner != null) { - return new JobImpl(inner, this.manager()); + return new ContainerAppJobExecutionsImpl(inner, this.manager()); } else { return null; } } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); + public ContainerAppJobExecutions stopMultipleExecutions(String resourceGroupName, String jobName, Context context) { + ContainerAppJobExecutionsInner inner + = this.serviceClient().stopMultipleExecutions(resourceGroupName, jobName, context); + if (inner != null) { + return new ContainerAppJobExecutionsImpl(inner, this.manager()); + } else { + return null; + } } - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); + public Response listSecretsWithResponse(String resourceGroupName, String jobName, + Context context) { + Response inner + = this.serviceClient().listSecretsWithResponse(resourceGroupName, jobName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new JobSecretsCollectionImpl(inner.getValue(), this.manager())); } - public Response getByResourceGroupWithResponse(String resourceGroupName, String jobName, Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, jobName, context); + public JobSecretsCollection listSecrets(String resourceGroupName, String jobName) { + JobSecretsCollectionInner inner = this.serviceClient().listSecrets(resourceGroupName, jobName); if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new JobImpl(inner.getValue(), this.manager())); + return new JobSecretsCollectionImpl(inner, this.manager()); } else { return null; } } - public Job getByResourceGroup(String resourceGroupName, String jobName) { - JobInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, 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 { @@ -128,28 +144,28 @@ public Job getByResourceGroup(String resourceGroupName, String jobName) { } } - public void deleteByResourceGroup(String resourceGroupName, String jobName) { - this.serviceClient().delete(resourceGroupName, jobName); - } - - public void delete(String resourceGroupName, String jobName, Context context) { - this.serviceClient().delete(resourceGroupName, jobName, context); + 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 JobExecutionBase start(String resourceGroupName, String jobName) { - JobExecutionBaseInner inner = this.serviceClient().start(resourceGroupName, jobName); + public Job suspend(String resourceGroupName, String jobName) { + JobInner inner = this.serviceClient().suspend(resourceGroupName, jobName); if (inner != null) { - return new JobExecutionBaseImpl(inner, this.manager()); + return new JobImpl(inner, this.manager()); } else { return null; } } - public JobExecutionBase start(String resourceGroupName, String jobName, JobExecutionTemplate template, - Context context) { - JobExecutionBaseInner inner = this.serviceClient().start(resourceGroupName, jobName, template, context); + public Job suspend(String resourceGroupName, String jobName, Context context) { + JobInner inner = this.serviceClient().suspend(resourceGroupName, jobName, context); if (inner != null) { - return new JobExecutionBaseImpl(inner, this.manager()); + return new JobImpl(inner, this.manager()); } else { return null; } @@ -163,41 +179,45 @@ public void stopExecution(String resourceGroupName, String jobName, String jobEx this.serviceClient().stopExecution(resourceGroupName, jobName, jobExecutionName, context); } - public ContainerAppJobExecutions stopMultipleExecutions(String resourceGroupName, String jobName) { - ContainerAppJobExecutionsInner inner = this.serviceClient().stopMultipleExecutions(resourceGroupName, jobName); - if (inner != null) { - return new ContainerAppJobExecutionsImpl(inner, this.manager()); - } else { - return null; - } + public Response proxyGetWithResponse(String resourceGroupName, String jobName, String apiName, + Context context) { + Response inner + = this.serviceClient().proxyGetWithResponse(resourceGroupName, jobName, apiName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new JobImpl(inner.getValue(), this.manager())); } - public ContainerAppJobExecutions stopMultipleExecutions(String resourceGroupName, String jobName, Context context) { - ContainerAppJobExecutionsInner inner - = this.serviceClient().stopMultipleExecutions(resourceGroupName, jobName, context); + public Job proxyGet(String resourceGroupName, String jobName, String apiName) { + JobInner inner = this.serviceClient().proxyGet(resourceGroupName, jobName, apiName); if (inner != null) { - return new ContainerAppJobExecutionsImpl(inner, this.manager()); + return new JobImpl(inner, this.manager()); } else { return null; } } - public Response listSecretsWithResponse(String resourceGroupName, String jobName, + public PagedIterable listDetectors(String resourceGroupName, String jobName) { + PagedIterable inner = this.serviceClient().listDetectors(resourceGroupName, jobName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DiagnosticsImpl(inner1, this.manager())); + } + + public PagedIterable listDetectors(String resourceGroupName, String jobName, Context context) { + PagedIterable inner = this.serviceClient().listDetectors(resourceGroupName, jobName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DiagnosticsImpl(inner1, this.manager())); + } + + public Response getDetectorWithResponse(String resourceGroupName, String jobName, String detectorName, Context context) { - Response inner - = this.serviceClient().listSecretsWithResponse(resourceGroupName, jobName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new JobSecretsCollectionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + Response inner + = this.serviceClient().getDetectorWithResponse(resourceGroupName, jobName, detectorName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DiagnosticsImpl(inner.getValue(), this.manager())); } - public JobSecretsCollection listSecrets(String resourceGroupName, String jobName) { - JobSecretsCollectionInner inner = this.serviceClient().listSecrets(resourceGroupName, jobName); + public Diagnostics getDetector(String resourceGroupName, String jobName, String detectorName) { + DiagnosticsInner inner = this.serviceClient().getDetector(resourceGroupName, jobName, detectorName); if (inner != null) { - return new JobSecretsCollectionImpl(inner, this.manager()); + return new DiagnosticsImpl(inner, this.manager()); } else { return null; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LabelHistoryImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LabelHistoryImpl.java new file mode 100644 index 000000000000..d2116040fd0e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LabelHistoryImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appcontainers.fluent.models.LabelHistoryInner; +import com.azure.resourcemanager.appcontainers.models.LabelHistory; +import com.azure.resourcemanager.appcontainers.models.LabelHistoryProperties; + +public final class LabelHistoryImpl implements LabelHistory { + private LabelHistoryInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + LabelHistoryImpl(LabelHistoryInner 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 LabelHistoryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public LabelHistoryInner 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/LogicAppImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/LogicAppImpl.java index d666457ca1db..5a9f097c51e2 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; 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 index c64669d29bad..a80855abe987 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -28,12 +28,11 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -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.implementation.models.WorkflowEnvelopeCollection; import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.appcontainers.models.WorkflowEnvelopeCollection; import reactor.core.publisher.Mono; /** @@ -65,139 +64,137 @@ public final class LogicAppsClientImpl implements LogicAppsClient { * The interface defining all the services for ContainerAppsApiClientLogicApps to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientLogicApps") 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, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @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}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @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, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @HeaderParam("Accept") String accept, @BodyParam("application/json") LogicAppInner resource, + 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) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @HeaderParam("Accept") String accept, @BodyParam("application/json") LogicAppInner resource, + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "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, + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "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) - Response deleteSync(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @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); + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/listWorkflowsConnections") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWorkflows(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listWorkflowsConnections(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @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") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/listWorkflowsConnections") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listWorkflowsSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listWorkflowsConnectionsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @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, + Mono> getWorkflow(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @PathParam("workflowName") String workflowName, @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) - Response getWorkflowSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getWorkflowSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @PathParam("workflowName") String workflowName, @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") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWorkflowsConnections(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listWorkflows(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @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") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listWorkflowsConnectionsSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listWorkflowsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @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, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -205,7 +202,7 @@ Mono> listWorkflowsNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Response listWorkflowsNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -214,7 +211,7 @@ Response listWorkflowsNextSync( * * @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. + * @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. @@ -223,29 +220,10 @@ Response listWorkflowsNextSync( @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)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, logicAppName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -254,7 +232,7 @@ private Mono> getWithResponseAsync(String resourceGroupN * * @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. + * @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. @@ -271,7 +249,7 @@ private Mono getAsync(String resourceGroupName, String containerA * * @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. + * @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. @@ -281,31 +259,9 @@ private Mono getAsync(String resourceGroupName, String containerA @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String containerAppName, String logicAppName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (logicAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, logicAppName, this.client.getApiVersion(), accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, containerAppName, logicAppName, accept, context); } /** @@ -313,7 +269,7 @@ public Response getWithResponse(String resourceGroupName, String * * @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. + * @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. @@ -329,8 +285,8 @@ public LogicAppInner get(String resourceGroupName, String containerAppName, Stri * * @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. - * @param resource Logic app resource properties. + * @param logicAppName Name of the Logic App, the extension resource. + * @param resource Resource create parameters. * @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. @@ -339,32 +295,10 @@ public LogicAppInner get(String resourceGroupName, String containerAppName, Stri @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) { - 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, + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, logicAppName, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -374,7 +308,7 @@ private Mono> createOrUpdateWithResponseAsync(String res * * @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. + * @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. @@ -393,8 +327,8 @@ private Mono createOrUpdateAsync(String resourceGroupName, String * * @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. - * @param resource Logic app resource properties. + * @param logicAppName Name of the Logic App, the extension resource. + * @param resource Resource create parameters. * @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. @@ -404,34 +338,10 @@ private Mono createOrUpdateAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String containerAppName, String logicAppName, LogicAppInner resource, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (logicAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); - } - if (resource != null) { - resource.validate(); - } final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, logicAppName, this.client.getApiVersion(), resource, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, logicAppName, accept, resource, + context); } /** @@ -439,7 +349,7 @@ public Response createOrUpdateWithResponse(String resourceGroupNa * * @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. + * @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. @@ -457,7 +367,7 @@ public LogicAppInner createOrUpdate(String resourceGroupName, String containerAp * * @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. + * @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. @@ -466,29 +376,9 @@ public LogicAppInner createOrUpdate(String resourceGroupName, String containerAp @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)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, logicAppName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -497,7 +387,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * * @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. + * @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. @@ -514,7 +404,7 @@ 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 logicAppName Name of the Logic 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. @@ -524,31 +414,8 @@ private Mono deleteAsync(String resourceGroupName, String containerAppName @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String containerAppName, String logicAppName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (logicAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, logicAppName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, logicAppName, context); } /** @@ -556,7 +423,7 @@ public Response deleteWithResponse(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 logicAppName Name of the Logic 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. @@ -567,191 +434,81 @@ public void delete(String resourceGroupName, String containerAppName, String log } /** - * List the workflows for a logic app. + * 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. + * @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}. + * @return logic app's connections along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWorkflowsSinglePageAsync(String resourceGroupName, + 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.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)) + .withContext(context -> service.listWorkflowsConnections(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, containerAppName, + logicAppName, accept, context)) .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. - * @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. + * 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. + * @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}. + * @return logic app's connections on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listWorkflowsSinglePage(String resourceGroupName, - String containerAppName, String logicAppName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (logicAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listWorkflowsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, logicAppName, this.client.getApiVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + private Mono listWorkflowsConnectionsAsync(String resourceGroupName, String containerAppName, + String logicAppName) { + return listWorkflowsConnectionsWithResponseAsync(resourceGroupName, containerAppName, logicAppName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List the workflows for a logic app. + * 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. + * @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}. + * @return logic app's connections along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listWorkflowsSinglePage(String resourceGroupName, + public Response listWorkflowsConnectionsWithResponse(String resourceGroupName, String containerAppName, String logicAppName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (logicAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); - } final String accept = "application/json"; - Response res - = service.listWorkflowsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, logicAppName, this.client.getApiVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + return service.listWorkflowsConnectionsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, logicAppName, accept, context); } /** - * List the workflows for a logic app. + * 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. + * @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}. + * @return logic app's connections. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkflowEnvelopeInner listWorkflowsConnections(String resourceGroupName, String containerAppName, String logicAppName) { - return new PagedIterable<>(() -> listWorkflowsSinglePage(resourceGroupName, containerAppName, logicAppName), - nextLink -> listWorkflowsNextSinglePage(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. - * @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<>( - () -> listWorkflowsSinglePage(resourceGroupName, containerAppName, logicAppName, context), - nextLink -> listWorkflowsNextSinglePage(nextLink, context)); + return listWorkflowsConnectionsWithResponse(resourceGroupName, containerAppName, logicAppName, Context.NONE) + .getValue(); } /** @@ -759,7 +516,7 @@ public PagedIterable listWorkflows(String resourceGroupNa * * @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. + * @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. @@ -769,33 +526,11 @@ public PagedIterable listWorkflows(String resourceGroupNa @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)) + .withContext(context -> service.getWorkflow(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, logicAppName, workflowName, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -804,7 +539,7 @@ private Mono> getWorkflowWithResponseAsync(Strin * * @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. + * @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. @@ -823,7 +558,7 @@ private Mono getWorkflowAsync(String resourceGroupName, S * * @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. + * @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. @@ -834,35 +569,10 @@ private Mono getWorkflowAsync(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response getWorkflowWithResponse(String resourceGroupName, String containerAppName, String logicAppName, String workflowName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (logicAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); - } - if (workflowName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter workflowName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getWorkflowSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - containerAppName, logicAppName, workflowName, this.client.getApiVersion(), accept, context); + return service.getWorkflowSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, logicAppName, workflowName, accept, + context); } /** @@ -870,7 +580,7 @@ public Response getWorkflowWithResponse(String resourceGr * * @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. + * @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. @@ -885,122 +595,128 @@ public WorkflowEnvelopeInner getWorkflow(String resourceGroupName, String contai } /** - * Gets logic app's connections. + * 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. + * @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}. + * @return collection of workflow information elements along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWorkflowsConnectionsWithResponseAsync(String resourceGroupName, + 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.listWorkflowsConnections(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, logicAppName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.listWorkflows(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, logicAppName, 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())); } /** - * Gets logic app's connections. + * 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. + * @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}. + * @return collection of workflow information elements as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listWorkflowsConnectionsAsync(String resourceGroupName, String containerAppName, + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listWorkflowsAsync(String resourceGroupName, String containerAppName, String logicAppName) { - return listWorkflowsConnectionsWithResponseAsync(resourceGroupName, containerAppName, logicAppName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + return new PagedFlux<>(() -> listWorkflowsSinglePageAsync(resourceGroupName, containerAppName, logicAppName), + nextLink -> listWorkflowsNextSinglePageAsync(nextLink)); } /** - * Gets logic app's connections. + * 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. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listWorkflowsSinglePage(String resourceGroupName, + String containerAppName, String logicAppName) { + final String accept = "application/json"; + Response res = service.listWorkflowsSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, containerAppName, + logicAppName, accept, Context.NONE); + return 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. * @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}. + * @return collection of workflow information elements along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWorkflowsConnectionsWithResponse(String resourceGroupName, + private PagedResponse listWorkflowsSinglePage(String resourceGroupName, String containerAppName, String logicAppName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); - } - if (logicAppName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter logicAppName is required and cannot be null.")); - } final String accept = "application/json"; - return service.listWorkflowsConnectionsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, containerAppName, logicAppName, this.client.getApiVersion(), accept, context); + Response res + = service.listWorkflowsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, containerAppName, logicAppName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Gets logic app's connections. + * 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. + * @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. + * @return collection of workflow information elements as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkflowEnvelopeInner listWorkflowsConnections(String resourceGroupName, String containerAppName, + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listWorkflows(String resourceGroupName, String containerAppName, String logicAppName) { - return listWorkflowsConnectionsWithResponse(resourceGroupName, containerAppName, logicAppName, Context.NONE) - .getValue(); + return new PagedIterable<>(() -> listWorkflowsSinglePage(resourceGroupName, containerAppName, logicAppName), + nextLink -> listWorkflowsNextSinglePage(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 PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + String logicAppName, Context context) { + return new PagedIterable<>( + () -> listWorkflowsSinglePage(resourceGroupName, containerAppName, logicAppName, context), + nextLink -> listWorkflowsNextSinglePage(nextLink, context)); } /** @@ -1017,13 +733,6 @@ public WorkflowEnvelopeInner listWorkflowsConnections(String resourceGroupName, */ @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)) @@ -1045,15 +754,6 @@ private Mono> listWorkflowsNextSinglePageAs */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listWorkflowsNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listWorkflowsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -1075,21 +775,10 @@ private PagedResponse listWorkflowsNextSinglePage(String */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listWorkflowsNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listWorkflowsNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(LogicAppsClientImpl.class); } 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 index 4f48beada06f..587ef8c39ccd 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -33,12 +33,8 @@ public Response getWithResponse(String resourceGroupName, String conta 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LogicAppImpl(inner.getValue(), this.manager())); } public LogicApp get(String resourceGroupName, String containerAppName, String logicAppName) { @@ -59,30 +55,31 @@ public void delete(String resourceGroupName, String containerAppName, String log 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 Response listWorkflowsConnectionsWithResponse(String resourceGroupName, + String containerAppName, String logicAppName, Context context) { + Response inner = this.serviceClient() + .listWorkflowsConnectionsWithResponse(resourceGroupName, containerAppName, logicAppName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WorkflowEnvelopeImpl(inner.getValue(), 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 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 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WorkflowEnvelopeImpl(inner.getValue(), this.manager())); } public WorkflowEnvelope getWorkflow(String resourceGroupName, String containerAppName, String logicAppName, @@ -96,27 +93,18 @@ public WorkflowEnvelope getWorkflow(String resourceGroupName, String containerAp } } - 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 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 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 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 LogicApp getById(String id) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/MaintenanceConfigurationResourceImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/MaintenanceConfigurationResourceImpl.java index 051ca7e8058a..dae92908afd1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/MaintenanceConfigurationResourceImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/MaintenanceConfigurationResourceImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/MaintenanceConfigurationsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/MaintenanceConfigurationsClientImpl.java index ffd535206f78..5a45b652670c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/MaintenanceConfigurationsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/MaintenanceConfigurationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -28,10 +28,9 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.MaintenanceConfigurationsClient; import com.azure.resourcemanager.appcontainers.fluent.models.MaintenanceConfigurationResourceInner; -import com.azure.resourcemanager.appcontainers.models.MaintenanceConfigurationCollection; +import com.azure.resourcemanager.appcontainers.implementation.models.MaintenanceConfigurationCollection; import reactor.core.publisher.Mono; /** @@ -63,99 +62,97 @@ public final class MaintenanceConfigurationsClientImpl implements MaintenanceCon * The interface defining all the services for ContainerAppsApiClientMaintenanceConfigurations to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientMaintenanceConfigurations") public interface MaintenanceConfigurationsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, + @PathParam("environmentName") String environmentName, @PathParam("configName") String configName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, + @PathParam("environmentName") String environmentName, @PathParam("configName") String configName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("configName") String configName, - @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") MaintenanceConfigurationResourceInner maintenanceConfigurationEnvelope, - @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("configName") String configName, - @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") MaintenanceConfigurationResourceInner maintenanceConfigurationEnvelope, - @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("configName") String configName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("configName") String configName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @PathParam("configName") String configName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @PathParam("configName") String configName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @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, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -163,188 +160,93 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Gets all maintenance configurations in the specified Managed Environment. + * Gets the maintenance configuration of a ManagedEnvironment . * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all maintenance configurations in the specified Managed Environment along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return the maintenance configuration of a ManagedEnvironment along with {@link Response} 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.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, + String environmentName, String configName) { 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)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, configName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets all maintenance configurations in the specified Managed Environment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The 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 all maintenance configurations in the specified 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)); - } - - /** - * Gets all maintenance configurations in the specified Managed Environment. + * Gets the maintenance configuration of a ManagedEnvironment . * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all maintenance configurations in the specified Managed Environment along with {@link PagedResponse}. + * @return the maintenance configuration of a ManagedEnvironment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, - String environmentName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + private Mono getAsync(String resourceGroupName, String environmentName, + String configName) { + return getWithResponseAsync(resourceGroupName, environmentName, configName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets all maintenance configurations in the specified Managed Environment. + * Gets the maintenance configuration of a ManagedEnvironment . * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. * @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 all maintenance configurations in the specified Managed Environment along with {@link PagedResponse}. + * @return the maintenance configuration of a ManagedEnvironment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, - String environmentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } + public Response getWithResponse(String resourceGroupName, + String environmentName, String configName, Context context) { final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets all maintenance configurations in the specified Managed Environment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The 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 all maintenance configurations in the specified Managed Environment as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String environmentName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, environmentName), - nextLink -> listNextSinglePage(nextLink)); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, configName, accept, context); } /** - * Gets all maintenance configurations in the specified Managed Environment. + * Gets the maintenance configuration of a ManagedEnvironment . * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param context The context to associate with this operation. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all maintenance configurations in the specified Managed Environment as paginated response with - * {@link PagedIterable}. + * @return the maintenance configuration of a ManagedEnvironment. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String environmentName, - Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, environmentName, context), - nextLink -> listNextSinglePage(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public MaintenanceConfigurationResourceInner get(String resourceGroupName, String environmentName, + String configName) { + return getWithResponse(resourceGroupName, environmentName, configName, Context.NONE).getValue(); } /** * Create or update the maintenance configuration for Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. * @param maintenanceConfigurationEnvelope Parameters to set the maintenance configuration for ManagedEnvironment . * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -356,36 +258,12 @@ public PagedIterable list(String resource private Mono> createOrUpdateWithResponseAsync( String resourceGroupName, String environmentName, String configName, MaintenanceConfigurationResourceInner maintenanceConfigurationEnvelope) { - 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 (configName == null) { - return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); - } - if (maintenanceConfigurationEnvelope == null) { - return Mono.error(new IllegalArgumentException( - "Parameter maintenanceConfigurationEnvelope is required and cannot be null.")); - } else { - maintenanceConfigurationEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, configName, this.client.getApiVersion(), - maintenanceConfigurationEnvelope, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, configName, contentType, accept, + maintenanceConfigurationEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -393,8 +271,8 @@ private Mono> createOrUpdateWith * Create or update the maintenance configuration for Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. * @param maintenanceConfigurationEnvelope Parameters to set the maintenance configuration for ManagedEnvironment . * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -413,8 +291,8 @@ private Mono createOrUpdateAsync(String r * Create or update the maintenance configuration for Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. * @param maintenanceConfigurationEnvelope Parameters to set the maintenance configuration for ManagedEnvironment . * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -426,47 +304,19 @@ private Mono createOrUpdateAsync(String r public Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, String configName, MaintenanceConfigurationResourceInner maintenanceConfigurationEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (configName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter configName is required and cannot be null.")); - } - if (maintenanceConfigurationEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter maintenanceConfigurationEnvelope is required and cannot be null.")); - } else { - maintenanceConfigurationEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, configName, this.client.getApiVersion(), maintenanceConfigurationEnvelope, accept, - context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, configName, contentType, accept, + maintenanceConfigurationEnvelope, context); } /** * Create or update the maintenance configuration for Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. * @param maintenanceConfigurationEnvelope Parameters to set the maintenance configuration for ManagedEnvironment . * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -484,8 +334,8 @@ public MaintenanceConfigurationResourceInner createOrUpdate(String resourceGroup * Deletes the maintenance configuration of a ManagedEnvironment . * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -494,29 +344,9 @@ public MaintenanceConfigurationResourceInner createOrUpdate(String resourceGroup @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String environmentName, String configName) { - 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 (configName == null) { - return Mono.error(new IllegalArgumentException("Parameter configName 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, configName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, configName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -524,8 +354,8 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * Deletes the maintenance configuration of a ManagedEnvironment . * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -540,8 +370,8 @@ private Mono deleteAsync(String resourceGroupName, String environmentName, * Deletes the maintenance configuration of a ManagedEnvironment . * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. * @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. @@ -551,39 +381,16 @@ private Mono deleteAsync(String resourceGroupName, String environmentName, @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String environmentName, String configName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (configName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter configName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, configName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, configName, context); } /** * Deletes the maintenance configuration of a ManagedEnvironment . * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -594,121 +401,123 @@ public void delete(String resourceGroupName, String environmentName, String conf } /** - * Gets the maintenance configuration of a ManagedEnvironment . + * Gets all maintenance configurations in the specified Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. + * @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 maintenance configuration of a ManagedEnvironment along with {@link Response} on successful - * completion of {@link Mono}. + * @return all maintenance configurations in the specified Managed Environment along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String environmentName, String configName) { - 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 (configName == null) { - return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); - } + private Mono> listSinglePageAsync(String resourceGroupName, + String environmentName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, configName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, 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())); } /** - * Gets the maintenance configuration of a ManagedEnvironment . + * Gets all maintenance configurations in the specified Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. + * @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 maintenance configuration of a ManagedEnvironment on successful completion of {@link Mono}. + * @return all maintenance configurations in the specified 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)); + } + + /** + * Gets all maintenance configurations in the specified 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 all maintenance configurations in the specified Managed Environment along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String environmentName, - String configName) { - return getWithResponseAsync(resourceGroupName, environmentName, configName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String resourceGroupName, + String environmentName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Gets the maintenance configuration of a ManagedEnvironment . + * Gets all maintenance configurations in the specified Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. + * @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 maintenance configuration of a ManagedEnvironment along with {@link Response}. + * @return all maintenance configurations in the specified Managed Environment along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, - String environmentName, String configName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (configName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter configName is required and cannot be null.")); - } + private PagedResponse listSinglePage(String resourceGroupName, + String environmentName, Context context) { final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, configName, this.client.getApiVersion(), accept, context); + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Gets the maintenance configuration of a ManagedEnvironment . + * Gets all maintenance configurations in the specified Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. + * @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 maintenance configuration of a ManagedEnvironment. + * @return all maintenance configurations in the specified Managed Environment as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MaintenanceConfigurationResourceInner get(String resourceGroupName, String environmentName, - String configName) { - return getWithResponse(resourceGroupName, environmentName, configName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, environmentName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets all maintenance configurations in the specified 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 all maintenance configurations in the specified Managed Environment as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, environmentName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -723,13 +532,6 @@ public MaintenanceConfigurationResourceInner get(String resourceGroupName, Strin */ @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(), @@ -748,15 +550,6 @@ private Mono> listNextSingl */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -776,21 +569,10 @@ private PagedResponse listNextSinglePage( */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(MaintenanceConfigurationsClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/MaintenanceConfigurationsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/MaintenanceConfigurationsImpl.java index febbb08910b2..943011725675 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/MaintenanceConfigurationsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/MaintenanceConfigurationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -27,19 +27,22 @@ public MaintenanceConfigurationsImpl(MaintenanceConfigurationsClient innerClient this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String environmentName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, environmentName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new MaintenanceConfigurationResourceImpl(inner1, this.manager())); + public Response getWithResponse(String resourceGroupName, String environmentName, + String configName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, environmentName, configName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MaintenanceConfigurationResourceImpl(inner.getValue(), 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 MaintenanceConfigurationResourceImpl(inner1, this.manager())); + public MaintenanceConfigurationResource get(String resourceGroupName, String environmentName, String configName) { + MaintenanceConfigurationResourceInner inner + = this.serviceClient().get(resourceGroupName, environmentName, configName); + if (inner != null) { + return new MaintenanceConfigurationResourceImpl(inner, this.manager()); + } else { + return null; + } } public Response deleteWithResponse(String resourceGroupName, String environmentName, String configName, @@ -51,26 +54,19 @@ public void delete(String resourceGroupName, String environmentName, String conf this.serviceClient().delete(resourceGroupName, environmentName, configName); } - public Response getWithResponse(String resourceGroupName, String environmentName, - String configName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, environmentName, configName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new MaintenanceConfigurationResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public PagedIterable list(String resourceGroupName, String environmentName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, environmentName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new MaintenanceConfigurationResourceImpl(inner1, this.manager())); } - public MaintenanceConfigurationResource get(String resourceGroupName, String environmentName, String configName) { - MaintenanceConfigurationResourceInner inner - = this.serviceClient().get(resourceGroupName, environmentName, configName); - if (inner != null) { - return new MaintenanceConfigurationResourceImpl(inner, this.manager()); - } else { - return null; - } + public PagedIterable list(String resourceGroupName, String environmentName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, environmentName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new MaintenanceConfigurationResourceImpl(inner1, this.manager())); } public MaintenanceConfigurationResource getById(String id) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificateImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificateImpl.java index a6acd90fa591..930f90573630 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificateImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificateImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesClientImpl.java index 8f8c2aeeedcf..60dd9d9fb8ed 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -31,13 +31,11 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.appcontainers.fluent.ManagedCertificatesClient; import com.azure.resourcemanager.appcontainers.fluent.models.ManagedCertificateInner; -import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.appcontainers.models.ManagedCertificateCollection; +import com.azure.resourcemanager.appcontainers.implementation.models.ManagedCertificateCollection; import com.azure.resourcemanager.appcontainers.models.ManagedCertificatePatch; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -72,141 +70,131 @@ public final class ManagedCertificatesClientImpl implements ManagedCertificatesC * The interface defining all the services for ContainerAppsApiClientManagedCertificates to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientManagedCertificates") public interface ManagedCertificatesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, - @PathParam("managedCertificateName") String managedCertificateName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("managedCertificateName") String managedCertificateName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, - @PathParam("managedCertificateName") String managedCertificateName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("managedCertificateName") String managedCertificateName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 400 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, - @PathParam("managedCertificateName") String managedCertificateName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ManagedCertificateInner managedCertificateEnvelope, - @HeaderParam("Accept") String accept, Context context); + @PathParam("managedCertificateName") String managedCertificateName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedCertificateInner managedCertificateEnvelope, Context context); @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(value = ManagementException.class, code = { 400 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, - @PathParam("managedCertificateName") String managedCertificateName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ManagedCertificateInner managedCertificateEnvelope, - @HeaderParam("Accept") String accept, Context context); + @PathParam("managedCertificateName") String managedCertificateName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedCertificateInner managedCertificateEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("managedCertificateName") String managedCertificateName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedCertificatePatch managedCertificateEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("managedCertificateName") String managedCertificateName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedCertificatePatch managedCertificateEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, - @PathParam("managedCertificateName") String managedCertificateName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ManagedCertificatePatch managedCertificateEnvelope, - @HeaderParam("Accept") String accept, Context context); + @PathParam("managedCertificateName") String managedCertificateName, Context context); - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response updateSync(@HostParam("$host") String endpoint, + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, - @PathParam("managedCertificateName") String managedCertificateName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ManagedCertificatePatch managedCertificateEnvelope, - @HeaderParam("Accept") String accept, Context context); + @PathParam("managedCertificateName") String managedCertificateName, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -214,41 +202,21 @@ Response listNextSync( * Get the specified Managed Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 specified Managed Certificate along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String environmentName, String managedCertificateName) { - 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 (managedCertificateName == null) { - return Mono.error( - new IllegalArgumentException("Parameter managedCertificateName 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, managedCertificateName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, managedCertificateName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -256,10 +224,10 @@ private Mono> getWithResponseAsync(String reso * Get the specified Managed Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 specified Managed Certificate on successful completion of {@link Mono}. */ @@ -274,52 +242,30 @@ private Mono getAsync(String resourceGroupName, String * Get the specified Managed Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. * @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 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 specified Managed Certificate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String environmentName, String managedCertificateName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (managedCertificateName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter managedCertificateName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, managedCertificateName, this.client.getApiVersion(), accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, managedCertificateName, accept, context); } /** * Get the specified Managed Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 specified Managed Certificate. */ @@ -337,7 +283,7 @@ public ManagedCertificateInner get(String resourceGroupName, String environmentN * @param managedCertificateName Name of the Managed Certificate. * @param managedCertificateEnvelope Managed Certificate to be created or updated. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws ManagementException thrown if the request is rejected by server on status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment along @@ -346,34 +292,11 @@ public ManagedCertificateInner get(String resourceGroupName, String environmentN @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String environmentName, String managedCertificateName, ManagedCertificateInner managedCertificateEnvelope) { - 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 (managedCertificateName == null) { - return Mono.error( - new IllegalArgumentException("Parameter managedCertificateName is required and cannot be null.")); - } - if (managedCertificateEnvelope != null) { - managedCertificateEnvelope.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, managedCertificateName, this.client.getApiVersion(), - managedCertificateEnvelope, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, managedCertificateName, accept, + managedCertificateEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -385,7 +308,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param managedCertificateName Name of the Managed Certificate. * @param managedCertificateEnvelope Managed Certificate to be created or updated. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws ManagementException thrown if the request is rejected by server on status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment along @@ -394,35 +317,10 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, String managedCertificateName, ManagedCertificateInner managedCertificateEnvelope) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (managedCertificateName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter managedCertificateName is required and cannot be null.")); - } - if (managedCertificateEnvelope != null) { - managedCertificateEnvelope.validate(); - } final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, managedCertificateName, this.client.getApiVersion(), managedCertificateEnvelope, accept, - Context.NONE); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, managedCertificateName, accept, + managedCertificateEnvelope, Context.NONE); } /** @@ -434,7 +332,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName * @param managedCertificateEnvelope Managed Certificate to be created or updated. * @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 ManagementException thrown if the request is rejected by server. * @throws ManagementException thrown if the request is rejected by server on status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment along @@ -443,35 +341,10 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, String managedCertificateName, ManagedCertificateInner managedCertificateEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (managedCertificateName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter managedCertificateName is required and cannot be null.")); - } - if (managedCertificateEnvelope != null) { - managedCertificateEnvelope.validate(); - } final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, managedCertificateName, this.client.getApiVersion(), managedCertificateEnvelope, accept, - context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, managedCertificateName, accept, + managedCertificateEnvelope, context); } /** @@ -482,7 +355,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName * @param managedCertificateName Name of the Managed Certificate. * @param managedCertificateEnvelope Managed Certificate to be created or updated. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws ManagementException thrown if the request is rejected by server on status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of managed certificates used for Custom Domain bindings of Container @@ -506,7 +379,7 @@ private PollerFlux, ManagedCertificateInner> * @param environmentName Name of the Managed Environment. * @param managedCertificateName Name of the Managed Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws ManagementException thrown if the request is rejected by server on status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of managed certificates used for Custom Domain bindings of Container @@ -531,7 +404,7 @@ private PollerFlux, ManagedCertificateInner> * @param managedCertificateName Name of the Managed Certificate. * @param managedCertificateEnvelope Managed Certificate to be created or updated. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws ManagementException thrown if the request is rejected by server on status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of managed certificates used for Custom Domain bindings of Container @@ -554,7 +427,7 @@ public SyncPoller, ManagedCertificateInner> * @param environmentName Name of the Managed Environment. * @param managedCertificateName Name of the Managed Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws ManagementException thrown if the request is rejected by server on status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of managed certificates used for Custom Domain bindings of Container @@ -579,7 +452,7 @@ public SyncPoller, ManagedCertificateInner> * @param managedCertificateEnvelope Managed Certificate to be created or updated. * @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 ManagementException thrown if the request is rejected by server. * @throws ManagementException thrown if the request is rejected by server on status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of managed certificates used for Custom Domain bindings of Container @@ -603,7 +476,7 @@ public SyncPoller, ManagedCertificateInner> * @param managedCertificateName Name of the Managed Certificate. * @param managedCertificateEnvelope Managed Certificate to be created or updated. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws ManagementException thrown if the request is rejected by server on status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment on @@ -623,7 +496,7 @@ private Mono createOrUpdateAsync(String resourceGroupNa * @param environmentName Name of the Managed Environment. * @param managedCertificateName Name of the Managed Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws ManagementException thrown if the request is rejected by server on status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment on @@ -644,7 +517,7 @@ private Mono createOrUpdateAsync(String resourceGroupNa * @param environmentName Name of the Managed Environment. * @param managedCertificateName Name of the Managed Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws ManagementException thrown if the request is rejected by server on status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment. @@ -666,7 +539,7 @@ public ManagedCertificateInner createOrUpdate(String resourceGroupName, String e * @param managedCertificateEnvelope Managed Certificate to be created or updated. * @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 ManagementException thrown if the request is rejected by server. * @throws ManagementException thrown if the request is rejected by server on status code 400. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment. @@ -679,277 +552,179 @@ public ManagedCertificateInner createOrUpdate(String resourceGroupName, String e } /** - * Deletes the specified Managed Certificate. + * Update tags of a managed certificate + * + * Patches a managed certificate. Oly patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Properties of a managed certificate that need to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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}. + * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String environmentName, - String managedCertificateName) { - 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 (managedCertificateName == null) { - return Mono.error( - new IllegalArgumentException("Parameter managedCertificateName is required and cannot be null.")); - } + private Mono> updateWithResponseAsync(String resourceGroupName, + String environmentName, String managedCertificateName, ManagedCertificatePatch managedCertificateEnvelope) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, managedCertificateName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, managedCertificateName, + contentType, accept, managedCertificateEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes the specified Managed Certificate. + * Update tags of a managed certificate + * + * Patches a managed certificate. Oly patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Properties of a managed certificate that need to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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. + * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String environmentName, String managedCertificateName) { - return deleteWithResponseAsync(resourceGroupName, environmentName, managedCertificateName) - .flatMap(ignored -> Mono.empty()); + private Mono updateAsync(String resourceGroupName, String environmentName, + String managedCertificateName, ManagedCertificatePatch managedCertificateEnvelope) { + return updateWithResponseAsync(resourceGroupName, environmentName, managedCertificateName, + managedCertificateEnvelope).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes the specified Managed Certificate. + * Update tags of a managed certificate + * + * Patches a managed certificate. Oly patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Properties of a managed certificate that need to be updated. * @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 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}. + * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String environmentName, - String managedCertificateName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (managedCertificateName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter managedCertificateName is required and cannot be null.")); - } + public Response updateWithResponse(String resourceGroupName, String environmentName, + String managedCertificateName, ManagedCertificatePatch managedCertificateEnvelope, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, managedCertificateName, this.client.getApiVersion(), accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, managedCertificateName, contentType, + accept, managedCertificateEnvelope, context); } /** - * Deletes the specified Managed Certificate. + * Update tags of a managed certificate + * + * Patches a managed certificate. Oly patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Properties of a managed certificate that need to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String environmentName, String managedCertificateName) { - deleteWithResponse(resourceGroupName, environmentName, managedCertificateName, Context.NONE); + public ManagedCertificateInner update(String resourceGroupName, String environmentName, + String managedCertificateName, ManagedCertificatePatch managedCertificateEnvelope) { + return updateWithResponse(resourceGroupName, environmentName, managedCertificateName, + managedCertificateEnvelope, Context.NONE).getValue(); } /** - * Update tags of a managed certificate - * - * Patches a managed certificate. Oly patching of tags is supported. + * Deletes the specified Managed Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. - * @param managedCertificateEnvelope Properties of a managed certificate that need to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment along - * with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String environmentName, String managedCertificateName, ManagedCertificatePatch managedCertificateEnvelope) { - 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 (managedCertificateName == null) { - return Mono.error( - new IllegalArgumentException("Parameter managedCertificateName is required and cannot be null.")); - } - if (managedCertificateEnvelope == null) { - return Mono.error( - new IllegalArgumentException("Parameter managedCertificateEnvelope is required and cannot be null.")); - } else { - managedCertificateEnvelope.validate(); - } - final String accept = "application/json"; + private Mono> deleteWithResponseAsync(String resourceGroupName, String environmentName, + String managedCertificateName) { return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, managedCertificateName, this.client.getApiVersion(), - managedCertificateEnvelope, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, managedCertificateName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update tags of a managed certificate - * - * Patches a managed certificate. Oly patching of tags is supported. + * Deletes the specified Managed Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. - * @param managedCertificateEnvelope Properties of a managed certificate that need to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment on - * successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String environmentName, - String managedCertificateName, ManagedCertificatePatch managedCertificateEnvelope) { - return updateWithResponseAsync(resourceGroupName, environmentName, managedCertificateName, - managedCertificateEnvelope).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono deleteAsync(String resourceGroupName, String environmentName, String managedCertificateName) { + return deleteWithResponseAsync(resourceGroupName, environmentName, managedCertificateName) + .flatMap(ignored -> Mono.empty()); } /** - * Update tags of a managed certificate - * - * Patches a managed certificate. Oly patching of tags is supported. + * Deletes the specified Managed Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. - * @param managedCertificateEnvelope Properties of a managed certificate that need to be updated. * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment along - * with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String environmentName, - String managedCertificateName, ManagedCertificatePatch managedCertificateEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (managedCertificateName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter managedCertificateName is required and cannot be null.")); - } - if (managedCertificateEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter managedCertificateEnvelope is required and cannot be null.")); - } else { - managedCertificateEnvelope.validate(); - } - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, managedCertificateName, this.client.getApiVersion(), managedCertificateEnvelope, accept, - context); + public Response deleteWithResponse(String resourceGroupName, String environmentName, + String managedCertificateName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, managedCertificateName, context); } /** - * Update tags of a managed certificate - * - * Patches a managed certificate. Oly patching of tags is supported. + * Deletes the specified Managed Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. - * @param managedCertificateEnvelope Properties of a managed certificate that need to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedCertificateInner update(String resourceGroupName, String environmentName, - String managedCertificateName, ManagedCertificatePatch managedCertificateEnvelope) { - return updateWithResponse(resourceGroupName, environmentName, managedCertificateName, - managedCertificateEnvelope, Context.NONE).getValue(); + public void delete(String resourceGroupName, String environmentName, String managedCertificateName) { + deleteWithResponse(resourceGroupName, environmentName, managedCertificateName, Context.NONE); } /** * Get the Managed Certificates in 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 environmentName Name of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 Managed Certificates in a given managed environment along with {@link PagedResponse} on successful * completion of {@link Mono}. @@ -957,26 +732,10 @@ public ManagedCertificateInner update(String resourceGroupName, String environme @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)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, 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())); @@ -986,9 +745,9 @@ private Mono> listSinglePageAsync(String * Get the Managed Certificates in 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 environmentName Name of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 Managed Certificates in a given managed environment as paginated response with {@link PagedFlux}. */ @@ -1002,36 +761,18 @@ private PagedFlux listAsync(String resourceGroupName, S * Get the Managed Certificates in 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 environmentName Name of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 Managed Certificates in a given managed environment along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String environmentName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, Context.NONE); + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -1040,38 +781,20 @@ private PagedResponse listSinglePage(String resourceGro * Get the Managed Certificates in 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 environmentName Name of the 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 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 Managed Certificates in a given managed environment along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String environmentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, context); + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -1080,9 +803,9 @@ private PagedResponse listSinglePage(String resourceGro * Get the Managed Certificates in 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 environmentName Name of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 Managed Certificates in a given managed environment as paginated response with {@link PagedIterable}. */ @@ -1096,10 +819,10 @@ public PagedIterable list(String resourceGroupName, Str * Get the Managed Certificates in 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 environmentName Name of the 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 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 Managed Certificates in a given managed environment as paginated response with {@link PagedIterable}. */ @@ -1117,20 +840,13 @@ public PagedIterable list(String resourceGroupName, Str * * @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 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 Managed Certificates in a given managed environment 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(), @@ -1145,21 +861,12 @@ private Mono> listNextSinglePageAsync(Str * * @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 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 Managed Certificates in a given managed environment along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -1175,27 +882,16 @@ private PagedResponse listNextSinglePage(String nextLin * @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 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 Managed Certificates in a given managed environment along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(ManagedCertificatesClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesImpl.java index 3f5344d87c4d..f0879303cea1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -31,12 +31,8 @@ public Response getWithResponse(String resourceGroupName, St String managedCertificateName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, environmentName, managedCertificateName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ManagedCertificateImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ManagedCertificateImpl(inner.getValue(), this.manager())); } public ManagedCertificate get(String resourceGroupName, String environmentName, String managedCertificateName) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentDiagnosticsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentDiagnosticsClientImpl.java index 2b4b9e1b2d7b..61160895486b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentDiagnosticsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentDiagnosticsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -20,7 +20,6 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentDiagnosticsClient; import com.azure.resourcemanager.appcontainers.fluent.models.DiagnosticsCollectionInner; import com.azure.resourcemanager.appcontainers.fluent.models.DiagnosticsInner; @@ -56,48 +55,48 @@ public final class ManagedEnvironmentDiagnosticsClientImpl implements ManagedEnv * The interface defining all the services for ContainerAppsApiClientManagedEnvironmentDiagnostics to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientManagedEnvironmentDiagnostics") public interface ManagedEnvironmentDiagnosticsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectors") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listDetectors(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listDetectors(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectors") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listDetectorsSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listDetectorsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectors/{detectorName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getDetector(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getDetector(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("detectorName") String detectorName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectors/{detectorName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getDetectorSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getDetectorSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("detectorName") String detectorName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** @@ -106,36 +105,22 @@ Response getDetectorSync(@HostParam("$host") String endpoint, * Get the list of diagnostics for a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. + * @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 list of diagnostics for a Managed Environment used to host container apps along with {@link Response} - * on successful completion of {@link Mono}. + * @return the list of diagnostics for a given Managed Environment. + * + * Get the list of diagnostics for a Managed Environment used to host container apps along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDetectorsWithResponseAsync(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.listDetectors(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.listDetectors(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -145,11 +130,13 @@ private Mono> listDetectorsWithResponseAsyn * Get the list of diagnostics for a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. + * @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 list of diagnostics for a Managed Environment used to host container apps on successful completion of + * @return the list of diagnostics for a given Managed Environment. + * + * Get the list of diagnostics for a Managed Environment used to host container apps on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -164,38 +151,21 @@ private Mono listDetectorsAsync(String resourceGroup * Get the list of diagnostics for a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. + * @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 list of diagnostics for a Managed Environment used to host container apps along with - * {@link Response}. + * @return the list of diagnostics for a given Managed Environment. + * + * Get the list of diagnostics for a Managed Environment used to host container apps along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listDetectorsWithResponse(String resourceGroupName, String environmentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } final String accept = "application/json"; - return service.listDetectorsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, context); + return service.listDetectorsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, accept, context); } /** @@ -204,11 +174,13 @@ public Response listDetectorsWithResponse(String res * Get the list of diagnostics for a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. + * @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 list of diagnostics for a Managed Environment used to host container apps. + * @return the list of diagnostics for a given Managed Environment. + * + * Get the list of diagnostics for a Managed Environment used to host container apps. */ @ServiceMethod(returns = ReturnType.SINGLE) public DiagnosticsCollectionInner listDetectors(String resourceGroupName, String environmentName) { @@ -221,40 +193,23 @@ public DiagnosticsCollectionInner listDetectors(String resourceGroupName, String * Get the diagnostics data for a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param detectorName Name of the Managed Environment detector. + * @param environmentName Name of the Managed Environment. + * @param detectorName Name of the detector. * @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 diagnostics data for a Managed Environment used to host container apps along with {@link Response} on + * @return the diagnostics data for a given Managed Environment. + * + * Get the diagnostics data for a Managed Environment used to host container apps along with {@link Response} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDetectorWithResponseAsync(String resourceGroupName, String environmentName, String detectorName) { - 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 (detectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter detectorName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getDetector(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, detectorName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getDetector(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, detectorName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -264,12 +219,14 @@ private Mono> getDetectorWithResponseAsync(String res * Get the diagnostics data for a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param detectorName Name of the Managed Environment detector. + * @param environmentName Name of the Managed Environment. + * @param detectorName Name of the detector. * @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 diagnostics data for a Managed Environment used to host container apps on successful completion of + * @return the diagnostics data for a given Managed Environment. + * + * Get the diagnostics data for a Managed Environment used to host container apps on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -285,42 +242,22 @@ private Mono getDetectorAsync(String resourceGroupName, String * Get the diagnostics data for a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param detectorName Name of the Managed Environment detector. + * @param environmentName Name of the Managed Environment. + * @param detectorName Name of the detector. * @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 diagnostics data for a Managed Environment used to host container apps along with {@link Response}. + * @return the diagnostics data for a given Managed Environment. + * + * Get the diagnostics data for a Managed Environment used to host container apps along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDetectorWithResponse(String resourceGroupName, String environmentName, String detectorName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (detectorName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter detectorName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getDetectorSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, detectorName, this.client.getApiVersion(), accept, context); + return service.getDetectorSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, detectorName, accept, context); } /** @@ -329,17 +266,17 @@ public Response getDetectorWithResponse(String resourceGroupNa * Get the diagnostics data for a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param detectorName Name of the Managed Environment detector. + * @param environmentName Name of the Managed Environment. + * @param detectorName Name of the detector. * @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 diagnostics data for a Managed Environment used to host container apps. + * @return the diagnostics data for a given Managed Environment. + * + * Get the diagnostics data for a Managed Environment used to host container apps. */ @ServiceMethod(returns = ReturnType.SINGLE) public DiagnosticsInner getDetector(String resourceGroupName, String environmentName, String detectorName) { return getDetectorWithResponse(resourceGroupName, environmentName, detectorName, Context.NONE).getValue(); } - - private static final ClientLogger LOGGER = new ClientLogger(ManagedEnvironmentDiagnosticsClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentDiagnosticsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentDiagnosticsImpl.java index 0a191bfe668a..c80dcaa5bed1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentDiagnosticsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentDiagnosticsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -32,12 +32,8 @@ public Response listDetectorsWithResponse(String resource Context context) { Response inner = this.serviceClient().listDetectorsWithResponse(resourceGroupName, environmentName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DiagnosticsCollectionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DiagnosticsCollectionImpl(inner.getValue(), this.manager())); } public DiagnosticsCollection listDetectors(String resourceGroupName, String environmentName) { @@ -53,12 +49,8 @@ public Response getDetectorWithResponse(String resourceGroupName, S String detectorName, Context context) { Response inner = this.serviceClient().getDetectorWithResponse(resourceGroupName, environmentName, detectorName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DiagnosticsImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DiagnosticsImpl(inner.getValue(), this.manager())); } public Diagnostics getDetector(String resourceGroupName, String environmentName, String detectorName) { 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 4a7a8ffed0a2..e42ca94c754c 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -10,7 +10,10 @@ 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.CheckMigrationEligibilityRequest; +import com.azure.resourcemanager.appcontainers.models.CheckMigrationEligibilityResponse; import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; import com.azure.resourcemanager.appcontainers.models.DaprConfiguration; import com.azure.resourcemanager.appcontainers.models.EnvironmentAuthToken; @@ -18,9 +21,11 @@ import com.azure.resourcemanager.appcontainers.models.IngressConfiguration; import com.azure.resourcemanager.appcontainers.models.KedaConfiguration; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironment; +import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentMode; 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; @@ -105,6 +110,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(); } @@ -150,6 +163,10 @@ public IngressConfiguration ingressConfiguration() { return this.innerModel().ingressConfiguration(); } + public ManagedEnvironmentMode environmentMode() { + return this.innerModel().environmentMode(); + } + public List privateEndpointConnections() { List inner = this.innerModel().privateEndpointConnections(); if (inner != null) { @@ -266,6 +283,16 @@ public EnvironmentAuthToken getAuthToken() { return serviceManager.managedEnvironments().getAuthToken(resourceGroupName, environmentName); } + public Response + checkMigrationEligibilityWithResponse(CheckMigrationEligibilityRequest body, Context context) { + return serviceManager.managedEnvironments() + .checkMigrationEligibilityWithResponse(resourceGroupName, environmentName, body, context); + } + + public CheckMigrationEligibilityResponse checkMigrationEligibility(CheckMigrationEligibilityRequest body) { + return serviceManager.managedEnvironments().checkMigrationEligibility(resourceGroupName, environmentName, body); + } + public ManagedEnvironmentImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -311,6 +338,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; @@ -358,6 +396,11 @@ public ManagedEnvironmentImpl withIngressConfiguration(IngressConfiguration ingr return this; } + public ManagedEnvironmentImpl withEnvironmentMode(ManagedEnvironmentMode environmentMode) { + this.innerModel().withEnvironmentMode(environmentMode); + 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 index 8302b6f120bd..abe877a8e17c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -30,12 +30,11 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; 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 com.azure.resourcemanager.appcontainers.implementation.models.PrivateEndpointConnectionListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -71,105 +70,101 @@ public final class ManagedEnvironmentPrivateEndpointConnectionsClientImpl * The interface defining all the services for ContainerAppsApiClientManagedEnvironmentPrivateEndpointConnections to * be used by the proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientManagedEnvironmentPrivateEndpointConnections") 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") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@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, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @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) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @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, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, - @HeaderParam("Accept") String accept, Context context); + 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) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, - @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "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, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @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, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -177,190 +172,16 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, - String environmentName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, Context.NONE); - return 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. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, - String environmentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, context); - return 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 PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String environmentName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, environmentName), - nextLink -> listNextSinglePage(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 PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String environmentName, - Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, environmentName, context), - nextLink -> listNextSinglePage(nextLink, 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -370,31 +191,11 @@ public PagedIterable list(String resourceGroupNa @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)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, privateEndpointConnectionName, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -402,9 +203,8 @@ private Mono> getWithResponseAsync(Stri * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -421,9 +221,8 @@ private Mono getAsync(String resourceGroupName, * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -433,41 +232,17 @@ private Mono getAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String environmentName, String privateEndpointConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, privateEndpointConnectionName, 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. + * @param environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -484,9 +259,8 @@ public PrivateEndpointConnectionInner get(String resourceGroupName, String envir * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -498,37 +272,12 @@ public PrivateEndpointConnectionInner get(String resourceGroupName, String envir 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 contentType = "application/json"; 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)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, privateEndpointConnectionName, + contentType, accept, privateEndpointConnectionEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -536,9 +285,8 @@ private Mono>> createOrUpdateWithResponseAsync(String * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -548,49 +296,19 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (privateEndpointConnectionEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter privateEndpointConnectionEnvelope is required and cannot be null.")); - } else { - privateEndpointConnectionEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, privateEndpointConnectionName, this.client.getApiVersion(), - privateEndpointConnectionEnvelope, accept, Context.NONE); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, privateEndpointConnectionName, + contentType, accept, privateEndpointConnectionEnvelope, Context.NONE); } /** * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -602,49 +320,19 @@ private Response createOrUpdateWithResponse(String resourceGroupName private Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (privateEndpointConnectionEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter privateEndpointConnectionEnvelope is required and cannot be null.")); - } else { - privateEndpointConnectionEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, privateEndpointConnectionName, this.client.getApiVersion(), - privateEndpointConnectionEnvelope, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, privateEndpointConnectionName, + contentType, accept, privateEndpointConnectionEnvelope, 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -666,9 +354,8 @@ private Response createOrUpdateWithResponse(String resourceGroupName * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -689,9 +376,8 @@ public SyncPoller, PrivateEndpointCon * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -713,9 +399,8 @@ public SyncPoller, PrivateEndpointCon * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -733,9 +418,8 @@ private Mono createOrUpdateAsync(String resource * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -753,9 +437,8 @@ public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, S * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -775,9 +458,8 @@ public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, S * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -786,31 +468,10 @@ public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, S @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)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, privateEndpointConnectionName, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -818,9 +479,8 @@ private Mono>> deleteWithResponseAsync(String resource * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -829,41 +489,17 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String environmentName, String privateEndpointConnectionName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, privateEndpointConnectionName, this.client.getApiVersion(), accept, Context.NONE); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, privateEndpointConnectionName, + Context.NONE); } /** * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -873,41 +509,17 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String environmentName, String privateEndpointConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, privateEndpointConnectionName, + 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. + * @param environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -926,9 +538,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -946,9 +557,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -967,9 +577,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -986,9 +595,8 @@ private Mono deleteAsync(String resourceGroupName, String environmentName, * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1002,9 +610,8 @@ public void delete(String resourceGroupName, String environmentName, String priv * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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. @@ -1016,6 +623,124 @@ public void delete(String resourceGroupName, String environmentName, String priv beginDelete(resourceGroupName, environmentName, privateEndpointConnectionName, context).getFinalResult(); } + /** + * 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 the response of a PrivateEndpointConnection list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String environmentName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PrivateEndpointConnection list operation 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PrivateEndpointConnection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String environmentName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, accept, Context.NONE); + return 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. + * @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 PrivateEndpointConnection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String environmentName, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, accept, context); + return 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 the response of a PrivateEndpointConnection list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, environmentName), + nextLink -> listNextSinglePage(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 the response of a PrivateEndpointConnection list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, environmentName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + /** * List private endpoint connections for a given managed environment. * @@ -1025,18 +750,11 @@ public void delete(String resourceGroupName, String environmentName, String priv * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return the response of a PrivateEndpointConnection 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(), @@ -1053,20 +771,10 @@ private Mono> listNextSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return the response of a PrivateEndpointConnection list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -1084,27 +792,14 @@ private PagedResponse listNextSinglePage(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return the response of a PrivateEndpointConnection list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER - = new ClientLogger(ManagedEnvironmentPrivateEndpointConnectionsClientImpl.class); } 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 index 225993918b6c..e90d5f131e74 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -29,29 +29,12 @@ public ManagedEnvironmentPrivateEndpointConnectionsImpl( 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); } public PrivateEndpointConnection get(String resourceGroupName, String environmentName, @@ -74,6 +57,19 @@ public void delete(String resourceGroupName, String environmentName, String priv this.serviceClient().delete(resourceGroupName, environmentName, privateEndpointConnectionName, context); } + 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 PrivateEndpointConnection 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/ManagedEnvironmentPrivateLinkResourcesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentPrivateLinkResourcesClientImpl.java index 11d9573ec338..ec9ce94df0d3 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -25,10 +25,9 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -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.PrivateLinkResourceListResult; +import com.azure.resourcemanager.appcontainers.implementation.models.PrivateLinkResourceListResult; import reactor.core.publisher.Mono; /** @@ -62,35 +61,57 @@ public final class ManagedEnvironmentPrivateLinkResourcesClientImpl * The interface defining all the services for ContainerAppsApiClientManagedEnvironmentPrivateLinkResources to be * used by the proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientManagedEnvironmentPrivateLinkResources") 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, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateLinkResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateLinkResources/{privateLinkResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, + @PathParam("privateLinkResourceName") String privateLinkResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateLinkResources/{privateLinkResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, + @PathParam("privateLinkResourceName") String privateLinkResourceName, @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, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -98,7 +119,7 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -106,36 +127,20 @@ Response listNextSync( * 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 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}. + * @return list of private link resources 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)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, 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())); @@ -145,11 +150,11 @@ private Mono> listSinglePageAsync(String * 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 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}. + * @return list of private link resources for a managed environment as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String environmentName) { @@ -161,36 +166,18 @@ private PagedFlux listAsync(String resourceGroupName, * 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 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}. + * @return list of private link resources for a managed environment along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String environmentName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, Context.NONE); + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -199,38 +186,20 @@ private PagedResponse listSinglePage(String resourceGr * 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 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}. + * @return list of private link resources for a managed environment along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String environmentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, context); + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -239,11 +208,12 @@ private PagedResponse listSinglePage(String resourceGr * 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 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}. + * @return list of private link resources for a managed environment as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String environmentName) { @@ -255,12 +225,13 @@ public PagedIterable list(String resourceGroupName, St * 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 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}. + * @return list of private link resources for a managed environment as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String environmentName, @@ -269,6 +240,101 @@ public PagedIterable list(String resourceGroupName, St nextLink -> listNextSinglePage(nextLink, context)); } + /** + * Get a private link resource for a given managed environment. + * + * Gets the details of a private link resource supported by a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the managed environment. + * @param privateLinkResourceName The name of the private link 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 link resource for a given managed environment. + * + * Gets the details of a private link resource supported by a managed environment along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String environmentName, String privateLinkResourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, privateLinkResourceName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a private link resource for a given managed environment. + * + * Gets the details of a private link resource supported by a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the managed environment. + * @param privateLinkResourceName The name of the private link 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 link resource for a given managed environment. + * + * Gets the details of a private link resource supported by a managed environment on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String environmentName, + String privateLinkResourceName) { + return getWithResponseAsync(resourceGroupName, environmentName, privateLinkResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a private link resource for a given managed environment. + * + * Gets the details of a private link resource supported by a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the managed environment. + * @param privateLinkResourceName The name of the private link 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 link resource for a given managed environment. + * + * Gets the details of a private link resource supported by a managed environment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String environmentName, + String privateLinkResourceName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, privateLinkResourceName, accept, context); + } + + /** + * Get a private link resource for a given managed environment. + * + * Gets the details of a private link resource supported by a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the managed environment. + * @param privateLinkResourceName The name of the private link 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 link resource for a given managed environment. + * + * Gets the details of a private link resource supported by a managed environment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner get(String resourceGroupName, String environmentName, + String privateLinkResourceName) { + return getWithResponse(resourceGroupName, environmentName, privateLinkResourceName, Context.NONE).getValue(); + } + /** * List private link resources for a given managed environment. * @@ -278,18 +344,11 @@ public PagedIterable list(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return list of private link resources for a managed environment 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(), @@ -306,19 +365,10 @@ private Mono> listNextSinglePageAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return list of private link resources for a managed environment along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -336,25 +386,14 @@ private PagedResponse listNextSinglePage(String nextLi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @return list of private link resources for a managed environment along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(ManagedEnvironmentPrivateLinkResourcesClientImpl.class); } 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 index 34a753a0e7d7..aff10c1dee92 100644 --- 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 @@ -1,10 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.ManagedEnvironmentPrivateLinkResourcesClient; @@ -36,6 +38,24 @@ public PagedIterable list(String resourceGroupName, String return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); } + public Response getWithResponse(String resourceGroupName, String environmentName, + String privateLinkResourceName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, environmentName, privateLinkResourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + } + + public PrivateLinkResource get(String resourceGroupName, String environmentName, String privateLinkResourceName) { + PrivateLinkResourceInner inner + = this.serviceClient().get(resourceGroupName, environmentName, privateLinkResourceName); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + private ManagedEnvironmentPrivateLinkResourcesClient serviceClient() { return this.innerClient; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentStorageImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentStorageImpl.java index 79142fceb10b..98146714b073 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentStorageImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentStorageImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentStoragesCollectionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentStoragesCollectionImpl.java index b277fae73421..556a375dd845 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentStoragesCollectionImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentStoragesCollectionImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentUsagesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentUsagesClientImpl.java index 21bf24cef820..5fbae2c639bd 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentUsagesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentUsagesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -24,11 +24,10 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentUsagesClient; import com.azure.resourcemanager.appcontainers.fluent.models.UsageInner; +import com.azure.resourcemanager.appcontainers.implementation.models.ListUsagesResult; import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.appcontainers.models.ListUsagesResult; import reactor.core.publisher.Mono; /** @@ -60,42 +59,42 @@ public final class ManagedEnvironmentUsagesClientImpl implements ManagedEnvironm * The interface defining all the services for ContainerAppsApiClientManagedEnvironmentUsages to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientManagedEnvironmentUsages") public interface ManagedEnvironmentUsagesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/usages") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/usages") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @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); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -111,26 +110,10 @@ Response listNextSync(@PathParam(value = "nextLink", encoded = */ @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)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, 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())); @@ -165,27 +148,9 @@ private PagedFlux listAsync(String resourceGroupName, String environ */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String environmentName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, this.client.getApiVersion(), accept, Context.NONE); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -204,27 +169,9 @@ private PagedResponse listSinglePage(String resourceGroupName, Strin @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String environmentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, this.client.getApiVersion(), accept, context); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -276,13 +223,6 @@ public PagedIterable list(String resourceGroupName, String environme */ @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(), @@ -301,15 +241,6 @@ private Mono> listNextSinglePageAsync(String nextLink) */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -329,20 +260,9 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(ManagedEnvironmentUsagesClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentUsagesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentUsagesImpl.java index d50d07f8e2b2..63b826cc5847 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentUsagesImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentUsagesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsClientImpl.java index 818800e7d547..02eedb766dda 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -27,20 +27,22 @@ 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.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.CheckMigrationEligibilityResponseInner; import com.azure.resourcemanager.appcontainers.fluent.models.EnvironmentAuthTokenInner; import com.azure.resourcemanager.appcontainers.fluent.models.ManagedEnvironmentInner; import com.azure.resourcemanager.appcontainers.fluent.models.WorkloadProfileStatesInner; +import com.azure.resourcemanager.appcontainers.implementation.models.ManagedEnvironmentsCollection; +import com.azure.resourcemanager.appcontainers.implementation.models.WorkloadProfileStatesCollection; +import com.azure.resourcemanager.appcontainers.models.CheckMigrationEligibilityRequest; import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentsCollection; -import com.azure.resourcemanager.appcontainers.models.WorkloadProfileStatesCollection; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -74,884 +76,719 @@ public final class ManagedEnvironmentsClientImpl implements ManagedEnvironmentsC * The interface defining all the services for ContainerAppsApiClientManagedEnvironments to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientManagedEnvironments") public interface ManagedEnvironmentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/managedEnvironments") - @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}/providers/Microsoft.App/managedEnvironments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listSync(@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/managedEnvironments") - @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/managedEnvironments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listByResourceGroupSync(@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/managedEnvironments/{environmentName}") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getByResourceGroupSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}") @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ManagedEnvironmentInner environmentEnvelope, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedEnvironmentInner environmentEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}") @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ManagedEnvironmentInner environmentEnvelope, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedEnvironmentInner environmentEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedEnvironmentInner environmentEnvelope, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedEnvironmentInner environmentEnvelope, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}") @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}") @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ManagedEnvironmentInner environmentEnvelope, + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") 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/managedEnvironments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") 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}/providers/Microsoft.App/managedEnvironments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response updateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ManagedEnvironmentInner environmentEnvelope, + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/managedEnvironments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/getAuthtoken") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getAuthToken(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAuthToken(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/getAuthtoken") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getAuthTokenSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Response getAuthTokenSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/workloadProfileStates") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> listWorkloadProfileStates(@HostParam("$host") String endpoint, + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listWorkloadProfileStates( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/workloadProfileStates") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listWorkloadProfileStatesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/checkMigrationEligibility") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listWorkloadProfileStatesSync(@HostParam("$host") String endpoint, + Mono> checkMigrationEligibility( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CheckMigrationEligibilityRequest body, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/checkMigrationEligibility") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response checkMigrationEligibilitySync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CheckMigrationEligibilityRequest body, 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, + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listBySubscriptionNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") 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, + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listByResourceGroupNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + @UnexpectedResponseExceptionType(ManagementException.class) Mono> listWorkloadProfileStatesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + @UnexpectedResponseExceptionType(ManagementException.class) Response listWorkloadProfileStatesNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Get all Environments for a subscription. + * Get the properties of a Managed Environment. * - * Get all Managed Environments for a subscription. + * Get the properties of a Managed Environment used to host container apps. * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the 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 all Managed Environments for a subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the properties of a Managed Environment. + * + * Get the properties of a Managed Environment used to host container apps along with {@link Response} 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.")); - } + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String environmentName) { 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)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get all Environments for a subscription. + * Get the properties of a Managed Environment. * - * Get all Managed Environments for a subscription. + * Get the properties of a Managed Environment used to host container apps. * - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the 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 all Managed Environments for a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Get all Environments for a subscription. - * - * Get all Managed Environments for a subscription. + * @return the properties of a Managed Environment. * - * @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 all Managed Environments for a subscription along with {@link PagedResponse}. + * Get the properties of a Managed Environment used to host container apps on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage() { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + private Mono getByResourceGroupAsync(String resourceGroupName, String environmentName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, environmentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get all Environments for a subscription. + * Get the properties of a Managed Environment. * - * Get all Managed Environments for a subscription. + * Get the properties of a Managed Environment used to host container apps. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the 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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Managed Environments for a subscription along with {@link PagedResponse}. + * @return the properties of a Managed Environment. + * + * Get the properties of a Managed Environment used to host container apps along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + public Response getByResourceGroupWithResponse(String resourceGroupName, + String environmentName, Context context) { final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get all Environments for a subscription. - * - * Get all Managed Environments for a 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 all Managed Environments for a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, accept, context); } /** - * Get all Environments for a subscription. + * Get the properties of a Managed Environment. * - * Get all Managed Environments for a subscription. + * Get the properties of a Managed Environment used to host container apps. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Managed Environments for a subscription as paginated response with {@link PagedIterable}. + * @return the properties of a Managed Environment. + * + * Get the properties of a Managed Environment used to host container apps. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(() -> listSinglePage(context), - nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedEnvironmentInner getByResourceGroup(String resourceGroupName, String environmentName) { + return getByResourceGroupWithResponse(resourceGroupName, environmentName, Context.NONE).getValue(); } /** - * Get all the Environments in a resource group. + * Creates or updates a Managed Environment. * - * Get all the Managed Environments in a resource group. + * Creates or updates a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Environment. + * @param environmentEnvelope Configuration details of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Managed Environments in a resource group along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return an environment for hosting container apps along with {@link Response} 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.")); - } + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String environmentName, ManagedEnvironmentInner environmentEnvelope) { + final String contentType = "application/json"; 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)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, contentType, accept, + environmentEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get all the Environments in a resource group. - * - * Get all the Managed Environments in a resource group. - * - * @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 all the Managed Environments in a resource group as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Get all the Environments in a resource group. + * Creates or updates a Managed Environment. * - * Get all the Managed Environments in a resource group. + * Creates or updates a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Environment. + * @param environmentEnvelope Configuration details of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Managed Environments in a resource group along with {@link PagedResponse}. + * @return an environment for hosting container apps along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, + ManagedEnvironmentInner environmentEnvelope) { + final String contentType = "application/json"; final String accept = "application/json"; - Response res = service.listByResourceGroupSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, contentType, accept, + environmentEnvelope, Context.NONE); } /** - * Get all the Environments in a resource group. + * Creates or updates a Managed Environment. * - * Get all the Managed Environments in a resource group. + * Creates or updates a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Environment. + * @param environmentEnvelope Configuration details of the 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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Managed Environments in a resource group along with {@link PagedResponse}. + * @return an environment for hosting container apps along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, + ManagedEnvironmentInner environmentEnvelope, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - Response res = service.listByResourceGroupSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, contentType, accept, + environmentEnvelope, context); } /** - * Get all the Environments in a resource group. + * Creates or updates a Managed Environment. * - * Get all the Managed Environments in a resource group. + * Creates or updates a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Environment. + * @param environmentEnvelope Configuration details of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Managed Environments in a resource group as paginated response with {@link PagedIterable}. + * @return the {@link PollerFlux} for polling of an environment for hosting container apps. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePage(nextLink)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedEnvironmentInner> beginCreateOrUpdateAsync( + String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, environmentName, environmentEnvelope); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ManagedEnvironmentInner.class, ManagedEnvironmentInner.class, + this.client.getContext()); } /** - * Get all the Environments in a resource group. + * Creates or updates a Managed Environment. * - * Get all the Managed Environments in a resource group. + * Creates or updates a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. + * @param environmentName Name of the Environment. + * @param environmentEnvelope Configuration details of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Managed Environments in a resource group as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of an environment for hosting container apps. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedEnvironmentInner> beginCreateOrUpdate( + String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope) { + Response response + = createOrUpdateWithResponse(resourceGroupName, environmentName, environmentEnvelope); + return this.client.getLroResult(response, + ManagedEnvironmentInner.class, ManagedEnvironmentInner.class, Context.NONE); } /** - * Get the properties of a Managed Environment. + * Creates or updates a Managed Environment. * - * Get the properties of a Managed Environment used to host container apps. + * Creates or updates a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. + * @param environmentEnvelope Configuration details of the 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 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 properties of a Managed Environment used to host container apps along with {@link Response} on - * successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of an environment for hosting container apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(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.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedEnvironmentInner> beginCreateOrUpdate( + String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope, + Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, environmentName, environmentEnvelope, context); + return this.client.getLroResult(response, + ManagedEnvironmentInner.class, ManagedEnvironmentInner.class, context); } /** - * Get the properties of a Managed Environment. + * Creates or updates a Managed Environment. * - * Get the properties of a Managed Environment used to host container apps. + * Creates or updates a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. + * @param environmentEnvelope Configuration details of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 properties of a Managed Environment used to host container apps on successful completion of - * {@link Mono}. + * @return an environment for hosting container apps on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String environmentName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, environmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono createOrUpdateAsync(String resourceGroupName, String environmentName, + ManagedEnvironmentInner environmentEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, environmentName, environmentEnvelope).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Get the properties of a Managed Environment. + * Creates or updates a Managed Environment. * - * Get the properties of a Managed Environment used to host container apps. + * Creates or updates a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. - * @param context The context to associate with this operation. + * @param environmentEnvelope Configuration details of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 properties of a Managed Environment used to host container apps along with {@link Response}. + * @return an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String environmentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, this.client.getApiVersion(), accept, context); + public ManagedEnvironmentInner createOrUpdate(String resourceGroupName, String environmentName, + ManagedEnvironmentInner environmentEnvelope) { + return beginCreateOrUpdate(resourceGroupName, environmentName, environmentEnvelope).getFinalResult(); } /** - * Get the properties of a Managed Environment. + * Creates or updates a Managed Environment. * - * Get the properties of a Managed Environment used to host container apps. + * Creates or updates a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. + * @param environmentEnvelope Configuration details of the 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 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 properties of a Managed Environment used to host container apps. + * @return an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedEnvironmentInner getByResourceGroup(String resourceGroupName, String environmentName) { - return getByResourceGroupWithResponse(resourceGroupName, environmentName, Context.NONE).getValue(); + public ManagedEnvironmentInner createOrUpdate(String resourceGroupName, String environmentName, + ManagedEnvironmentInner environmentEnvelope, Context context) { + return beginCreateOrUpdate(resourceGroupName, environmentName, environmentEnvelope, context).getFinalResult(); } /** - * Creates or updates a Managed Environment. + * Update Managed Environment's properties. * - * Creates or updates a Managed Environment used to host container apps. + * Patches a Managed Environment using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. * @param environmentEnvelope Configuration details of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an environment for hosting container apps along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String environmentName, ManagedEnvironmentInner environmentEnvelope) { - 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 (environmentEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentEnvelope is required and cannot be null.")); - } else { - environmentEnvelope.validate(); - } + private Mono>> updateWithResponseAsync(String resourceGroupName, String environmentName, + ManagedEnvironmentInner environmentEnvelope) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, this.client.getApiVersion(), environmentEnvelope, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, contentType, accept, + environmentEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates a Managed Environment. + * Update Managed Environment's properties. * - * Creates or updates a Managed Environment used to host container apps. + * Patches a Managed Environment using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. * @param environmentEnvelope Configuration details of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an environment for hosting container apps along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, + private Response updateWithResponse(String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (environmentEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentEnvelope is required and cannot be null.")); - } else { - environmentEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), environmentEnvelope, accept, Context.NONE); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, contentType, accept, + environmentEnvelope, Context.NONE); } /** - * Creates or updates a Managed Environment. + * Update Managed Environment's properties. * - * Creates or updates a Managed Environment used to host container apps. + * Patches a Managed Environment using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. * @param environmentEnvelope Configuration details of the 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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an environment for hosting container apps along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, + private Response updateWithResponse(String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (environmentEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentEnvelope is required and cannot be null.")); - } else { - environmentEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), environmentEnvelope, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, contentType, accept, + environmentEnvelope, context); } /** - * Creates or updates a Managed Environment. + * Update Managed Environment's properties. * - * Creates or updates a Managed Environment used to host container apps. + * Patches a Managed Environment using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. * @param environmentEnvelope Configuration details of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ManagedEnvironmentInner> beginCreateOrUpdateAsync( + private PollerFlux, ManagedEnvironmentInner> beginUpdateAsync( String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, environmentName, environmentEnvelope); + = updateWithResponseAsync(resourceGroupName, environmentName, environmentEnvelope); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ManagedEnvironmentInner.class, ManagedEnvironmentInner.class, this.client.getContext()); } /** - * Creates or updates a Managed Environment. + * Update Managed Environment's properties. * - * Creates or updates a Managed Environment used to host container apps. + * Patches a Managed Environment using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. * @param environmentEnvelope Configuration details of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ManagedEnvironmentInner> beginCreateOrUpdate( - String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope) { - Response response - = createOrUpdateWithResponse(resourceGroupName, environmentName, environmentEnvelope); + public SyncPoller, ManagedEnvironmentInner> + beginUpdate(String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope) { + Response response = updateWithResponse(resourceGroupName, environmentName, environmentEnvelope); return this.client.getLroResult(response, ManagedEnvironmentInner.class, ManagedEnvironmentInner.class, Context.NONE); } /** - * Creates or updates a Managed Environment. + * Update Managed Environment's properties. * - * Creates or updates a Managed Environment used to host container apps. + * Patches a Managed Environment using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. * @param environmentEnvelope Configuration details of the 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 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 an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ManagedEnvironmentInner> beginCreateOrUpdate( + public SyncPoller, ManagedEnvironmentInner> beginUpdate( String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope, Context context) { Response response - = createOrUpdateWithResponse(resourceGroupName, environmentName, environmentEnvelope, context); + = updateWithResponse(resourceGroupName, environmentName, environmentEnvelope, context); return this.client.getLroResult(response, ManagedEnvironmentInner.class, ManagedEnvironmentInner.class, context); } /** - * Creates or updates a Managed Environment. + * Update Managed Environment's properties. * - * Creates or updates a Managed Environment used to host container apps. + * Patches a Managed Environment using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. * @param environmentEnvelope Configuration details of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an environment for hosting container apps on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String environmentName, + private Mono updateAsync(String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope) { - return beginCreateOrUpdateAsync(resourceGroupName, environmentName, environmentEnvelope).last() + return beginUpdateAsync(resourceGroupName, environmentName, environmentEnvelope).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates or updates a Managed Environment. + * Update Managed Environment's properties. * - * Creates or updates a Managed Environment used to host container apps. + * Patches a Managed Environment using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. * @param environmentEnvelope Configuration details of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedEnvironmentInner createOrUpdate(String resourceGroupName, String environmentName, + public ManagedEnvironmentInner update(String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope) { - return beginCreateOrUpdate(resourceGroupName, environmentName, environmentEnvelope).getFinalResult(); + return beginUpdate(resourceGroupName, environmentName, environmentEnvelope).getFinalResult(); } /** - * Creates or updates a Managed Environment. + * Update Managed Environment's properties. * - * Creates or updates a Managed Environment used to host container apps. + * Patches a Managed Environment using JSON Merge Patch. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. * @param environmentEnvelope Configuration details of the 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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedEnvironmentInner createOrUpdate(String resourceGroupName, String environmentName, + public ManagedEnvironmentInner update(String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope, Context context) { - return beginCreateOrUpdate(resourceGroupName, environmentName, environmentEnvelope, context).getFinalResult(); + return beginUpdate(resourceGroupName, environmentName, environmentEnvelope, context).getFinalResult(); } /** @@ -962,32 +799,15 @@ public ManagedEnvironmentInner createOrUpdate(String resourceGroupName, String e * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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) { - 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.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -999,33 +819,14 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String environmentName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, Context.NONE); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, Context.NONE); } /** @@ -1037,33 +838,14 @@ private Response deleteWithResponse(String resourceGroupName, String * @param environmentName Name of the 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 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 body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String environmentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, context); } /** @@ -1074,7 +856,7 @@ private Response deleteWithResponse(String resourceGroupName, String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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. */ @@ -1093,7 +875,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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. */ @@ -1112,7 +894,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @param environmentName Name of the 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 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. */ @@ -1131,7 +913,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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. */ @@ -1149,7 +931,7 @@ private Mono deleteAsync(String resourceGroupName, String environmentName) * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @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) @@ -1166,7 +948,7 @@ public void delete(String resourceGroupName, String environmentName) { * @param environmentName Name of the 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 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) @@ -1175,267 +957,249 @@ public void delete(String resourceGroupName, String environmentName, Context con } /** - * Update Managed Environment's properties. + * Get all the Environments in a resource group. * - * Patches a Managed Environment using JSON Merge Patch. + * Get all the Managed Environments in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param environmentEnvelope Configuration details of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an environment for hosting container apps along with {@link Response} on successful completion of + * @return all the Environments in a resource group. + * + * Get all the Managed Environments in a resource group along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String environmentName, - ManagedEnvironmentInner environmentEnvelope) { - 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 (environmentEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter environmentEnvelope is required and cannot be null.")); - } else { - environmentEnvelope.validate(); - } + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, this.client.getApiVersion(), environmentEnvelope, accept, context)) + .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())); } /** - * Update Managed Environment's properties. + * Get all the Environments in a resource group. * - * Patches a Managed Environment using JSON Merge Patch. + * Get all the Managed Environments in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param environmentEnvelope Configuration details of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an environment for hosting container apps along with {@link Response}. + * @return all the Environments in a resource group. + * + * Get all the Managed Environments in a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Get all the Environments in a resource group. + * + * Get all the Managed Environments in a 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 all the Environments in a resource group. + * + * Get all the Managed Environments in a resource group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String environmentName, - ManagedEnvironmentInner environmentEnvelope) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (environmentEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentEnvelope is required and cannot be null.")); - } else { - environmentEnvelope.validate(); - } + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), environmentEnvelope, accept, Context.NONE); + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Update Managed Environment's properties. + * Get all the Environments in a resource group. * - * Patches a Managed Environment using JSON Merge Patch. + * Get all the Managed Environments in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param environmentEnvelope Configuration details of the 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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an environment for hosting container apps along with {@link Response}. + * @return all the Environments in a resource group. + * + * Get all the Managed Environments in a resource group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String environmentName, - ManagedEnvironmentInner environmentEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (environmentEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentEnvelope is required and cannot be null.")); - } else { - environmentEnvelope.validate(); - } + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + Context context) { final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), environmentEnvelope, accept, context); + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Update Managed Environment's properties. + * Get all the Environments in a resource group. * - * Patches a Managed Environment using JSON Merge Patch. + * Get all the Managed Environments in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param environmentEnvelope Configuration details of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 an environment for hosting container apps. + * @return all the Environments in a resource group. + * + * Get all the Managed Environments in a resource group as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ManagedEnvironmentInner> beginUpdateAsync( - String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, environmentName, environmentEnvelope); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ManagedEnvironmentInner.class, ManagedEnvironmentInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * Get all the Environments in a resource group. + * + * Get all the Managed Environments in a 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 all the Environments in a resource group. + * + * Get all the Managed Environments in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * Get all Environments for a subscription. + * + * Get all Managed Environments for a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Environments for a subscription. + * + * Get all Managed Environments for a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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())); } /** - * Update Managed Environment's properties. + * Get all Environments for a subscription. * - * Patches a Managed Environment using JSON Merge Patch. + * Get all Managed Environments for a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param environmentEnvelope Configuration details of the Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 an environment for hosting container apps. + * @return all Environments for a subscription. + * + * Get all Managed Environments for a subscription as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ManagedEnvironmentInner> - beginUpdate(String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope) { - Response response = updateWithResponse(resourceGroupName, environmentName, environmentEnvelope); - return this.client.getLroResult(response, - ManagedEnvironmentInner.class, ManagedEnvironmentInner.class, Context.NONE); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * Update Managed Environment's properties. + * Get all Environments for a subscription. * - * Patches a Managed Environment using JSON Merge Patch. + * Get all Managed Environments for a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param environmentEnvelope Configuration details of the 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 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 an environment for hosting container apps. + * @return all Environments for a subscription. + * + * Get all Managed Environments for a subscription along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ManagedEnvironmentInner> beginUpdate( - String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope, - Context context) { - Response response - = updateWithResponse(resourceGroupName, environmentName, environmentEnvelope, context); - return this.client.getLroResult(response, - ManagedEnvironmentInner.class, ManagedEnvironmentInner.class, context); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Update Managed Environment's properties. + * Get all Environments for a subscription. * - * Patches a Managed Environment using JSON Merge Patch. + * Get all Managed Environments for a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param environmentEnvelope Configuration details of the 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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an environment for hosting container apps on successful completion of {@link Mono}. + * @return all Environments for a subscription. + * + * Get all Managed Environments for a subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String environmentName, - ManagedEnvironmentInner environmentEnvelope) { - return beginUpdateAsync(resourceGroupName, environmentName, environmentEnvelope).last() - .flatMap(this.client::getLroFinalResultOrError); + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Update Managed Environment's properties. + * Get all Environments for a subscription. * - * Patches a Managed Environment using JSON Merge Patch. + * Get all Managed Environments for a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param environmentEnvelope Configuration details of the Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an environment for hosting container apps. + * @return all Environments for a subscription. + * + * Get all Managed Environments for a subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedEnvironmentInner update(String resourceGroupName, String environmentName, - ManagedEnvironmentInner environmentEnvelope) { - return beginUpdate(resourceGroupName, environmentName, environmentEnvelope).getFinalResult(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); } /** - * Update Managed Environment's properties. + * Get all Environments for a subscription. * - * Patches a Managed Environment using JSON Merge Patch. + * Get all Managed Environments for a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param environmentEnvelope Configuration details of the 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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an environment for hosting container apps. + * @return all Environments for a subscription. + * + * Get all Managed Environments for a subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedEnvironmentInner update(String resourceGroupName, String environmentName, - ManagedEnvironmentInner environmentEnvelope, Context context) { - return beginUpdate(resourceGroupName, environmentName, environmentEnvelope, context).getFinalResult(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); } /** @@ -1444,35 +1208,21 @@ public ManagedEnvironmentInner update(String resourceGroupName, String environme * Checks if resource name is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return environment Auth Token along with {@link Response} on successful completion of {@link Mono}. + * @return auth token for a managed environment + * + * Checks if resource name is available along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getAuthTokenWithResponseAsync(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.getAuthToken(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getAuthToken(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1482,11 +1232,13 @@ private Mono> getAuthTokenWithResponseAsync( * Checks if resource name is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return environment Auth Token on successful completion of {@link Mono}. + * @return auth token for a managed environment + * + * Checks if resource name is available on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAuthTokenAsync(String resourceGroupName, String environmentName) { @@ -1500,37 +1252,21 @@ private Mono getAuthTokenAsync(String resourceGroupNa * Checks if resource name is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the 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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return environment Auth Token along with {@link Response}. + * @return auth token for a managed environment + * + * Checks if resource name is available along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAuthTokenWithResponse(String resourceGroupName, String environmentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getAuthTokenSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, context); + return service.getAuthTokenSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, accept, context); } /** @@ -1539,11 +1275,13 @@ public Response getAuthTokenWithResponse(String resou * Checks if resource name is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return environment Auth Token. + * @return auth token for a managed environment + * + * Checks if resource name is available. */ @ServiceMethod(returns = ReturnType.SINGLE) public EnvironmentAuthTokenInner getAuthToken(String resourceGroupName, String environmentName) { @@ -1556,37 +1294,23 @@ public EnvironmentAuthTokenInner getAuthToken(String resourceGroupName, String e * Get all workload Profile States 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 environmentName Name of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all workload Profile States for a Managed Environment along with {@link PagedResponse} on successful + * @return all workload Profile States for a Managed Environment.. + * + * Get all workload Profile States for a Managed Environment along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWorkloadProfileStatesSinglePageAsync(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.listWorkloadProfileStates(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), environmentName, accept, context)) + context -> service.listWorkloadProfileStates(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, 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())); @@ -1598,11 +1322,13 @@ public EnvironmentAuthTokenInner getAuthToken(String resourceGroupName, String e * Get all workload Profile States 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 environmentName Name of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all workload Profile States for a Managed Environment as paginated response with {@link PagedFlux}. + * @return all workload Profile States for a Managed Environment.. + * + * Get all workload Profile States for a Managed Environment as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listWorkloadProfileStatesAsync(String resourceGroupName, @@ -1617,37 +1343,21 @@ private PagedFlux listWorkloadProfileStatesAsync(Str * Get all workload Profile States 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 environmentName Name of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all workload Profile States for a Managed Environment along with {@link PagedResponse}. + * @return all workload Profile States for a Managed Environment.. + * + * Get all workload Profile States for a Managed Environment along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listWorkloadProfileStatesSinglePage(String resourceGroupName, String environmentName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listWorkloadProfileStatesSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), environmentName, accept, Context.NONE); + = service.listWorkloadProfileStatesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -1658,38 +1368,22 @@ private PagedResponse listWorkloadProfileStatesSingl * Get all workload Profile States 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 environmentName Name of the 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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all workload Profile States for a Managed Environment along with {@link PagedResponse}. + * @return all workload Profile States for a Managed Environment.. + * + * Get all workload Profile States for a Managed Environment along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listWorkloadProfileStatesSinglePage(String resourceGroupName, String environmentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listWorkloadProfileStatesSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), environmentName, accept, context); + = service.listWorkloadProfileStatesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -1700,11 +1394,13 @@ private PagedResponse listWorkloadProfileStatesSingl * Get all workload Profile States 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 environmentName Name of the Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all workload Profile States for a Managed Environment as paginated response with {@link PagedIterable}. + * @return all workload Profile States for a Managed Environment.. + * + * Get all workload Profile States for a Managed Environment as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listWorkloadProfileStates(String resourceGroupName, @@ -1719,12 +1415,14 @@ public PagedIterable listWorkloadProfileStates(Strin * Get all workload Profile States 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 environmentName Name of the 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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all workload Profile States for a Managed Environment as paginated response with {@link PagedIterable}. + * @return all workload Profile States for a Managed Environment.. + * + * Get all workload Profile States for a Managed Environment as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listWorkloadProfileStates(String resourceGroupName, @@ -1735,179 +1433,222 @@ public PagedIterable listWorkloadProfileStates(Strin } /** - * Get all Environments for a subscription. + * Checks whether a Managed Environment can be migrated to a target mode. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Environment. + * @param body The migration eligibility check request. + * @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 result of a read-only managed environment migration eligibility check along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkMigrationEligibilityWithResponseAsync( + String resourceGroupName, String environmentName, CheckMigrationEligibilityRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.checkMigrationEligibility(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, environmentName, + contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks whether a Managed Environment can be migrated to a target mode. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Environment. + * @param body The migration eligibility check request. + * @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 result of a read-only managed environment migration eligibility check on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkMigrationEligibilityAsync(String resourceGroupName, + String environmentName, CheckMigrationEligibilityRequest body) { + return checkMigrationEligibilityWithResponseAsync(resourceGroupName, environmentName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Checks whether a Managed Environment can be migrated to a target mode. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Environment. + * @param body The migration eligibility check request. + * @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 result of a read-only managed environment migration eligibility check along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkMigrationEligibilityWithResponse( + String resourceGroupName, String environmentName, CheckMigrationEligibilityRequest body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.checkMigrationEligibilitySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, contentType, accept, body, context); + } + + /** + * Checks whether a Managed Environment can be migrated to a target mode. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Environment. + * @param body The migration eligibility check request. + * @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 result of a read-only managed environment migration eligibility check. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckMigrationEligibilityResponseInner checkMigrationEligibility(String resourceGroupName, + String environmentName, CheckMigrationEligibilityRequest body) { + return checkMigrationEligibilityWithResponse(resourceGroupName, environmentName, body, Context.NONE).getValue(); + } + + /** + * Get all the Environments in a resource group. * * 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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Managed Environments for a subscription along with {@link PagedResponse} on successful completion of + * @return all the Environments in a resource group. + * + * Get all the Managed Environments in a resource group 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.")); - } + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + 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 all Environments for a subscription. + * Get all the Environments in a resource group. * * 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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Managed Environments for a subscription along with {@link PagedResponse}. + * @return all the Environments in a resource group. + * + * Get all the Managed Environments in a resource group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { final String accept = "application/json"; Response res - = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } /** - * Get all Environments for a subscription. + * Get all the Environments in a resource group. * * 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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all Managed Environments for a subscription along with {@link PagedResponse}. + * @return all the Environments in a resource group. + * + * Get all the Managed Environments in a resource group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; Response res - = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } /** - * Get all the Environments in a resource group. + * Get all Environments for a subscription. * * 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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Managed Environments in a resource group along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return all Environments for a subscription. + * + * Get all Managed Environments for a subscription 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.")); - } + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + 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 all the Environments in a resource group. + * Get all Environments for a subscription. * * 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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Managed Environments in a resource group along with {@link PagedResponse}. + * @return all Environments for a subscription. + * + * Get all Managed Environments for a subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { final String accept = "application/json"; Response res - = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } /** - * Get all the Environments in a resource group. + * Get all Environments for a subscription. * * 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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the Managed Environments in a resource group along with {@link PagedResponse}. + * @return all Environments for a subscription. + * + * Get all Managed Environments for a subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; Response res - = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -1919,21 +1660,16 @@ private PagedResponse listByResourceGroupNextSinglePage * * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all workload Profile States for a Managed Environment along with {@link PagedResponse} on successful + * @return all workload Profile States for a Managed Environment.. + * + * Get all workload Profile States for a Managed Environment along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWorkloadProfileStatesNextSinglePageAsync(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( @@ -1950,21 +1686,14 @@ private PagedResponse listByResourceGroupNextSinglePage * * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all workload Profile States for a Managed Environment along with {@link PagedResponse}. + * @return all workload Profile States for a Managed Environment.. + * + * Get all workload Profile States for a Managed Environment along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listWorkloadProfileStatesNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listWorkloadProfileStatesNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -1980,28 +1709,19 @@ private PagedResponse listWorkloadProfileStatesNextS * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all workload Profile States for a Managed Environment along with {@link PagedResponse}. + * @return all workload Profile States for a Managed Environment.. + * + * Get all workload Profile States for a Managed Environment along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listWorkloadProfileStatesNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listWorkloadProfileStatesNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(ManagedEnvironmentsClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsDiagnosticsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsDiagnosticsClientImpl.java index 824f68a7f568..c9e4a1ed9fbc 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsDiagnosticsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsDiagnosticsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -20,7 +20,6 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentsDiagnosticsClient; import com.azure.resourcemanager.appcontainers.fluent.models.ManagedEnvironmentInner; import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; @@ -55,28 +54,28 @@ public final class ManagedEnvironmentsDiagnosticsClientImpl implements ManagedEn * The interface defining all the services for ContainerAppsApiClientManagedEnvironmentsDiagnostics to be used by * the proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientManagedEnvironmentsDiagnostics") public interface ManagedEnvironmentsDiagnosticsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectorProperties/rootApi/") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getRoot(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getRoot(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectorProperties/rootApi/") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getRootSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getRootSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); } /** @@ -89,32 +88,18 @@ Response getRootSync(@HostParam("$host") String endpoin * @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 Managed Environment used to host container apps along with {@link Response} on - * successful completion of {@link Mono}. + * @return the properties of a Managed Environment. + * + * Get the properties of a Managed Environment used to host container apps along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getRootWithResponseAsync(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.getRoot(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getRoot(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -128,8 +113,9 @@ private Mono> getRootWithResponseAsync(String * @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 Managed Environment used to host container apps on successful completion of - * {@link Mono}. + * @return the properties of a Managed Environment. + * + * Get the properties of a Managed Environment used to host container apps on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getRootAsync(String resourceGroupName, String environmentName) { @@ -148,32 +134,16 @@ private Mono getRootAsync(String resourceGroupName, Str * @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 Managed Environment used to host container apps along with {@link Response}. + * @return the properties of a Managed Environment. + * + * Get the properties of a Managed Environment used to host container apps along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getRootWithResponse(String resourceGroupName, String environmentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getRootSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, context); + return service.getRootSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, accept, context); } /** @@ -186,12 +156,12 @@ public Response getRootWithResponse(String resourceGrou * @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 Managed Environment used to host container apps. + * @return the properties of a Managed Environment. + * + * Get the properties of a Managed Environment used to host container apps. */ @ServiceMethod(returns = ReturnType.SINGLE) public ManagedEnvironmentInner getRoot(String resourceGroupName, String environmentName) { return getRootWithResponse(resourceGroupName, environmentName, Context.NONE).getValue(); } - - private static final ClientLogger LOGGER = new ClientLogger(ManagedEnvironmentsDiagnosticsClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsDiagnosticsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsDiagnosticsImpl.java index 544062c66a9d..bc4f35f1a139 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsDiagnosticsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsDiagnosticsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -30,12 +30,8 @@ public Response getRootWithResponse(String resourceGroupName Context context) { Response inner = this.serviceClient().getRootWithResponse(resourceGroupName, environmentName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ManagedEnvironmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ManagedEnvironmentImpl(inner.getValue(), this.manager())); } public ManagedEnvironment getRoot(String resourceGroupName, String environmentName) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsImpl.java index c140973da287..35033d9ff3ce 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -10,9 +10,12 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.CheckMigrationEligibilityResponseInner; import com.azure.resourcemanager.appcontainers.fluent.models.EnvironmentAuthTokenInner; import com.azure.resourcemanager.appcontainers.fluent.models.ManagedEnvironmentInner; import com.azure.resourcemanager.appcontainers.fluent.models.WorkloadProfileStatesInner; +import com.azure.resourcemanager.appcontainers.models.CheckMigrationEligibilityRequest; +import com.azure.resourcemanager.appcontainers.models.CheckMigrationEligibilityResponse; import com.azure.resourcemanager.appcontainers.models.EnvironmentAuthToken; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironment; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironments; @@ -31,37 +34,12 @@ public ManagedEnvironmentsImpl(ManagedEnvironmentsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedEnvironmentImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedEnvironmentImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedEnvironmentImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedEnvironmentImpl(inner1, this.manager())); - } - public Response getByResourceGroupWithResponse(String resourceGroupName, String environmentName, Context context) { Response inner = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, environmentName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ManagedEnvironmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ManagedEnvironmentImpl(inner.getValue(), this.manager())); } public ManagedEnvironment getByResourceGroup(String resourceGroupName, String environmentName) { @@ -81,16 +59,33 @@ public void delete(String resourceGroupName, String environmentName, Context con this.serviceClient().delete(resourceGroupName, environmentName, context); } + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedEnvironmentImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedEnvironmentImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedEnvironmentImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedEnvironmentImpl(inner1, this.manager())); + } + public Response getAuthTokenWithResponse(String resourceGroupName, String environmentName, Context context) { Response inner = this.serviceClient().getAuthTokenWithResponse(resourceGroupName, environmentName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new EnvironmentAuthTokenImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EnvironmentAuthTokenImpl(inner.getValue(), this.manager())); } public EnvironmentAuthToken getAuthToken(String resourceGroupName, String environmentName) { @@ -116,6 +111,25 @@ public PagedIterable listWorkloadProfileStates(String res return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadProfileStatesImpl(inner1, this.manager())); } + public Response checkMigrationEligibilityWithResponse(String resourceGroupName, + String environmentName, CheckMigrationEligibilityRequest body, Context context) { + Response inner = this.serviceClient() + .checkMigrationEligibilityWithResponse(resourceGroupName, environmentName, body, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckMigrationEligibilityResponseImpl(inner.getValue(), this.manager())); + } + + public CheckMigrationEligibilityResponse checkMigrationEligibility(String resourceGroupName, String environmentName, + CheckMigrationEligibilityRequest body) { + CheckMigrationEligibilityResponseInner inner + = this.serviceClient().checkMigrationEligibility(resourceGroupName, environmentName, body); + if (inner != null) { + return new CheckMigrationEligibilityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + public ManagedEnvironment 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/ManagedEnvironmentsStoragesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsStoragesClientImpl.java index cdce16883ee5..9d405d16eb54 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsStoragesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsStoragesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -23,7 +23,6 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentsStoragesClient; import com.azure.resourcemanager.appcontainers.fluent.models.ManagedEnvironmentStorageInner; import com.azure.resourcemanager.appcontainers.fluent.models.ManagedEnvironmentStoragesCollectionInner; @@ -59,198 +58,88 @@ public final class ManagedEnvironmentsStoragesClientImpl implements ManagedEnvir * The interface defining all the services for ContainerAppsApiClientManagedEnvironmentsStorages to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientManagedEnvironmentsStorages") public interface ManagedEnvironmentsStoragesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages") - @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}/storages") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listSync(@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}/storages/{storageName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("storageName") String storageName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages/{storageName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("storageName") String storageName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages/{storageName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("storageName") String storageName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ManagedEnvironmentStorageInner storageEnvelope, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedEnvironmentStorageInner storageEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages/{storageName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("storageName") String storageName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ManagedEnvironmentStorageInner storageEnvelope, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedEnvironmentStorageInner storageEnvelope, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages/{storageName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("storageName") String storageName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages/{storageName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response deleteSync(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("environmentName") String environmentName, @PathParam("storageName") String storageName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - } + Context context); - /** - * Get all storages for a managedEnvironment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the 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 all storages for a managedEnvironment along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all storages for a managedEnvironment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the 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 all storages for a managedEnvironment on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String resourceGroupName, - String environmentName) { - return listWithResponseAsync(resourceGroupName, environmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get all storages for a managedEnvironment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the 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 all storages for a managedEnvironment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String resourceGroupName, - String environmentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, this.client.getApiVersion(), accept, context); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); - /** - * Get all storages for a managedEnvironment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the 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 all storages for a managedEnvironment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedEnvironmentStoragesCollectionInner list(String resourceGroupName, String environmentName) { - return listWithResponse(resourceGroupName, environmentName, Context.NONE).getValue(); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, @HeaderParam("Accept") String accept, + Context context); } /** @@ -267,29 +156,10 @@ public ManagedEnvironmentStoragesCollectionInner list(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String environmentName, String storageName) { - 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 (storageName == null) { - return Mono.error(new IllegalArgumentException("Parameter storageName 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, storageName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, storageName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -326,31 +196,9 @@ private Mono getAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String environmentName, String storageName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (storageName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter storageName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, storageName, this.client.getApiVersion(), accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, storageName, accept, context); } /** @@ -385,36 +233,12 @@ public ManagedEnvironmentStorageInner get(String resourceGroupName, String envir @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String environmentName, String storageName, ManagedEnvironmentStorageInner storageEnvelope) { - 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 (storageName == null) { - return Mono.error(new IllegalArgumentException("Parameter storageName is required and cannot be null.")); - } - if (storageEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageEnvelope is required and cannot be null.")); - } else { - storageEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, storageName, this.client.getApiVersion(), storageEnvelope, accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, storageName, contentType, accept, + storageEnvelope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -453,37 +277,11 @@ private Mono createOrUpdateAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, String storageName, ManagedEnvironmentStorageInner storageEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (storageName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter storageName is required and cannot be null.")); - } - if (storageEnvelope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter storageEnvelope is required and cannot be null.")); - } else { - storageEnvelope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, storageName, this.client.getApiVersion(), storageEnvelope, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, storageName, contentType, accept, + storageEnvelope, context); } /** @@ -519,29 +317,9 @@ public ManagedEnvironmentStorageInner createOrUpdate(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String environmentName, String storageName) { - 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 (storageName == null) { - return Mono.error(new IllegalArgumentException("Parameter storageName 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, storageName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, storageName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -577,31 +355,8 @@ private Mono deleteAsync(String resourceGroupName, String environmentName, @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String environmentName, String storageName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (storageName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter storageName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - environmentName, storageName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, storageName, context); } /** @@ -619,5 +374,75 @@ public void delete(String resourceGroupName, String environmentName, String stor deleteWithResponse(resourceGroupName, environmentName, storageName, Context.NONE); } - private static final ClientLogger LOGGER = new ClientLogger(ManagedEnvironmentsStoragesClientImpl.class); + /** + * Get all storages for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the 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 all storages for a managedEnvironment along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, + String environmentName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all storages for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the 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 all storages for a managedEnvironment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, + String environmentName) { + return listWithResponseAsync(resourceGroupName, environmentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get all storages for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the 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 all storages for a managedEnvironment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, + String environmentName, Context context) { + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, environmentName, accept, context); + } + + /** + * Get all storages for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the 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 all storages for a managedEnvironment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedEnvironmentStoragesCollectionInner list(String resourceGroupName, String environmentName) { + return listWithResponse(resourceGroupName, environmentName, Context.NONE).getValue(); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsStoragesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsStoragesImpl.java index 0912a5938a1b..50b3212b4fd4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsStoragesImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsStoragesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -28,37 +28,12 @@ public ManagedEnvironmentsStoragesImpl(ManagedEnvironmentsStoragesClient innerCl this.serviceManager = serviceManager; } - public Response listWithResponse(String resourceGroupName, - String environmentName, Context context) { - Response inner - = this.serviceClient().listWithResponse(resourceGroupName, environmentName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ManagedEnvironmentStoragesCollectionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ManagedEnvironmentStoragesCollection list(String resourceGroupName, String environmentName) { - ManagedEnvironmentStoragesCollectionInner inner = this.serviceClient().list(resourceGroupName, environmentName); - if (inner != null) { - return new ManagedEnvironmentStoragesCollectionImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse(String resourceGroupName, String environmentName, String storageName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, environmentName, storageName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ManagedEnvironmentStorageImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ManagedEnvironmentStorageImpl(inner.getValue(), this.manager())); } public ManagedEnvironmentStorage get(String resourceGroupName, String environmentName, String storageName) { @@ -80,6 +55,23 @@ public void delete(String resourceGroupName, String environmentName, String stor this.serviceClient().delete(resourceGroupName, environmentName, storageName); } + public Response listWithResponse(String resourceGroupName, + String environmentName, Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, environmentName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ManagedEnvironmentStoragesCollectionImpl(inner.getValue(), this.manager())); + } + + public ManagedEnvironmentStoragesCollection list(String resourceGroupName, String environmentName) { + ManagedEnvironmentStoragesCollectionInner inner = this.serviceClient().list(resourceGroupName, environmentName); + if (inner != null) { + return new ManagedEnvironmentStoragesCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + public ManagedEnvironmentStorage 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/NamespacesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/NamespacesClientImpl.java index 9d399e66187e..dcdd126a2428 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/NamespacesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/NamespacesClientImpl.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; import com.azure.core.annotation.BodyParam; 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; @@ -19,13 +18,12 @@ 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.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.NamespacesClient; import com.azure.resourcemanager.appcontainers.fluent.models.CheckNameAvailabilityResponseInner; import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityRequest; -import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; import reactor.core.publisher.Mono; /** @@ -57,30 +55,28 @@ public final class NamespacesClientImpl implements NamespacesClient { * The interface defining all the services for ContainerAppsApiClientNamespaces to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientNamespaces") public interface NamespacesService { - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/checkNameAvailability") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> checkNameAvailability(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CheckNameAvailabilityRequest checkNameAvailabilityRequest, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckNameAvailabilityRequest checkNameAvailabilityRequest, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/checkNameAvailability") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response checkNameAvailabilitySync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @UnexpectedResponseExceptionType(ManagementException.class) + Response checkNameAvailabilitySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("environmentName") String environmentName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CheckNameAvailabilityRequest checkNameAvailabilityRequest, - @HeaderParam("Accept") String accept, Context context); + @PathParam("environmentName") String environmentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckNameAvailabilityRequest checkNameAvailabilityRequest, Context context); } /** @@ -89,43 +85,22 @@ Response checkNameAvailabilitySync(@HostPara * Checks if resource name is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param checkNameAvailabilityRequest The check name availability request. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 check availability result along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( String resourceGroupName, String environmentName, CheckNameAvailabilityRequest checkNameAvailabilityRequest) { - 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 (checkNameAvailabilityRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter checkNameAvailabilityRequest is required and cannot be null.")); - } else { - checkNameAvailabilityRequest.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, environmentName, this.client.getApiVersion(), - checkNameAvailabilityRequest, accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, environmentName, + contentType, accept, checkNameAvailabilityRequest, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -135,10 +110,10 @@ private Mono> checkNameAvailability * Checks if resource name is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param checkNameAvailabilityRequest The check name availability request. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 check availability result on successful completion of {@link Mono}. */ @@ -155,46 +130,22 @@ private Mono checkNameAvailabilityAsync(Stri * Checks if resource name is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param checkNameAvailabilityRequest The check name availability request. * @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 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 check availability result along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response checkNameAvailabilityWithResponse(String resourceGroupName, String environmentName, CheckNameAvailabilityRequest checkNameAvailabilityRequest, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (environmentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); - } - if (checkNameAvailabilityRequest == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter checkNameAvailabilityRequest is required and cannot be null.")); - } else { - checkNameAvailabilityRequest.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.checkNameAvailabilitySync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, environmentName, this.client.getApiVersion(), checkNameAvailabilityRequest, accept, - context); + return service.checkNameAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, environmentName, contentType, accept, + checkNameAvailabilityRequest, context); } /** @@ -203,10 +154,10 @@ public Response checkNameAvailabilityWithRes * Checks if resource name is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param checkNameAvailabilityRequest The check name availability request. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws 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 check availability result. */ @@ -216,6 +167,4 @@ public CheckNameAvailabilityResponseInner checkNameAvailability(String resourceG return checkNameAvailabilityWithResponse(resourceGroupName, environmentName, checkNameAvailabilityRequest, Context.NONE).getValue(); } - - private static final ClientLogger LOGGER = new ClientLogger(NamespacesClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/NamespacesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/NamespacesImpl.java index 46629bb05737..844b13b54427 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/NamespacesImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/NamespacesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -32,12 +32,8 @@ public Response checkNameAvailabilityWithResponse Response inner = this.serviceClient() .checkNameAvailabilityWithResponse(resourceGroupName, environmentName, checkNameAvailabilityRequest, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager())); } public CheckNameAvailabilityResponse checkNameAvailability(String resourceGroupName, String environmentName, diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/OperationDetailImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/OperationDetailImpl.java index cd2fca311b4b..ab145f8e2637 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/OperationDetailImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/OperationDetailImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/OperationsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/OperationsClientImpl.java index 38eb0b8b7479..cdce80b11f79 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/OperationsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/OperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -24,10 +24,9 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.OperationsClient; import com.azure.resourcemanager.appcontainers.fluent.models.OperationDetailInner; -import com.azure.resourcemanager.appcontainers.models.AvailableOperations; +import com.azure.resourcemanager.appcontainers.implementation.models.AvailableOperations; import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; import reactor.core.publisher.Mono; @@ -60,21 +59,21 @@ public final class OperationsClientImpl implements OperationsClient { * The interface defining all the services for ContainerAppsApiClientOperations to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.App/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.App/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listSync(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -82,14 +81,14 @@ Response listSync(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -102,10 +101,6 @@ Response listNextSync(@PathParam(value = "nextLink", encode */ @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.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -136,11 +131,6 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage() { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); @@ -159,11 +149,6 @@ private PagedResponse listSinglePage() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); @@ -209,13 +194,6 @@ public PagedIterable list(Context context) { */ @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(), @@ -234,15 +212,6 @@ private Mono> listNextSinglePageAsync(String */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -262,20 +231,9 @@ private PagedResponse listNextSinglePage(String nextLink) */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(OperationsClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/OperationsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/OperationsImpl.java index 7cbc6577e929..a08d3319d166 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/OperationsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/OperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; 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 index 0f307d007854..50e89e735e4d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; 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 index 29bb3c4ededb..d64cca9438d3 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ReplicaCollectionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ReplicaCollectionImpl.java index e9bba45d900e..34a84f218bd6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ReplicaCollectionImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ReplicaCollectionImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ReplicaImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ReplicaImpl.java index 927df01ea0d9..c81c3c692c57 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ReplicaImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ReplicaImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ResourceManagerUtils.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ResourceManagerUtils.java index 0a2ed7b73eef..71647dbd743d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ResourceManagerUtils.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ResourceProvidersClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ResourceProvidersClientImpl.java index 75e3115ce69a..bdf59ad10129 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ResourceProvidersClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ResourceProvidersClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -21,7 +21,6 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.ResourceProvidersClient; import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionInner; import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; @@ -56,237 +55,176 @@ public final class ResourceProvidersClientImpl implements ResourceProvidersClien * The interface defining all the services for ContainerAppsApiClientResourceProviders to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientResourceProviders") public interface ResourceProvidersService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions/{jobExecutionName}") + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.App/getCustomDomainVerificationId") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> jobExecution(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, - @PathParam("jobExecutionName") String jobExecutionName, @QueryParam("api-version") String apiVersion, + Mono> getCustomDomainVerificationId(@HostParam("endpoint") 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/jobs/{jobName}/executions/{jobExecutionName}") + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.App/getCustomDomainVerificationId") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response jobExecutionSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, - @PathParam("jobExecutionName") String jobExecutionName, @QueryParam("api-version") String apiVersion, + Response getCustomDomainVerificationIdSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.App/getCustomDomainVerificationId") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions/{jobExecutionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> getCustomDomainVerificationId(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> jobExecution(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, + @PathParam("jobExecutionName") String jobExecutionName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.App/getCustomDomainVerificationId") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions/{jobExecutionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response getCustomDomainVerificationIdSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Response jobExecutionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("jobName") String jobName, + @PathParam("jobExecutionName") String jobExecutionName, @HeaderParam("Accept") String accept, + Context context); } /** - * Get details of a single job execution. + * Get the verification id of a subscription used for verifying custom domains. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. - * @param jobExecutionName Job execution 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 details of a single job execution along with {@link Response} on successful completion of {@link Mono}. + * @return the verification id of a subscription used for verifying custom domains along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> jobExecutionWithResponseAsync(String resourceGroupName, String jobName, - String jobExecutionName) { - 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.")); - } - if (jobExecutionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter jobExecutionName is required and cannot be null.")); - } + private Mono> getCustomDomainVerificationIdWithResponseAsync() { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.jobExecution(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, jobName, jobExecutionName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getCustomDomainVerificationId(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get details of a single job execution. + * Get the verification id of a subscription used for verifying custom domains. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. - * @param jobExecutionName Job execution 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 details of a single job execution on successful completion of {@link Mono}. + * @return the verification id of a subscription used for verifying custom domains on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono jobExecutionAsync(String resourceGroupName, String jobName, - String jobExecutionName) { - return jobExecutionWithResponseAsync(resourceGroupName, jobName, jobExecutionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono getCustomDomainVerificationIdAsync() { + return getCustomDomainVerificationIdWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get details of a single job execution. + * Get the verification id of a subscription used for verifying custom domains. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. - * @param jobExecutionName Job execution 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 details of a single job execution along with {@link Response}. + * @return the verification id of a subscription used for verifying custom domains along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response jobExecutionWithResponse(String resourceGroupName, String jobName, - String jobExecutionName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (jobName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); - } - if (jobExecutionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter jobExecutionName is required and cannot be null.")); - } + public Response getCustomDomainVerificationIdWithResponse(Context context) { final String accept = "application/json"; - return service.jobExecutionSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - jobName, jobExecutionName, this.client.getApiVersion(), accept, context); + return service.getCustomDomainVerificationIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); } /** - * Get details of a single job execution. + * Get the verification id of a subscription used for verifying custom domains. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. - * @param jobExecutionName Job execution 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 details of a single job execution. + * @return the verification id of a subscription used for verifying custom domains. */ @ServiceMethod(returns = ReturnType.SINGLE) - public JobExecutionInner jobExecution(String resourceGroupName, String jobName, String jobExecutionName) { - return jobExecutionWithResponse(resourceGroupName, jobName, jobExecutionName, Context.NONE).getValue(); + public String getCustomDomainVerificationId() { + return getCustomDomainVerificationIdWithResponse(Context.NONE).getValue(); } /** - * Get the verification id of a subscription used for verifying custom domains. + * Get details of a single job execution. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param jobExecutionName Job execution 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 the verification id of a subscription used for verifying custom domains along with {@link Response} on - * successful completion of {@link Mono}. + * @return details of a single job execution along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getCustomDomainVerificationIdWithResponseAsync() { - 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.")); - } + private Mono> jobExecutionWithResponseAsync(String resourceGroupName, String jobName, + String jobExecutionName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getCustomDomainVerificationId(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .withContext(context -> service.jobExecution(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, jobExecutionName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the verification id of a subscription used for verifying custom domains. + * Get details of a single job execution. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param jobExecutionName Job execution 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 the verification id of a subscription used for verifying custom domains on successful completion of - * {@link Mono}. + * @return details of a single job execution on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getCustomDomainVerificationIdAsync() { - return getCustomDomainVerificationIdWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono jobExecutionAsync(String resourceGroupName, String jobName, + String jobExecutionName) { + return jobExecutionWithResponseAsync(resourceGroupName, jobName, jobExecutionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get the verification id of a subscription used for verifying custom domains. + * Get details of a single job execution. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param jobExecutionName Job execution 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 the verification id of a subscription used for verifying custom domains along with {@link Response}. + * @return details of a single job execution along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCustomDomainVerificationIdWithResponse(Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + public Response jobExecutionWithResponse(String resourceGroupName, String jobName, + String jobExecutionName, Context context) { final String accept = "application/json"; - return service.getCustomDomainVerificationIdSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context); + return service.jobExecutionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, jobName, jobExecutionName, accept, context); } /** - * Get the verification id of a subscription used for verifying custom domains. + * Get details of a single job execution. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param jobExecutionName Job execution 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 the verification id of a subscription used for verifying custom domains. + * @return details of a single job execution. */ @ServiceMethod(returns = ReturnType.SINGLE) - public String getCustomDomainVerificationId() { - return getCustomDomainVerificationIdWithResponse(Context.NONE).getValue(); + public JobExecutionInner jobExecution(String resourceGroupName, String jobName, String jobExecutionName) { + return jobExecutionWithResponse(resourceGroupName, jobName, jobExecutionName, Context.NONE).getValue(); } - - private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ResourceProvidersImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ResourceProvidersImpl.java index cacbfd455506..5c9209badcc9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ResourceProvidersImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ResourceProvidersImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -26,16 +26,20 @@ public ResourceProvidersImpl(ResourceProvidersClient innerClient, this.serviceManager = serviceManager; } + public Response getCustomDomainVerificationIdWithResponse(Context context) { + return this.serviceClient().getCustomDomainVerificationIdWithResponse(context); + } + + public String getCustomDomainVerificationId() { + return this.serviceClient().getCustomDomainVerificationId(); + } + public Response jobExecutionWithResponse(String resourceGroupName, String jobName, String jobExecutionName, Context context) { Response inner = this.serviceClient().jobExecutionWithResponse(resourceGroupName, jobName, jobExecutionName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new JobExecutionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new JobExecutionImpl(inner.getValue(), this.manager())); } public JobExecution jobExecution(String resourceGroupName, String jobName, String jobExecutionName) { @@ -47,14 +51,6 @@ public JobExecution jobExecution(String resourceGroupName, String jobName, Strin } } - public Response getCustomDomainVerificationIdWithResponse(Context context) { - return this.serviceClient().getCustomDomainVerificationIdWithResponse(context); - } - - public String getCustomDomainVerificationId() { - return this.serviceClient().getCustomDomainVerificationId(); - } - private ResourceProvidersClient serviceClient() { return this.innerClient; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/RevisionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/RevisionImpl.java index 93deebbb0d1b..f24ed873571f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/RevisionImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/RevisionImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SandboxGroupImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SandboxGroupImpl.java new file mode 100644 index 000000000000..d1912fea414e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SandboxGroupImpl.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.SandboxGroupInner; +import com.azure.resourcemanager.appcontainers.models.SandboxGroup; +import com.azure.resourcemanager.appcontainers.models.SandboxGroupProperties; +import java.util.Collections; +import java.util.Map; + +public final class SandboxGroupImpl implements SandboxGroup, SandboxGroup.Definition, SandboxGroup.Update { + private SandboxGroupInner 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 SandboxGroupProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SandboxGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sandboxGroupName; + + public SandboxGroupImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SandboxGroup create() { + this.innerObject = serviceManager.serviceClient() + .getSandboxGroups() + .createOrUpdate(resourceGroupName, sandboxGroupName, this.innerModel(), Context.NONE); + return this; + } + + public SandboxGroup create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSandboxGroups() + .createOrUpdate(resourceGroupName, sandboxGroupName, this.innerModel(), context); + return this; + } + + SandboxGroupImpl(String name, com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = new SandboxGroupInner(); + this.serviceManager = serviceManager; + this.sandboxGroupName = name; + } + + public SandboxGroupImpl update() { + return this; + } + + public SandboxGroup apply() { + this.innerObject = serviceManager.serviceClient() + .getSandboxGroups() + .createOrUpdate(resourceGroupName, sandboxGroupName, this.innerModel(), Context.NONE); + return this; + } + + public SandboxGroup apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSandboxGroups() + .createOrUpdate(resourceGroupName, sandboxGroupName, this.innerModel(), context); + return this; + } + + SandboxGroupImpl(SandboxGroupInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sandboxGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "sandboxGroups"); + } + + public SandboxGroup refresh() { + this.innerObject = serviceManager.serviceClient() + .getSandboxGroups() + .getByResourceGroupWithResponse(resourceGroupName, sandboxGroupName, Context.NONE) + .getValue(); + return this; + } + + public SandboxGroup refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSandboxGroups() + .getByResourceGroupWithResponse(resourceGroupName, sandboxGroupName, context) + .getValue(); + return this; + } + + public SandboxGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SandboxGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SandboxGroupImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public SandboxGroupImpl withProperties(SandboxGroupProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SandboxGroupsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SandboxGroupsClientImpl.java new file mode 100644 index 000000000000..03184ba9766e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SandboxGroupsClientImpl.java @@ -0,0 +1,1117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.BinaryData; +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.SandboxGroupsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.SandboxGroupInner; +import com.azure.resourcemanager.appcontainers.implementation.models.SandboxGroupListResult; +import com.azure.resourcemanager.appcontainers.models.SandboxGroupPatch; +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 SandboxGroupsClient. + */ +public final class SandboxGroupsClientImpl implements SandboxGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SandboxGroupsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of SandboxGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SandboxGroupsClientImpl(ContainerAppsApiClientImpl client) { + this.service + = RestProxy.create(SandboxGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientSandboxGroups to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ContainerAppsApiClientSandboxGroups") + public interface SandboxGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sandboxGroups/{sandboxGroupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sandboxGroupName") String sandboxGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sandboxGroups/{sandboxGroupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sandboxGroupName") String sandboxGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sandboxGroups/{sandboxGroupName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sandboxGroupName") String sandboxGroupName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") SandboxGroupInner resource, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sandboxGroups/{sandboxGroupName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sandboxGroupName") String sandboxGroupName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") SandboxGroupInner resource, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sandboxGroups/{sandboxGroupName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sandboxGroupName") String sandboxGroupName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") SandboxGroupPatch properties, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sandboxGroups/{sandboxGroupName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sandboxGroupName") String sandboxGroupName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") SandboxGroupPatch properties, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sandboxGroups/{sandboxGroupName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sandboxGroupName") String sandboxGroupName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sandboxGroups/{sandboxGroupName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sandboxGroupName") String sandboxGroupName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sandboxGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") 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/sandboxGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") 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}/providers/Microsoft.App/sandboxGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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}/providers/Microsoft.App/sandboxGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the properties of a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a SandboxGroup along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String sandboxGroupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sandboxGroupName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the properties of a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a SandboxGroup on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String sandboxGroupName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sandboxGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the properties of a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @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 properties of a SandboxGroup along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String sandboxGroupName, + Context context) { + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sandboxGroupName, accept, context); + } + + /** + * Get the properties of a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a SandboxGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SandboxGroupInner getByResourceGroup(String resourceGroupName, String sandboxGroupName) { + return getByResourceGroupWithResponse(resourceGroupName, sandboxGroupName, Context.NONE).getValue(); + } + + /** + * Create or update a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param resource 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 a SandboxGroup resource, representing a group of sandboxes that share configuration defaults and quotas + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String sandboxGroupName, SandboxGroupInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sandboxGroupName, contentType, accept, resource, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param resource 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 a SandboxGroup resource, representing a group of sandboxes that share configuration defaults and quotas + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String sandboxGroupName, + SandboxGroupInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sandboxGroupName, contentType, accept, resource, + Context.NONE); + } + + /** + * Create or update a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param resource 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 a SandboxGroup resource, representing a group of sandboxes that share configuration defaults and quotas + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String sandboxGroupName, + SandboxGroupInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sandboxGroupName, contentType, accept, resource, + context); + } + + /** + * Create or update a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param resource 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 a SandboxGroup resource, representing a group of sandboxes that + * share configuration defaults and quotas. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SandboxGroupInner> + beginCreateOrUpdateAsync(String resourceGroupName, String sandboxGroupName, SandboxGroupInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, sandboxGroupName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SandboxGroupInner.class, SandboxGroupInner.class, this.client.getContext()); + } + + /** + * Create or update a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param resource 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 a SandboxGroup resource, representing a group of sandboxes that + * share configuration defaults and quotas. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SandboxGroupInner> beginCreateOrUpdate(String resourceGroupName, + String sandboxGroupName, SandboxGroupInner resource) { + Response response = createOrUpdateWithResponse(resourceGroupName, sandboxGroupName, resource); + return this.client.getLroResult(response, SandboxGroupInner.class, + SandboxGroupInner.class, Context.NONE); + } + + /** + * Create or update a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param resource 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 a SandboxGroup resource, representing a group of sandboxes that + * share configuration defaults and quotas. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SandboxGroupInner> beginCreateOrUpdate(String resourceGroupName, + String sandboxGroupName, SandboxGroupInner resource, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, sandboxGroupName, resource, context); + return this.client.getLroResult(response, SandboxGroupInner.class, + SandboxGroupInner.class, context); + } + + /** + * Create or update a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param resource 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 a SandboxGroup resource, representing a group of sandboxes that share configuration defaults and quotas + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String sandboxGroupName, + SandboxGroupInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, sandboxGroupName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param resource 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 a SandboxGroup resource, representing a group of sandboxes that share configuration defaults and quotas. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SandboxGroupInner createOrUpdate(String resourceGroupName, String sandboxGroupName, + SandboxGroupInner resource) { + return beginCreateOrUpdate(resourceGroupName, sandboxGroupName, resource).getFinalResult(); + } + + /** + * Create or update a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param resource 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 a SandboxGroup resource, representing a group of sandboxes that share configuration defaults and quotas. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SandboxGroupInner createOrUpdate(String resourceGroupName, String sandboxGroupName, + SandboxGroupInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, sandboxGroupName, resource, context).getFinalResult(); + } + + /** + * Patches a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param properties 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 a SandboxGroup resource, representing a group of sandboxes that share configuration defaults and quotas + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String sandboxGroupName, + SandboxGroupPatch properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sandboxGroupName, contentType, accept, properties, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patches a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param properties 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 a SandboxGroup resource, representing a group of sandboxes that share configuration defaults and quotas + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String sandboxGroupName, + SandboxGroupPatch properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sandboxGroupName, contentType, accept, properties, + Context.NONE); + } + + /** + * Patches a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param properties 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 a SandboxGroup resource, representing a group of sandboxes that share configuration defaults and quotas + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String sandboxGroupName, + SandboxGroupPatch properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sandboxGroupName, contentType, accept, properties, + context); + } + + /** + * Patches a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param properties 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 a SandboxGroup resource, representing a group of sandboxes that + * share configuration defaults and quotas. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUpdateAsync(String resourceGroupName, String sandboxGroupName, + SandboxGroupPatch properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, sandboxGroupName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Patches a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param properties 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 a SandboxGroup resource, representing a group of sandboxes that + * share configuration defaults and quotas. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpdate(String resourceGroupName, String sandboxGroupName, + SandboxGroupPatch properties) { + Response response = updateWithResponse(resourceGroupName, sandboxGroupName, properties); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Patches a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param properties 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 a SandboxGroup resource, representing a group of sandboxes that + * share configuration defaults and quotas. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpdate(String resourceGroupName, String sandboxGroupName, + SandboxGroupPatch properties, Context context) { + Response response = updateWithResponse(resourceGroupName, sandboxGroupName, properties, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Patches a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param properties 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 a SandboxGroup resource, representing a group of sandboxes that share configuration defaults and quotas + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String sandboxGroupName, SandboxGroupPatch properties) { + return beginUpdateAsync(resourceGroupName, sandboxGroupName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patches a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param properties 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void update(String resourceGroupName, String sandboxGroupName, SandboxGroupPatch properties) { + beginUpdate(resourceGroupName, sandboxGroupName, properties).getFinalResult(); + } + + /** + * Patches a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param properties 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void update(String resourceGroupName, String sandboxGroupName, SandboxGroupPatch properties, + Context context) { + beginUpdate(resourceGroupName, sandboxGroupName, properties, context).getFinalResult(); + } + + /** + * Delete a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 sandboxGroupName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sandboxGroupName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String sandboxGroupName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sandboxGroupName, Context.NONE); + } + + /** + * Delete a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String sandboxGroupName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sandboxGroupName, context); + } + + /** + * Delete a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 sandboxGroupName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, sandboxGroupName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 sandboxGroupName) { + Response response = deleteWithResponse(resourceGroupName, sandboxGroupName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @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 sandboxGroupName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, sandboxGroupName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 sandboxGroupName) { + return beginDeleteAsync(resourceGroupName, sandboxGroupName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 sandboxGroupName) { + beginDelete(resourceGroupName, sandboxGroupName).getFinalResult(); + } + + /** + * Delete a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @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 sandboxGroupName, Context context) { + beginDelete(resourceGroupName, sandboxGroupName, context).getFinalResult(); + } + + /** + * Get all SandboxGroups in a 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 all SandboxGroups in a resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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())); + } + + /** + * Get all SandboxGroups in a 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 all SandboxGroups in a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Get all SandboxGroups in a 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 all SandboxGroups in a resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get all SandboxGroups in a 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 all SandboxGroups in a resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get all SandboxGroups in a 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 all SandboxGroups in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * Get all SandboxGroups in a 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 all SandboxGroups in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * Get all SandboxGroups for a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all SandboxGroups for a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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())); + } + + /** + * Get all SandboxGroups for a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all SandboxGroups for a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Get all SandboxGroups for a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all SandboxGroups for a subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get all SandboxGroups for a subscription. + * + * @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 all SandboxGroups for a subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get all SandboxGroups for a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all SandboxGroups for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * Get all SandboxGroups for a subscription. + * + * @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 all SandboxGroups for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, 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 all SandboxGroups in a resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all SandboxGroups in a resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @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 all SandboxGroups in a resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 all SandboxGroups for a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all SandboxGroups for a subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @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 all SandboxGroups for a subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/SandboxGroupsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SandboxGroupsImpl.java new file mode 100644 index 000000000000..9b1f967cd708 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SandboxGroupsImpl.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.SandboxGroupsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.SandboxGroupInner; +import com.azure.resourcemanager.appcontainers.models.SandboxGroup; +import com.azure.resourcemanager.appcontainers.models.SandboxGroupPatch; +import com.azure.resourcemanager.appcontainers.models.SandboxGroups; + +public final class SandboxGroupsImpl implements SandboxGroups { + private static final ClientLogger LOGGER = new ClientLogger(SandboxGroupsImpl.class); + + private final SandboxGroupsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public SandboxGroupsImpl(SandboxGroupsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String sandboxGroupName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, sandboxGroupName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SandboxGroupImpl(inner.getValue(), this.manager())); + } + + public SandboxGroup getByResourceGroup(String resourceGroupName, String sandboxGroupName) { + SandboxGroupInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, sandboxGroupName); + if (inner != null) { + return new SandboxGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public void update(String resourceGroupName, String sandboxGroupName, SandboxGroupPatch properties) { + this.serviceClient().update(resourceGroupName, sandboxGroupName, properties); + } + + public void update(String resourceGroupName, String sandboxGroupName, SandboxGroupPatch properties, + Context context) { + this.serviceClient().update(resourceGroupName, sandboxGroupName, properties, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String sandboxGroupName) { + this.serviceClient().delete(resourceGroupName, sandboxGroupName); + } + + public void delete(String resourceGroupName, String sandboxGroupName, Context context) { + this.serviceClient().delete(resourceGroupName, sandboxGroupName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SandboxGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SandboxGroupImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SandboxGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SandboxGroupImpl(inner1, this.manager())); + } + + public SandboxGroup 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 sandboxGroupName = ResourceManagerUtils.getValueFromIdByName(id, "sandboxGroups"); + if (sandboxGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sandboxGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sandboxGroupName, 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 sandboxGroupName = ResourceManagerUtils.getValueFromIdByName(id, "sandboxGroups"); + if (sandboxGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sandboxGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sandboxGroupName, 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 sandboxGroupName = ResourceManagerUtils.getValueFromIdByName(id, "sandboxGroups"); + if (sandboxGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sandboxGroups'.", id))); + } + this.delete(resourceGroupName, sandboxGroupName, 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 sandboxGroupName = ResourceManagerUtils.getValueFromIdByName(id, "sandboxGroups"); + if (sandboxGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sandboxGroups'.", id))); + } + this.delete(resourceGroupName, sandboxGroupName, context); + } + + private SandboxGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public SandboxGroupImpl define(String name) { + return new SandboxGroupImpl(name, this.manager()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SecretsCollectionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SecretsCollectionImpl.java index e08baebd76bd..6dbbe73383be 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SecretsCollectionImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/SecretsCollectionImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; 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 index 5c72ec0cb149..0852dde6ef9e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; 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 49070a189996..271dc1d0dd40 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/UsageImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/UsageImpl.java index 9d768b691cd4..e9075fc76005 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/UsageImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/UsageImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/UsagesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/UsagesClientImpl.java index 5b57f6ef03bd..be84ead26d9f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/UsagesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/UsagesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -24,11 +24,10 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.appcontainers.fluent.UsagesClient; import com.azure.resourcemanager.appcontainers.fluent.models.UsageInner; +import com.azure.resourcemanager.appcontainers.implementation.models.ListUsagesResult; import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; -import com.azure.resourcemanager.appcontainers.models.ListUsagesResult; import reactor.core.publisher.Mono; /** @@ -59,38 +58,38 @@ public final class UsagesClientImpl implements UsagesClient { * The interface defining all the services for ContainerAppsApiClientUsages to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ContainerAppsApiClientUsages") public interface UsagesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/locations/{location}/usages") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("location") String location, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/locations/{location}/usages") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Response listSync(@HostParam("$host") String endpoint, @PathParam("location") String location, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @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); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -101,25 +100,15 @@ Response listNextSync(@PathParam(value = "nextLink", encoded = * @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 PagedResponse} on successful completion of {@link Mono}. + * @return paged collection of Usage items along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String location) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location 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(), location, this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, 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())); @@ -133,7 +122,7 @@ private Mono> listSinglePageAsync(String location) { * @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 paginated response with {@link PagedFlux}. + * @return paged collection of Usage items as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String location) { @@ -148,27 +137,13 @@ private PagedFlux listAsync(String location) { * @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 PagedResponse}. + * @return paged collection of Usage items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String location) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), location, - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, Context.NONE); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -182,27 +157,13 @@ private PagedResponse listSinglePage(String location) { * @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 PagedResponse}. + * @return paged collection of Usage items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String location, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), location, - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -215,7 +176,7 @@ private PagedResponse listSinglePage(String location, Context contex * @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 paginated response with {@link PagedIterable}. + * @return paged collection of Usage items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String location) { @@ -231,7 +192,7 @@ public PagedIterable list(String location) { * @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 paginated response with {@link PagedIterable}. + * @return paged collection of Usage items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String location, Context context) { @@ -246,17 +207,11 @@ public PagedIterable list(String location, Context context) { * @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 PagedResponse} on successful completion of {@link Mono}. + * @return paged collection of Usage items 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(), @@ -271,19 +226,10 @@ private Mono> listNextSinglePageAsync(String nextLink) * @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 PagedResponse}. + * @return paged collection of Usage items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -299,24 +245,13 @@ private PagedResponse listNextSinglePage(String nextLink) { * @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 PagedResponse}. + * @return paged collection of Usage items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(UsagesClientImpl.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/UsagesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/UsagesImpl.java index 9606e538e86b..66f4bcfd72fa 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/UsagesImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/UsagesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/VnetConnectionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/VnetConnectionImpl.java new file mode 100644 index 000000000000..1ac15fc3f2a4 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/VnetConnectionImpl.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.VnetConnectionInner; +import com.azure.resourcemanager.appcontainers.models.VnetConnection; +import com.azure.resourcemanager.appcontainers.models.VnetConnectionProperties; + +public final class VnetConnectionImpl implements VnetConnection, VnetConnection.Definition, VnetConnection.Update { + private VnetConnectionInner 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 VnetConnectionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public VnetConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sandboxGroupName; + + private String vnetConnectionName; + + public VnetConnectionImpl withExistingSandboxGroup(String resourceGroupName, String sandboxGroupName) { + this.resourceGroupName = resourceGroupName; + this.sandboxGroupName = sandboxGroupName; + return this; + } + + public VnetConnection create() { + this.innerObject = serviceManager.serviceClient() + .getVnetConnections() + .createOrUpdateWithResponse(resourceGroupName, sandboxGroupName, vnetConnectionName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public VnetConnection create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getVnetConnections() + .createOrUpdateWithResponse(resourceGroupName, sandboxGroupName, vnetConnectionName, this.innerModel(), + context) + .getValue(); + return this; + } + + VnetConnectionImpl(String name, com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = new VnetConnectionInner(); + this.serviceManager = serviceManager; + this.vnetConnectionName = name; + } + + public VnetConnectionImpl update() { + return this; + } + + public VnetConnection apply() { + this.innerObject = serviceManager.serviceClient() + .getVnetConnections() + .createOrUpdateWithResponse(resourceGroupName, sandboxGroupName, vnetConnectionName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public VnetConnection apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getVnetConnections() + .createOrUpdateWithResponse(resourceGroupName, sandboxGroupName, vnetConnectionName, this.innerModel(), + context) + .getValue(); + return this; + } + + VnetConnectionImpl(VnetConnectionInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sandboxGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "sandboxGroups"); + this.vnetConnectionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "vnetConnections"); + } + + public VnetConnection refresh() { + this.innerObject = serviceManager.serviceClient() + .getVnetConnections() + .getWithResponse(resourceGroupName, sandboxGroupName, vnetConnectionName, Context.NONE) + .getValue(); + return this; + } + + public VnetConnection refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getVnetConnections() + .getWithResponse(resourceGroupName, sandboxGroupName, vnetConnectionName, context) + .getValue(); + return this; + } + + public VnetConnectionImpl withProperties(VnetConnectionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/VnetConnectionsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/VnetConnectionsClientImpl.java new file mode 100644 index 000000000000..b7f38bb5e3ea --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/VnetConnectionsClientImpl.java @@ -0,0 +1,671 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.BinaryData; +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.VnetConnectionsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.VnetConnectionInner; +import com.azure.resourcemanager.appcontainers.implementation.models.VnetConnectionListResult; +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 VnetConnectionsClient. + */ +public final class VnetConnectionsClientImpl implements VnetConnectionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final VnetConnectionsService service; + + /** + * The service client containing this operation class. + */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of VnetConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VnetConnectionsClientImpl(ContainerAppsApiClientImpl client) { + this.service + = RestProxy.create(VnetConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientVnetConnections to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ContainerAppsApiClientVnetConnections") + public interface VnetConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sandboxGroups/{sandboxGroupName}/vnetConnections/{vnetConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sandboxGroupName") String sandboxGroupName, + @PathParam("vnetConnectionName") String vnetConnectionName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sandboxGroups/{sandboxGroupName}/vnetConnections/{vnetConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sandboxGroupName") String sandboxGroupName, + @PathParam("vnetConnectionName") String vnetConnectionName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sandboxGroups/{sandboxGroupName}/vnetConnections/{vnetConnectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sandboxGroupName") String sandboxGroupName, + @PathParam("vnetConnectionName") String vnetConnectionName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") VnetConnectionInner resource, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sandboxGroups/{sandboxGroupName}/vnetConnections/{vnetConnectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sandboxGroupName") String sandboxGroupName, + @PathParam("vnetConnectionName") String vnetConnectionName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") VnetConnectionInner resource, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sandboxGroups/{sandboxGroupName}/vnetConnections/{vnetConnectionName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sandboxGroupName") String sandboxGroupName, + @PathParam("vnetConnectionName") String vnetConnectionName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sandboxGroups/{sandboxGroupName}/vnetConnections/{vnetConnectionName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sandboxGroupName") String sandboxGroupName, + @PathParam("vnetConnectionName") String vnetConnectionName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sandboxGroups/{sandboxGroupName}/vnetConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySandboxGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sandboxGroupName") String sandboxGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sandboxGroups/{sandboxGroupName}/vnetConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySandboxGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sandboxGroupName") String sandboxGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySandboxGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySandboxGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the properties of a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a VnetConnection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String sandboxGroupName, + String vnetConnectionName) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sandboxGroupName, vnetConnectionName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the properties of a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a VnetConnection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String sandboxGroupName, + String vnetConnectionName) { + return getWithResponseAsync(resourceGroupName, sandboxGroupName, vnetConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the properties of a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @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 properties of a VnetConnection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String sandboxGroupName, + String vnetConnectionName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, sandboxGroupName, vnetConnectionName, accept, context); + } + + /** + * Get the properties of a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a VnetConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VnetConnectionInner get(String resourceGroupName, String sandboxGroupName, String vnetConnectionName) { + return getWithResponse(resourceGroupName, sandboxGroupName, vnetConnectionName, Context.NONE).getValue(); + } + + /** + * Create or update a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @param resource 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 a virtual network connection associated with a SandboxGroup along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String sandboxGroupName, String vnetConnectionName, VnetConnectionInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sandboxGroupName, vnetConnectionName, contentType, + accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @param resource 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 a virtual network connection associated with a SandboxGroup on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String sandboxGroupName, + String vnetConnectionName, VnetConnectionInner resource) { + return createOrUpdateWithResponseAsync(resourceGroupName, sandboxGroupName, vnetConnectionName, resource) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @param resource 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 a virtual network connection associated with a SandboxGroup along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String sandboxGroupName, + String vnetConnectionName, VnetConnectionInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sandboxGroupName, vnetConnectionName, contentType, + accept, resource, context); + } + + /** + * Create or update a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @param resource 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 a virtual network connection associated with a SandboxGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VnetConnectionInner createOrUpdate(String resourceGroupName, String sandboxGroupName, + String vnetConnectionName, VnetConnectionInner resource) { + return createOrUpdateWithResponse(resourceGroupName, sandboxGroupName, vnetConnectionName, resource, + Context.NONE).getValue(); + } + + /** + * Delete a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 sandboxGroupName, + String vnetConnectionName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sandboxGroupName, vnetConnectionName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String sandboxGroupName, + String vnetConnectionName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sandboxGroupName, vnetConnectionName, Context.NONE); + } + + /** + * Delete a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String sandboxGroupName, + String vnetConnectionName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sandboxGroupName, vnetConnectionName, context); + } + + /** + * Delete a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 sandboxGroupName, + String vnetConnectionName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, sandboxGroupName, vnetConnectionName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 sandboxGroupName, + String vnetConnectionName) { + Response response = deleteWithResponse(resourceGroupName, sandboxGroupName, vnetConnectionName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @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 sandboxGroupName, + String vnetConnectionName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, sandboxGroupName, vnetConnectionName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 sandboxGroupName, String vnetConnectionName) { + return beginDeleteAsync(resourceGroupName, sandboxGroupName, vnetConnectionName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 sandboxGroupName, String vnetConnectionName) { + beginDelete(resourceGroupName, sandboxGroupName, vnetConnectionName).getFinalResult(); + } + + /** + * Delete a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @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 sandboxGroupName, String vnetConnectionName, Context context) { + beginDelete(resourceGroupName, sandboxGroupName, vnetConnectionName, context).getFinalResult(); + } + + /** + * List all VnetConnections in the specified SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 VnetConnection list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySandboxGroupSinglePageAsync(String resourceGroupName, + String sandboxGroupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listBySandboxGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sandboxGroupName, 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 all VnetConnections in the specified SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 VnetConnection list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySandboxGroupAsync(String resourceGroupName, String sandboxGroupName) { + return new PagedFlux<>(() -> listBySandboxGroupSinglePageAsync(resourceGroupName, sandboxGroupName), + nextLink -> listBySandboxGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all VnetConnections in the specified SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 VnetConnection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySandboxGroupSinglePage(String resourceGroupName, + String sandboxGroupName) { + final String accept = "application/json"; + Response res + = service.listBySandboxGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sandboxGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List all VnetConnections in the specified SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @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 VnetConnection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySandboxGroupSinglePage(String resourceGroupName, + String sandboxGroupName, Context context) { + final String accept = "application/json"; + Response res + = service.listBySandboxGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, sandboxGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List all VnetConnections in the specified SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 VnetConnection list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySandboxGroup(String resourceGroupName, String sandboxGroupName) { + return new PagedIterable<>(() -> listBySandboxGroupSinglePage(resourceGroupName, sandboxGroupName), + nextLink -> listBySandboxGroupNextSinglePage(nextLink)); + } + + /** + * List all VnetConnections in the specified SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @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 VnetConnection list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySandboxGroup(String resourceGroupName, String sandboxGroupName, + Context context) { + return new PagedIterable<>(() -> listBySandboxGroupSinglePage(resourceGroupName, sandboxGroupName, context), + nextLink -> listBySandboxGroupNextSinglePage(nextLink, 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 VnetConnection list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySandboxGroupNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySandboxGroupNext(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 VnetConnection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySandboxGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySandboxGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @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 VnetConnection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySandboxGroupNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listBySandboxGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/VnetConnectionsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/VnetConnectionsImpl.java new file mode 100644 index 000000000000..7b3b261ef9a2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/VnetConnectionsImpl.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.VnetConnectionsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.VnetConnectionInner; +import com.azure.resourcemanager.appcontainers.models.VnetConnection; +import com.azure.resourcemanager.appcontainers.models.VnetConnections; + +public final class VnetConnectionsImpl implements VnetConnections { + private static final ClientLogger LOGGER = new ClientLogger(VnetConnectionsImpl.class); + + private final VnetConnectionsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public VnetConnectionsImpl(VnetConnectionsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String sandboxGroupName, + String vnetConnectionName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, sandboxGroupName, vnetConnectionName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new VnetConnectionImpl(inner.getValue(), this.manager())); + } + + public VnetConnection get(String resourceGroupName, String sandboxGroupName, String vnetConnectionName) { + VnetConnectionInner inner = this.serviceClient().get(resourceGroupName, sandboxGroupName, vnetConnectionName); + if (inner != null) { + return new VnetConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String sandboxGroupName, String vnetConnectionName) { + this.serviceClient().delete(resourceGroupName, sandboxGroupName, vnetConnectionName); + } + + public void delete(String resourceGroupName, String sandboxGroupName, String vnetConnectionName, Context context) { + this.serviceClient().delete(resourceGroupName, sandboxGroupName, vnetConnectionName, context); + } + + public PagedIterable listBySandboxGroup(String resourceGroupName, String sandboxGroupName) { + PagedIterable inner + = this.serviceClient().listBySandboxGroup(resourceGroupName, sandboxGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VnetConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listBySandboxGroup(String resourceGroupName, String sandboxGroupName, + Context context) { + PagedIterable inner + = this.serviceClient().listBySandboxGroup(resourceGroupName, sandboxGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VnetConnectionImpl(inner1, this.manager())); + } + + public VnetConnection 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 sandboxGroupName = ResourceManagerUtils.getValueFromIdByName(id, "sandboxGroups"); + if (sandboxGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sandboxGroups'.", id))); + } + String vnetConnectionName = ResourceManagerUtils.getValueFromIdByName(id, "vnetConnections"); + if (vnetConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vnetConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, sandboxGroupName, vnetConnectionName, 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 sandboxGroupName = ResourceManagerUtils.getValueFromIdByName(id, "sandboxGroups"); + if (sandboxGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sandboxGroups'.", id))); + } + String vnetConnectionName = ResourceManagerUtils.getValueFromIdByName(id, "vnetConnections"); + if (vnetConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vnetConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, sandboxGroupName, vnetConnectionName, 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 sandboxGroupName = ResourceManagerUtils.getValueFromIdByName(id, "sandboxGroups"); + if (sandboxGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sandboxGroups'.", id))); + } + String vnetConnectionName = ResourceManagerUtils.getValueFromIdByName(id, "vnetConnections"); + if (vnetConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vnetConnections'.", id))); + } + this.delete(resourceGroupName, sandboxGroupName, vnetConnectionName, 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 sandboxGroupName = ResourceManagerUtils.getValueFromIdByName(id, "sandboxGroups"); + if (sandboxGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sandboxGroups'.", id))); + } + String vnetConnectionName = ResourceManagerUtils.getValueFromIdByName(id, "vnetConnections"); + if (vnetConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vnetConnections'.", id))); + } + this.delete(resourceGroupName, sandboxGroupName, vnetConnectionName, context); + } + + private VnetConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public VnetConnectionImpl define(String name) { + return new VnetConnectionImpl(name, this.manager()); + } +} 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 index d0fcac1ff54b..791c2472c011 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; @@ -33,14 +33,14 @@ public String type() { return this.innerModel().type(); } - public WorkflowKind kind() { - return this.innerModel().kind(); - } - public WorkflowEnvelopeProperties properties() { return this.innerModel().properties(); } + public WorkflowKind kind() { + return this.innerModel().kind(); + } + public SystemData systemData() { return this.innerModel().systemData(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/WorkloadProfileStatesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/WorkloadProfileStatesImpl.java index 6bf062081f2c..d71e39f5f98f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/WorkloadProfileStatesImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/WorkloadProfileStatesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.implementation; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AuthConfigCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/AuthConfigCollection.java similarity index 68% rename from sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AuthConfigCollection.java rename to sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/AuthConfigCollection.java index 9de58bc2a77d..b9d068c4fad7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AuthConfigCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/AuthConfigCollection.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.appcontainers.models; +package com.azure.resourcemanager.appcontainers.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,26 +16,26 @@ /** * AuthConfig collection ARM resource. */ -@Fluent +@Immutable public final class AuthConfigCollection implements JsonSerializable { /* - * Collection of resources. + * The AuthConfig items on this page */ private List value; /* - * Link to next page of resources. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of AuthConfigCollection class. */ - public AuthConfigCollection() { + private AuthConfigCollection() { } /** - * Get the value property: Collection of resources. + * Get the value property: The AuthConfig items on this page. * * @return the value value. */ @@ -45,18 +44,7 @@ public List value() { } /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the AuthConfigCollection object itself. - */ - public AuthConfigCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,22 +52,6 @@ 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 AuthConfigCollection")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AuthConfigCollection.class); - /** * {@inheritDoc} */ @@ -87,6 +59,7 @@ public void validate() { 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(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/AvailableEnvironmentModesCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/AvailableEnvironmentModesCollection.java new file mode 100644 index 000000000000..5420d7aad601 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/AvailableEnvironmentModesCollection.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation.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 com.azure.resourcemanager.appcontainers.fluent.models.AvailableEnvironmentModeInner; +import java.io.IOException; +import java.util.List; + +/** + * Collection of environment modes available in the location. + */ +@Immutable +public final class AvailableEnvironmentModesCollection + implements JsonSerializable { + /* + * The AvailableEnvironmentMode items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AvailableEnvironmentModesCollection class. + */ + private AvailableEnvironmentModesCollection() { + } + + /** + * Get the value property: The AvailableEnvironmentMode items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@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 AvailableEnvironmentModesCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableEnvironmentModesCollection 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 AvailableEnvironmentModesCollection. + */ + public static AvailableEnvironmentModesCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailableEnvironmentModesCollection deserializedAvailableEnvironmentModesCollection + = new AvailableEnvironmentModesCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AvailableEnvironmentModeInner.fromJson(reader1)); + deserializedAvailableEnvironmentModesCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAvailableEnvironmentModesCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableEnvironmentModesCollection; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableOperations.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/AvailableOperations.java similarity index 62% rename from sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableOperations.java rename to sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/AvailableOperations.java index 6eb3b999e571..ee4e0ce2871a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableOperations.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/AvailableOperations.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.appcontainers.models; +package com.azure.resourcemanager.appcontainers.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,27 +16,26 @@ /** * Available operations of the service. */ -@Fluent +@Immutable public final class AvailableOperations implements JsonSerializable { /* - * Collection of available operation details + * The OperationDetail items on this page */ private List value; /* - * URL client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of AvailableOperations class. */ - public AvailableOperations() { + private AvailableOperations() { } /** - * Get the value property: Collection of available operation details. + * Get the value property: The OperationDetail items on this page. * * @return the value value. */ @@ -45,19 +44,7 @@ public List value() { } /** - * Set the value property: Collection of available operation details. - * - * @param value the value value to set. - * @return the AvailableOperations object itself. - */ - public AvailableOperations withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,29 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: URL client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. - * - * @param nextLink the nextLink value to set. - * @return the AvailableOperations object itself. - */ - public AvailableOperations 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) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -105,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of AvailableOperations 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 AvailableOperations. */ public static AvailableOperations fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfilesCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/AvailableWorkloadProfilesCollection.java similarity index 68% rename from sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfilesCollection.java rename to sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/AvailableWorkloadProfilesCollection.java index 8a7ad74d96ef..4f6695abbcbb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfilesCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/AvailableWorkloadProfilesCollection.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.appcontainers.models; +package com.azure.resourcemanager.appcontainers.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,27 +16,27 @@ /** * Collection of available workload profiles in the location. */ -@Fluent +@Immutable public final class AvailableWorkloadProfilesCollection implements JsonSerializable { /* - * Collection of workload profiles. + * The AvailableWorkloadProfile items on this page */ private List value; /* - * Link to next page of resources. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of AvailableWorkloadProfilesCollection class. */ - public AvailableWorkloadProfilesCollection() { + private AvailableWorkloadProfilesCollection() { } /** - * Get the value property: Collection of workload profiles. + * Get the value property: The AvailableWorkloadProfile items on this page. * * @return the value value. */ @@ -46,18 +45,7 @@ public List value() { } /** - * Set the value property: Collection of workload profiles. - * - * @param value the value value to set. - * @return the AvailableWorkloadProfilesCollection object itself. - */ - public AvailableWorkloadProfilesCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,23 +53,6 @@ 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 AvailableWorkloadProfilesCollection")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AvailableWorkloadProfilesCollection.class); - /** * {@inheritDoc} */ @@ -89,6 +60,7 @@ public void validate() { 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(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/CertificateCollection.java similarity index 68% rename from sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateCollection.java rename to sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/CertificateCollection.java index 4829498672c0..ae9ed332756c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/CertificateCollection.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.appcontainers.models; +package com.azure.resourcemanager.appcontainers.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,26 +16,26 @@ /** * Collection of Certificates. */ -@Fluent +@Immutable public final class CertificateCollection implements JsonSerializable { /* - * Collection of resources. + * The Certificate items on this page */ private List value; /* - * Link to next page of resources. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of CertificateCollection class. */ - public CertificateCollection() { + private CertificateCollection() { } /** - * Get the value property: Collection of resources. + * Get the value property: The Certificate items on this page. * * @return the value value. */ @@ -45,18 +44,7 @@ public List value() { } /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the CertificateCollection object itself. - */ - public CertificateCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,22 +52,6 @@ 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 CertificateCollection")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CertificateCollection.class); - /** * {@inheritDoc} */ @@ -87,6 +59,7 @@ public void validate() { 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(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/ConnectedEnvironmentCollection.java similarity index 73% rename from sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentCollection.java rename to sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/ConnectedEnvironmentCollection.java index 09017c93dba6..636c504f1f99 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/ConnectedEnvironmentCollection.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.appcontainers.models; +package com.azure.resourcemanager.appcontainers.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +16,26 @@ /** * Collection of connectedEnvironments. */ -@Fluent +@Immutable public final class ConnectedEnvironmentCollection implements JsonSerializable { /* - * Collection of resources. + * The ConnectedEnvironment items on this page */ private List value; /* - * Link to next page of resources. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ConnectedEnvironmentCollection class. */ - public ConnectedEnvironmentCollection() { + private ConnectedEnvironmentCollection() { } /** - * Get the value property: Collection of resources. + * Get the value property: The ConnectedEnvironment items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the ConnectedEnvironmentCollection object itself. - */ - public ConnectedEnvironmentCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,17 +52,6 @@ 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} */ @@ -81,6 +59,7 @@ public void validate() { 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(); } @@ -90,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ConnectedEnvironmentCollection 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 ConnectedEnvironmentCollection. */ public static ConnectedEnvironmentCollection fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/ContainerAppCollection.java similarity index 68% rename from sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppCollection.java rename to sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/ContainerAppCollection.java index 1a61963f8c2d..6fb9c2ce45d5 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/ContainerAppCollection.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.appcontainers.models; +package com.azure.resourcemanager.appcontainers.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,26 +16,26 @@ /** * Container App collection ARM resource. */ -@Fluent +@Immutable public final class ContainerAppCollection implements JsonSerializable { /* - * Collection of resources. + * The ContainerApp items on this page */ private List value; /* - * Link to next page of resources. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ContainerAppCollection class. */ - public ContainerAppCollection() { + private ContainerAppCollection() { } /** - * Get the value property: Collection of resources. + * Get the value property: The ContainerApp items on this page. * * @return the value value. */ @@ -45,18 +44,7 @@ public List value() { } /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the ContainerAppCollection object itself. - */ - public ContainerAppCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,22 +52,6 @@ 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 ContainerAppCollection")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ContainerAppCollection.class); - /** * {@inheritDoc} */ @@ -87,6 +59,7 @@ public void validate() { 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(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/ContainerAppsFunctionCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/ContainerAppsFunctionCollection.java new file mode 100644 index 000000000000..d1917dd45741 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/ContainerAppsFunctionCollection.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation.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 com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsFunctionInner; +import java.io.IOException; +import java.util.List; + +/** + * Container App Functions collection ARM resource. + */ +@Immutable +public final class ContainerAppsFunctionCollection implements JsonSerializable { + /* + * The ContainerAppsFunction items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ContainerAppsFunctionCollection class. + */ + private ContainerAppsFunctionCollection() { + } + + /** + * Get the value property: The ContainerAppsFunction items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@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 ContainerAppsFunctionCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppsFunctionCollection 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 ContainerAppsFunctionCollection. + */ + public static ContainerAppsFunctionCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppsFunctionCollection deserializedContainerAppsFunctionCollection + = new ContainerAppsFunctionCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ContainerAppsFunctionInner.fromJson(reader1)); + deserializedContainerAppsFunctionCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedContainerAppsFunctionCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppsFunctionCollection; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/DaprComponentResiliencyPoliciesCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/DaprComponentResiliencyPoliciesCollection.java new file mode 100644 index 000000000000..60a0c2057b27 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/DaprComponentResiliencyPoliciesCollection.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation.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 com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentResiliencyPolicyInner; +import java.io.IOException; +import java.util.List; + +/** + * Dapr Component Resiliency Policies ARM resource. + */ +@Immutable +public final class DaprComponentResiliencyPoliciesCollection + implements JsonSerializable { + /* + * The DaprComponentResiliencyPolicy items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of DaprComponentResiliencyPoliciesCollection class. + */ + private DaprComponentResiliencyPoliciesCollection() { + } + + /** + * Get the value property: The DaprComponentResiliencyPolicy items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@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 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/DaprComponentsCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/DaprComponentsCollection.java similarity index 68% rename from sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentsCollection.java rename to sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/DaprComponentsCollection.java index 812630bf02eb..6c6dee77b795 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentsCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/DaprComponentsCollection.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.appcontainers.models; +package com.azure.resourcemanager.appcontainers.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,26 +16,26 @@ /** * Dapr Components ARM resource. */ -@Fluent +@Immutable public final class DaprComponentsCollection implements JsonSerializable { /* - * Collection of resources. + * The DaprComponent items on this page */ private List value; /* - * Link to next page of resources. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of DaprComponentsCollection class. */ - public DaprComponentsCollection() { + private DaprComponentsCollection() { } /** - * Get the value property: Collection of resources. + * Get the value property: The DaprComponent items on this page. * * @return the value value. */ @@ -45,18 +44,7 @@ public List value() { } /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the DaprComponentsCollection object itself. - */ - public DaprComponentsCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,22 +52,6 @@ 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 DaprComponentsCollection")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DaprComponentsCollection.class); - /** * {@inheritDoc} */ @@ -87,6 +59,7 @@ public void validate() { 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(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/DotNetComponentsCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/DotNetComponentsCollection.java new file mode 100644 index 000000000000..f1e8bb4bceae --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/DotNetComponentsCollection.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation.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 com.azure.resourcemanager.appcontainers.fluent.models.DotNetComponentInner; +import java.io.IOException; +import java.util.List; + +/** + * .NET Components ARM resource. + */ +@Immutable +public final class DotNetComponentsCollection implements JsonSerializable { + /* + * The DotNetComponent items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of DotNetComponentsCollection class. + */ + private DotNetComponentsCollection() { + } + + /** + * Get the value property: The DotNetComponent items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@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 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/HttpRouteConfigCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/HttpRouteConfigCollection.java similarity index 68% rename from sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteConfigCollection.java rename to sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/HttpRouteConfigCollection.java index e0258083c813..f9e73f6d9b51 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteConfigCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/HttpRouteConfigCollection.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.appcontainers.models; +package com.azure.resourcemanager.appcontainers.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,26 +16,26 @@ /** * Collection of rule based Http Route Config resources. */ -@Fluent +@Immutable public final class HttpRouteConfigCollection implements JsonSerializable { /* - * Collection of resources. + * The HttpRouteConfig items on this page */ private List value; /* - * Link to next page of resources. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of HttpRouteConfigCollection class. */ - public HttpRouteConfigCollection() { + private HttpRouteConfigCollection() { } /** - * Get the value property: Collection of resources. + * Get the value property: The HttpRouteConfig items on this page. * * @return the value value. */ @@ -45,18 +44,7 @@ public List value() { } /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the HttpRouteConfigCollection object itself. - */ - public HttpRouteConfigCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,23 +52,6 @@ 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 HttpRouteConfigCollection")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(HttpRouteConfigCollection.class); - /** * {@inheritDoc} */ @@ -88,6 +59,7 @@ public void validate() { 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(); } 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/implementation/models/JavaComponentsCollection.java similarity index 68% rename from sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JavaComponentsCollection.java rename to sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/JavaComponentsCollection.java index 78466a48e7e6..89b5c78587b0 100644 --- 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/implementation/models/JavaComponentsCollection.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.appcontainers.models; +package com.azure.resourcemanager.appcontainers.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,26 +16,26 @@ /** * Java Components ARM resource. */ -@Fluent +@Immutable public final class JavaComponentsCollection implements JsonSerializable { /* - * Collection of resources. + * The JavaComponent items on this page */ private List value; /* - * Link to next page of resources. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of JavaComponentsCollection class. */ - public JavaComponentsCollection() { + private JavaComponentsCollection() { } /** - * Get the value property: Collection of resources. + * Get the value property: The JavaComponent items on this page. * * @return the value value. */ @@ -45,18 +44,7 @@ public List 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. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,22 +52,6 @@ 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} */ @@ -87,6 +59,7 @@ public void validate() { 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(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobsCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/JobsCollection.java similarity index 67% rename from sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobsCollection.java rename to sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/JobsCollection.java index f9d07fc01f73..3377e08b39be 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobsCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/JobsCollection.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.appcontainers.models; +package com.azure.resourcemanager.appcontainers.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,26 +16,26 @@ /** * Container Apps Jobs collection ARM resource. */ -@Fluent +@Immutable public final class JobsCollection implements JsonSerializable { /* - * Collection of resources. + * The Job items on this page */ private List value; /* - * Link to next page of resources. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of JobsCollection class. */ - public JobsCollection() { + private JobsCollection() { } /** - * Get the value property: Collection of resources. + * Get the value property: The Job items on this page. * * @return the value value. */ @@ -45,18 +44,7 @@ public List value() { } /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the JobsCollection object itself. - */ - public JobsCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,22 +52,6 @@ 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 JobsCollection")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(JobsCollection.class); - /** * {@inheritDoc} */ @@ -87,6 +59,7 @@ public void validate() { 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(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/LabelHistoryCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/LabelHistoryCollection.java new file mode 100644 index 000000000000..44a9a5cefc1b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/LabelHistoryCollection.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation.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 com.azure.resourcemanager.appcontainers.fluent.models.LabelHistoryInner; +import java.io.IOException; +import java.util.List; + +/** + * Container App Label History collection ARM resource. + */ +@Immutable +public final class LabelHistoryCollection implements JsonSerializable { + /* + * The LabelHistory items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of LabelHistoryCollection class. + */ + private LabelHistoryCollection() { + } + + /** + * Get the value property: The LabelHistory items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@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 LabelHistoryCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LabelHistoryCollection 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 LabelHistoryCollection. + */ + public static LabelHistoryCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LabelHistoryCollection deserializedLabelHistoryCollection = new LabelHistoryCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> LabelHistoryInner.fromJson(reader1)); + deserializedLabelHistoryCollection.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLabelHistoryCollection.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLabelHistoryCollection; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ListUsagesResult.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/ListUsagesResult.java similarity index 59% rename from sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ListUsagesResult.java rename to sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/ListUsagesResult.java index 7bad60f10da3..542a83df58c4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ListUsagesResult.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/ListUsagesResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.appcontainers.models; +package com.azure.resourcemanager.appcontainers.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,29 +14,28 @@ import java.util.List; /** - * The ListUsagesResult model. + * Paged collection of Usage items. */ -@Fluent +@Immutable public final class ListUsagesResult implements JsonSerializable { /* - * The list of compute resource usages. + * The Usage items on this page */ private List value; /* - * The URI to fetch the next page of compute resource usage information. Call ListNext() with this to fetch the next - * page of compute resource usage information. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ListUsagesResult class. */ - public ListUsagesResult() { + private ListUsagesResult() { } /** - * Get the value property: The list of compute resource usages. + * Get the value property: The Usage items on this page. * * @return the value value. */ @@ -45,19 +44,7 @@ public List value() { } /** - * Set the value property: The list of compute resource usages. - * - * @param value the value value to set. - * @return the ListUsagesResult object itself. - */ - public ListUsagesResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page of compute resource usage information. Call ListNext() - * with this to fetch the next page of compute resource usage information. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,29 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URI to fetch the next page of compute resource usage information. Call ListNext() - * with this to fetch the next page of compute resource usage information. - * - * @param nextLink the nextLink value to set. - * @return the ListUsagesResult object itself. - */ - public ListUsagesResult 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) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -105,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ListUsagesResult 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 ListUsagesResult. */ public static ListUsagesResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/MaintenanceConfigurationCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/MaintenanceConfigurationCollection.java similarity index 72% rename from sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/MaintenanceConfigurationCollection.java rename to sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/MaintenanceConfigurationCollection.java index d6530f31c4b3..6a0a114d13f8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/MaintenanceConfigurationCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/MaintenanceConfigurationCollection.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.appcontainers.models; +package com.azure.resourcemanager.appcontainers.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +16,26 @@ /** * The response of list maintenance configuration resources. */ -@Fluent +@Immutable public final class MaintenanceConfigurationCollection implements JsonSerializable { /* - * Results of the list maintenance configuration resources. + * The MaintenanceConfigurationResource items on this page */ private List value; /* - * Link for next page of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of MaintenanceConfigurationCollection class. */ - public MaintenanceConfigurationCollection() { + private MaintenanceConfigurationCollection() { } /** - * Get the value property: Results of the list maintenance configuration resources. + * Get the value property: The MaintenanceConfigurationResource items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: Results of the list maintenance configuration resources. - * - * @param value the value value to set. - * @return the MaintenanceConfigurationCollection object itself. - */ - public MaintenanceConfigurationCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link for next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,17 +52,6 @@ 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} */ @@ -81,6 +59,7 @@ public void validate() { 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(); } @@ -90,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of MaintenanceConfigurationCollection 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 MaintenanceConfigurationCollection. */ public static MaintenanceConfigurationCollection fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/ManagedCertificateCollection.java similarity index 68% rename from sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateCollection.java rename to sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/ManagedCertificateCollection.java index 840749f6ffbb..1eb28991c5e0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/ManagedCertificateCollection.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.appcontainers.models; +package com.azure.resourcemanager.appcontainers.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,26 +16,26 @@ /** * Collection of Managed Certificates. */ -@Fluent +@Immutable public final class ManagedCertificateCollection implements JsonSerializable { /* - * Collection of resources. + * The ManagedCertificate items on this page */ private List value; /* - * Link to next page of resources. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ManagedCertificateCollection class. */ - public ManagedCertificateCollection() { + private ManagedCertificateCollection() { } /** - * Get the value property: Collection of resources. + * Get the value property: The ManagedCertificate items on this page. * * @return the value value. */ @@ -45,18 +44,7 @@ public List value() { } /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the ManagedCertificateCollection object itself. - */ - public ManagedCertificateCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,23 +52,6 @@ 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 ManagedCertificateCollection")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ManagedCertificateCollection.class); - /** * {@inheritDoc} */ @@ -88,6 +59,7 @@ public void validate() { 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(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentsCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/ManagedEnvironmentsCollection.java similarity index 68% rename from sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentsCollection.java rename to sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/ManagedEnvironmentsCollection.java index dbc70a1f66ba..60b26d76bb77 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentsCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/ManagedEnvironmentsCollection.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.appcontainers.models; +package com.azure.resourcemanager.appcontainers.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,26 +16,26 @@ /** * Collection of Environments. */ -@Fluent +@Immutable public final class ManagedEnvironmentsCollection implements JsonSerializable { /* - * Collection of resources. + * The ManagedEnvironment items on this page */ private List value; /* - * Link to next page of resources. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ManagedEnvironmentsCollection class. */ - public ManagedEnvironmentsCollection() { + private ManagedEnvironmentsCollection() { } /** - * Get the value property: Collection of resources. + * Get the value property: The ManagedEnvironment items on this page. * * @return the value value. */ @@ -45,18 +44,7 @@ public List value() { } /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the ManagedEnvironmentsCollection object itself. - */ - public ManagedEnvironmentsCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,23 +52,6 @@ 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 ManagedEnvironmentsCollection")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ManagedEnvironmentsCollection.class); - /** * {@inheritDoc} */ @@ -88,6 +59,7 @@ public void validate() { 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(); } 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/implementation/models/PrivateEndpointConnectionListResult.java similarity index 70% rename from sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateEndpointConnectionListResult.java rename to sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/PrivateEndpointConnectionListResult.java index 75d88ee3d0b9..be37c19b17e3 100644 --- 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/implementation/models/PrivateEndpointConnectionListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.appcontainers.models; +package com.azure.resourcemanager.appcontainers.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,29 +14,29 @@ import java.util.List; /** - * List of private endpoint connection associated with the specified resource. + * The response of a PrivateEndpointConnection list operation. */ -@Fluent +@Immutable public final class PrivateEndpointConnectionListResult implements JsonSerializable { /* - * Array of private endpoint connections + * The PrivateEndpointConnection items on this page */ private List value; /* - * URL to get the next set of operation list results (if there are any). + * The link to the next page of items */ private String nextLink; /** * Creates an instance of PrivateEndpointConnectionListResult class. */ - public PrivateEndpointConnectionListResult() { + private PrivateEndpointConnectionListResult() { } /** - * Get the value property: Array of private endpoint connections. + * Get the value property: The PrivateEndpointConnection items on this page. * * @return the value value. */ @@ -45,18 +45,7 @@ public List 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). + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,17 +53,6 @@ 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} */ @@ -82,6 +60,7 @@ public void validate() { 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(); } @@ -91,6 +70,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @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 IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the PrivateEndpointConnectionListResult. */ public static PrivateEndpointConnectionListResult fromJson(JsonReader jsonReader) throws IOException { 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/implementation/models/PrivateLinkResourceListResult.java similarity index 70% rename from sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PrivateLinkResourceListResult.java rename to sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/PrivateLinkResourceListResult.java index c6e6c7160c7c..c009673e3ac3 100644 --- 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/implementation/models/PrivateLinkResourceListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.appcontainers.models; +package com.azure.resourcemanager.appcontainers.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +14,28 @@ import java.util.List; /** - * A list of private link resources. + * List of private link resources for a managed environment. */ -@Fluent +@Immutable public final class PrivateLinkResourceListResult implements JsonSerializable { /* - * Array of private link resources + * The PrivateLinkResource items on this page */ private List value; /* - * URL to get the next set of operation list results (if there are any). + * The link to the next page of items */ private String nextLink; /** * Creates an instance of PrivateLinkResourceListResult class. */ - public PrivateLinkResourceListResult() { + private PrivateLinkResourceListResult() { } /** - * Get the value property: Array of private link resources. + * Get the value property: The PrivateLinkResource items on this page. * * @return the value value. */ @@ -44,18 +44,7 @@ public List 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). + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,17 +52,6 @@ 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} */ @@ -81,6 +59,7 @@ public void validate() { 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(); } @@ -90,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @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 IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the PrivateLinkResourceListResult. */ public static PrivateLinkResourceListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/RevisionCollection.java similarity index 68% rename from sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionCollection.java rename to sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/RevisionCollection.java index 92a177df8042..9514fce5b3ab 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/RevisionCollection.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.appcontainers.models; +package com.azure.resourcemanager.appcontainers.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,26 +16,26 @@ /** * Container App Revisions collection ARM resource. */ -@Fluent +@Immutable public final class RevisionCollection implements JsonSerializable { /* - * Collection of resources. + * The Revision items on this page */ private List value; /* - * Link to next page of resources. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of RevisionCollection class. */ - public RevisionCollection() { + private RevisionCollection() { } /** - * Get the value property: Collection of resources. + * Get the value property: The Revision items on this page. * * @return the value value. */ @@ -45,18 +44,7 @@ public List value() { } /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the RevisionCollection object itself. - */ - public RevisionCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,22 +52,6 @@ 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 RevisionCollection")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(RevisionCollection.class); - /** * {@inheritDoc} */ @@ -87,6 +59,7 @@ public void validate() { 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(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/SandboxGroupListResult.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/SandboxGroupListResult.java new file mode 100644 index 000000000000..c806fa463bb0 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/SandboxGroupListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation.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 com.azure.resourcemanager.appcontainers.fluent.models.SandboxGroupInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a SandboxGroup list operation. + */ +@Immutable +public final class SandboxGroupListResult implements JsonSerializable { + /* + * The SandboxGroup items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SandboxGroupListResult class. + */ + private SandboxGroupListResult() { + } + + /** + * Get the value property: The SandboxGroup items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@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 SandboxGroupListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SandboxGroupListResult 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 SandboxGroupListResult. + */ + public static SandboxGroupListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SandboxGroupListResult deserializedSandboxGroupListResult = new SandboxGroupListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> SandboxGroupInner.fromJson(reader1)); + deserializedSandboxGroupListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSandboxGroupListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSandboxGroupListResult; + }); + } +} 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/implementation/models/SessionPoolCollection.java similarity index 68% rename from sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolCollection.java rename to sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/SessionPoolCollection.java index 17bf43464241..ba1f1c06bb88 100644 --- 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/implementation/models/SessionPoolCollection.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.appcontainers.models; +package com.azure.resourcemanager.appcontainers.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,26 +16,26 @@ /** * Session pool collection Azure resource. */ -@Fluent +@Immutable public final class SessionPoolCollection implements JsonSerializable { /* - * Collection of resources. + * The SessionPool items on this page */ private List value; /* - * Link to next page of resources. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of SessionPoolCollection class. */ - public SessionPoolCollection() { + private SessionPoolCollection() { } /** - * Get the value property: Collection of resources. + * Get the value property: The SessionPool items on this page. * * @return the value value. */ @@ -45,18 +44,7 @@ public List 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. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,22 +52,6 @@ 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} */ @@ -87,6 +59,7 @@ public void validate() { 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(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControlCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/SourceControlCollection.java similarity index 68% rename from sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControlCollection.java rename to sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/SourceControlCollection.java index 62806179f538..428fa03a257b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControlCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/SourceControlCollection.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.appcontainers.models; +package com.azure.resourcemanager.appcontainers.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,26 +16,26 @@ /** * SourceControl collection ARM resource. */ -@Fluent +@Immutable public final class SourceControlCollection implements JsonSerializable { /* - * Collection of resources. + * The SourceControl items on this page */ private List value; /* - * Link to next page of resources. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of SourceControlCollection class. */ - public SourceControlCollection() { + private SourceControlCollection() { } /** - * Get the value property: Collection of resources. + * Get the value property: The SourceControl items on this page. * * @return the value value. */ @@ -45,18 +44,7 @@ public List value() { } /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the SourceControlCollection object itself. - */ - public SourceControlCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,22 +52,6 @@ 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 SourceControlCollection")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SourceControlCollection.class); - /** * {@inheritDoc} */ @@ -87,6 +59,7 @@ public void validate() { 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(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/VnetConnectionListResult.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/VnetConnectionListResult.java new file mode 100644 index 000000000000..f0f7820df57f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/VnetConnectionListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation.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 com.azure.resourcemanager.appcontainers.fluent.models.VnetConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a VnetConnection list operation. + */ +@Immutable +public final class VnetConnectionListResult implements JsonSerializable { + /* + * The VnetConnection items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of VnetConnectionListResult class. + */ + private VnetConnectionListResult() { + } + + /** + * Get the value property: The VnetConnection items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@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 VnetConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VnetConnectionListResult 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 VnetConnectionListResult. + */ + public static VnetConnectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VnetConnectionListResult deserializedVnetConnectionListResult = new VnetConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VnetConnectionInner.fromJson(reader1)); + deserializedVnetConnectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedVnetConnectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVnetConnectionListResult; + }); + } +} 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/implementation/models/WorkflowEnvelopeCollection.java similarity index 68% rename from sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowEnvelopeCollection.java rename to sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/WorkflowEnvelopeCollection.java index 0486c23645b5..ecc949ef6cc0 100644 --- 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/implementation/models/WorkflowEnvelopeCollection.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.appcontainers.models; +package com.azure.resourcemanager.appcontainers.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,26 +16,26 @@ /** * Collection of workflow information elements. */ -@Fluent +@Immutable public final class WorkflowEnvelopeCollection implements JsonSerializable { /* - * Collection of resources. + * The WorkflowEnvelope items on this page */ private List value; /* - * Link to next page of resources. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of WorkflowEnvelopeCollection class. */ - public WorkflowEnvelopeCollection() { + private WorkflowEnvelopeCollection() { } /** - * Get the value property: Collection of resources. + * Get the value property: The WorkflowEnvelope items on this page. * * @return the value value. */ @@ -45,18 +44,7 @@ public List 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. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,23 +52,6 @@ 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} */ @@ -88,6 +59,7 @@ public void validate() { 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(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkloadProfileStatesCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/WorkloadProfileStatesCollection.java similarity index 68% rename from sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkloadProfileStatesCollection.java rename to sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/WorkloadProfileStatesCollection.java index 855a4acd974c..c80dcb731146 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkloadProfileStatesCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/models/WorkloadProfileStatesCollection.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.appcontainers.models; +package com.azure.resourcemanager.appcontainers.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,26 +16,26 @@ /** * Collection of workloadProfileStates. */ -@Fluent +@Immutable public final class WorkloadProfileStatesCollection implements JsonSerializable { /* - * Collection of resources. + * The workloadProfileStates items on this page */ private List value; /* - * Link to next page of resources. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of WorkloadProfileStatesCollection class. */ - public WorkloadProfileStatesCollection() { + private WorkloadProfileStatesCollection() { } /** - * Get the value property: Collection of resources. + * Get the value property: The workloadProfileStates items on this page. * * @return the value value. */ @@ -45,18 +44,7 @@ public List value() { } /** - * Set the value property: Collection of resources. - * - * @param value the value value to set. - * @return the WorkloadProfileStatesCollection object itself. - */ - public WorkloadProfileStatesCollection withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to next page of resources. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,23 +52,6 @@ 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 WorkloadProfileStatesCollection")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(WorkloadProfileStatesCollection.class); - /** * {@inheritDoc} */ @@ -88,6 +59,7 @@ public void validate() { 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(); } 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 c4b38130b641..891946f8d61d 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 @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for ContainerAppsApiClient. - * Logic app is an extension resource on container app and the extension resource enables logic specific operations on - * the container app through the APIs listed. + * Package containing the implementations for ContainerAppsApi. + * 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/AccessMode.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AccessMode.java index 8a43d1bcc430..10cfa2851a4b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AccessMode.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AccessMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,12 +12,12 @@ */ public final class AccessMode extends ExpandableStringEnum { /** - * Static value ReadOnly for AccessMode. + * ReadOnly. */ public static final AccessMode READ_ONLY = fromString("ReadOnly"); /** - * Static value ReadWrite for AccessMode. + * ReadWrite. */ public static final AccessMode READ_WRITE = fromString("ReadWrite"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Action.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Action.java index 283d4c572536..5995482e928f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Action.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Action.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,12 +12,12 @@ */ public final class Action extends ExpandableStringEnum { /** - * Static value Allow for Action. + * Allow. */ public static final Action ALLOW = fromString("Allow"); /** - * Static value Deny for Action. + * Deny. */ public static final Action DENY = fromString("Deny"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ActiveRevisionsMode.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ActiveRevisionsMode.java index f0ca43bde5e2..d447d08c4c74 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ActiveRevisionsMode.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ActiveRevisionsMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -8,19 +8,16 @@ import java.util.Collection; /** - * ActiveRevisionsMode controls how active revisions are handled for the Container app: - * <list><item>Multiple: multiple revisions can be active.</item><item>Single: Only one revision - * can be active at a time. Revision weights can not be used in this mode. If no value if provided, this is the - * default.</item></list>. + * Controls how active revisions are handled for the Container app. */ public final class ActiveRevisionsMode extends ExpandableStringEnum { /** - * Static value Multiple for ActiveRevisionsMode. + * Multiple. */ public static final ActiveRevisionsMode MULTIPLE = fromString("Multiple"); /** - * Static value Single for ActiveRevisionsMode. + * Single. */ public static final ActiveRevisionsMode SINGLE = fromString("Single"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Affinity.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Affinity.java index 795068245527..840db82a66b5 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Affinity.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Affinity.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,12 +12,12 @@ */ public final class Affinity extends ExpandableStringEnum { /** - * Static value sticky for Affinity. + * sticky. */ public static final Affinity STICKY = fromString("sticky"); /** - * Static value none for Affinity. + * none. */ public static final Affinity NONE = fromString("none"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AllowedAudiencesValidation.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AllowedAudiencesValidation.java index a62eb3cfbcc7..b06638dc17f9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AllowedAudiencesValidation.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AllowedAudiencesValidation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -50,14 +50,6 @@ public AllowedAudiencesValidation withAllowedAudiences(List allowedAudie return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AllowedPrincipals.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AllowedPrincipals.java index a035f5409891..a82ae8e2e7ef 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AllowedPrincipals.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AllowedPrincipals.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -73,14 +73,6 @@ public AllowedPrincipals withIdentities(List identities) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 000000000000..f37d31f19abe --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppInsightsConfiguration.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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/AppLogsConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppLogsConfiguration.java index be296d6dc3b2..3b48b50a7726 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppLogsConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppLogsConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -74,17 +74,6 @@ public AppLogsConfiguration withLogAnalyticsConfiguration(LogAnalyticsConfigurat return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (logAnalyticsConfiguration() != null) { - logAnalyticsConfiguration().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppProtocol.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppProtocol.java index a6a614a5d9cd..00b6085fc44f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppProtocol.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppProtocol.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,12 +12,12 @@ */ public final class AppProtocol extends ExpandableStringEnum { /** - * Static value http for AppProtocol. + * http. */ public static final AppProtocol HTTP = fromString("http"); /** - * Static value grpc for AppProtocol. + * grpc. */ public static final AppProtocol GRPC = fromString("grpc"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppRegistration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppRegistration.java index dfa87e62fb68..a3e232af318c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppRegistration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppRegistration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -72,14 +72,6 @@ public AppRegistration withAppSecretSettingName(String appSecretSettingName) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Apple.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Apple.java index b9068954f4ac..ce52ff83f806 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Apple.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Apple.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -100,20 +100,6 @@ public Apple withLogin(LoginScopes login) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (registration() != null) { - registration().validate(); - } - if (login() != null) { - login().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppleRegistration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppleRegistration.java index b4a6a7f603bc..7883d8f9f813 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppleRegistration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppleRegistration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -72,14 +72,6 @@ public AppleRegistration withClientSecretSettingName(String clientSecretSettingN return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Applicability.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Applicability.java index 6079b7a34e5d..5c1b5f538ba0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Applicability.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Applicability.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,12 +12,12 @@ */ public final class Applicability extends ExpandableStringEnum { /** - * Static value LocationDefault for Applicability. + * LocationDefault. */ public static final Applicability LOCATION_DEFAULT = fromString("LocationDefault"); /** - * Static value Custom for Applicability. + * Custom. */ public static final Applicability CUSTOM = fromString("Custom"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AuthConfig.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AuthConfig.java index 0c8e2faee1f9..21b267300e6a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AuthConfig.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AuthConfig.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AuthPlatform.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AuthPlatform.java index f4dcd11cb443..cbb971a9ffbf 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AuthPlatform.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AuthPlatform.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -83,14 +83,6 @@ public AuthPlatform withRuntimeVersion(String runtimeVersion) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableEnvironmentMode.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableEnvironmentMode.java new file mode 100644 index 000000000000..b8b5d3e4cb38 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableEnvironmentMode.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appcontainers.fluent.models.AvailableEnvironmentModeInner; + +/** + * An immutable client-side representation of AvailableEnvironmentMode. + */ +public interface AvailableEnvironmentMode { + /** + * 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 Azure region in which the environment mode is available. + * + * @return the location value. + */ + String location(); + + /** + * Gets the properties property: The environment mode details. + * + * @return the properties value. + */ + AvailableEnvironmentModeProperties 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.AvailableEnvironmentModeInner object. + * + * @return the inner object. + */ + AvailableEnvironmentModeInner innerModel(); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableEnvironmentModeProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableEnvironmentModeProperties.java new file mode 100644 index 000000000000..8177143c8d6e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableEnvironmentModeProperties.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +/** + * Details that describe an available environment mode. + */ +@Immutable +public final class AvailableEnvironmentModeProperties implements JsonSerializable { + /* + * The display name of the environment mode. + */ + private String displayName; + + /* + * The description of the environment mode. + */ + private String description; + + /** + * Creates an instance of AvailableEnvironmentModeProperties class. + */ + private AvailableEnvironmentModeProperties() { + } + + /** + * Get the displayName property: The display name of the environment mode. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the description property: The description of the environment mode. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailableEnvironmentModeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableEnvironmentModeProperties 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 AvailableEnvironmentModeProperties. + */ + public static AvailableEnvironmentModeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailableEnvironmentModeProperties deserializedAvailableEnvironmentModeProperties + = new AvailableEnvironmentModeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("displayName".equals(fieldName)) { + deserializedAvailableEnvironmentModeProperties.displayName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedAvailableEnvironmentModeProperties.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableEnvironmentModeProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableEnvironmentModes.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableEnvironmentModes.java new file mode 100644 index 000000000000..658d5b8cb9e8 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableEnvironmentModes.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 AvailableEnvironmentModes. + */ +public interface AvailableEnvironmentModes { + /** + * Get available environment modes by location. + * + * Gets the environment modes available to a subscription in a location. + * + * @param location The name of the Azure region. + * @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 available environment modes by location. + * + * Gets the environment modes available to a subscription in a location as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String location); + + /** + * Get available environment modes by location. + * + * Gets the environment modes available to a subscription in a location. + * + * @param location The name of the Azure region. + * @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 available environment modes by location. + * + * Gets the environment modes available to a subscription in a location as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String location, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfile.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfile.java index 453036211ae0..e9302b301975 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfile.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfile.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfileProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfileProperties.java index 74b6db89dc2a..5b4db57247b2 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfileProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfileProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Revision resource specific properties. */ -@Fluent +@Immutable public final class AvailableWorkloadProfileProperties implements JsonSerializable { /* * Used to categorize workload profiles. @@ -49,7 +49,7 @@ public final class AvailableWorkloadProfileProperties implements JsonSerializabl /** * Creates an instance of AvailableWorkloadProfileProperties class. */ - public AvailableWorkloadProfileProperties() { + private AvailableWorkloadProfileProperties() { } /** @@ -61,17 +61,6 @@ public String category() { return this.category; } - /** - * Set the category property: Used to categorize workload profiles. - * - * @param category the category value to set. - * @return the AvailableWorkloadProfileProperties object itself. - */ - public AvailableWorkloadProfileProperties withCategory(String category) { - this.category = category; - return this; - } - /** * Get the applicability property: indicates whether the profile is default for the location. * @@ -81,17 +70,6 @@ public Applicability applicability() { return this.applicability; } - /** - * Set the applicability property: indicates whether the profile is default for the location. - * - * @param applicability the applicability value to set. - * @return the AvailableWorkloadProfileProperties object itself. - */ - public AvailableWorkloadProfileProperties withApplicability(Applicability applicability) { - this.applicability = applicability; - return this; - } - /** * Get the cores property: Number of cores in CPU. * @@ -101,17 +79,6 @@ public Integer cores() { return this.cores; } - /** - * Set the cores property: Number of cores in CPU. - * - * @param cores the cores value to set. - * @return the AvailableWorkloadProfileProperties object itself. - */ - public AvailableWorkloadProfileProperties withCores(Integer cores) { - this.cores = cores; - return this; - } - /** * Get the memoryGiB property: Memory in GiB. * @@ -121,17 +88,6 @@ public Integer memoryGiB() { return this.memoryGiB; } - /** - * Set the memoryGiB property: Memory in GiB. - * - * @param memoryGiB the memoryGiB value to set. - * @return the AvailableWorkloadProfileProperties object itself. - */ - public AvailableWorkloadProfileProperties withMemoryGiB(Integer memoryGiB) { - this.memoryGiB = memoryGiB; - return this; - } - /** * Get the gpus property: Number of GPUs. * @@ -141,17 +97,6 @@ public Integer gpus() { return this.gpus; } - /** - * Set the gpus property: Number of GPUs. - * - * @param gpus the gpus value to set. - * @return the AvailableWorkloadProfileProperties object itself. - */ - public AvailableWorkloadProfileProperties withGpus(Integer gpus) { - this.gpus = gpus; - return this; - } - /** * Get the displayName property: The everyday name of the workload profile. * @@ -161,25 +106,6 @@ public String displayName() { return this.displayName; } - /** - * Set the displayName property: The everyday name of the workload profile. - * - * @param displayName the displayName value to set. - * @return the AvailableWorkloadProfileProperties object itself. - */ - public AvailableWorkloadProfileProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfiles.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfiles.java index e31a39b02d69..388d7ddf87cb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfiles.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfiles.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -16,11 +16,13 @@ public interface AvailableWorkloadProfiles { * * Get all available workload profiles for a location. * - * @param location The name of Azure region. + * @param location The name of the Azure region. * @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 all available workload profiles for a location as paginated response with {@link PagedIterable}. + * @return available workload profiles by location. + * + * Get all available workload profiles for a location as paginated response with {@link PagedIterable}. */ PagedIterable get(String location); @@ -29,12 +31,14 @@ public interface AvailableWorkloadProfiles { * * Get all available workload profiles for a location. * - * @param location The name of Azure region. + * @param location The name of the Azure region. * @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 all available workload profiles for a location as paginated response with {@link PagedIterable}. + * @return available workload profiles by location. + * + * Get all available workload profiles for a location as paginated response with {@link PagedIterable}. */ PagedIterable get(String location, Context context); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectory.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectory.java index f25df813cf99..afab73103801 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectory.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectory.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -158,23 +158,6 @@ public AzureActiveDirectory withIsAutoProvisioned(Boolean isAutoProvisioned) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (registration() != null) { - registration().validate(); - } - if (login() != null) { - login().validate(); - } - if (validation() != null) { - validation().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryLogin.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryLogin.java index 1e1ba1db43d4..c4871bdfd99c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryLogin.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryLogin.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -79,14 +79,6 @@ public AzureActiveDirectoryLogin withDisableWwwAuthenticate(Boolean disableWwwAu return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryRegistration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryRegistration.java index 22e06521cfb9..bb37039ddafb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryRegistration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryRegistration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -218,14 +218,6 @@ public AzureActiveDirectoryRegistration withClientSecretCertificateIssuer(String return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryValidation.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryValidation.java index 1bc671179aeb..3ec58b4d561d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryValidation.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureActiveDirectoryValidation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -103,20 +103,6 @@ public DefaultAuthorizationPolicy defaultAuthorizationPolicy() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (jwtClaimChecks() != null) { - jwtClaimChecks().validate(); - } - if (defaultAuthorizationPolicy() != null) { - defaultAuthorizationPolicy().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureCredentials.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureCredentials.java index 77df7e871075..3b63c961ed0c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureCredentials.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureCredentials.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -147,14 +147,6 @@ public AzureCredentials withSubscriptionId(String subscriptionId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureFileProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureFileProperties.java index 7f1c85c2803e..52795c53f1f4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureFileProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureFileProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -147,17 +147,6 @@ public AzureFileProperties withShareName(String shareName) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (accountKeyVaultProperties() != null) { - accountKeyVaultProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureStaticWebApps.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureStaticWebApps.java index eab53181b19d..54eacf96b687 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureStaticWebApps.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureStaticWebApps.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -75,17 +75,6 @@ public AzureStaticWebApps withRegistration(AzureStaticWebAppsRegistration regist return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (registration() != null) { - registration().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureStaticWebAppsRegistration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureStaticWebAppsRegistration.java index b73438252fbd..4dba68629e74 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureStaticWebAppsRegistration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AzureStaticWebAppsRegistration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -47,14 +47,6 @@ public AzureStaticWebAppsRegistration withClientId(String clientId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 383b0f176233..875ab9dac2d8 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -198,23 +198,6 @@ public BaseContainer withVolumeMounts(List volumeMounts) { 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(); - } - if (volumeMounts() != null) { - volumeMounts().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ 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 5478645f34ec..062ce571cd08 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -15,7 +15,7 @@ /** * Billing meter. */ -@Fluent +@Immutable public final class BillingMeter extends ProxyResource { /* * Region for the billing meter. @@ -50,7 +50,7 @@ public final class BillingMeter extends ProxyResource { /** * Creates an instance of BillingMeter class. */ - public BillingMeter() { + private BillingMeter() { } /** @@ -62,17 +62,6 @@ public String location() { return this.location; } - /** - * Set the location property: Region for the billing meter. - * - * @param location the location value to set. - * @return the BillingMeter object itself. - */ - public BillingMeter withLocation(String location) { - this.location = location; - return this; - } - /** * Get the properties property: Revision resource specific properties. * @@ -82,17 +71,6 @@ public BillingMeterProperties properties() { return this.properties; } - /** - * Set the properties property: Revision resource specific properties. - * - * @param properties the properties value to set. - * @return the BillingMeter object itself. - */ - public BillingMeter withProperties(BillingMeterProperties properties) { - this.properties = properties; - return this; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -132,17 +110,6 @@ 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} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeterCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeterCollection.java index 7a5c5cf99169..8e1e2ba90081 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeterCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeterCollection.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeterProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeterProperties.java index 054d2c687414..a9939d315846 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeterProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeterProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Revision resource specific properties. */ -@Fluent +@Immutable public final class BillingMeterProperties implements JsonSerializable { /* * Used to categorize billing meters. @@ -34,7 +34,7 @@ public final class BillingMeterProperties implements JsonSerializable getWithResponse(String location, Context context); @@ -31,12 +33,14 @@ public interface BillingMeters { * * Get all billingMeters for a location. * - * @param location The name of Azure region. + * @param location The name of the Azure region. * @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 all billingMeters for a location. + * @return billing meters by location. + * + * Get all billingMeters for a location. */ BillingMeterCollection get(String location); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BindingType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BindingType.java index 4e77c2d80973..7140e99766b0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BindingType.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BindingType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,17 +12,17 @@ */ public final class BindingType extends ExpandableStringEnum { /** - * Static value Disabled for BindingType. + * Disabled. */ public static final BindingType DISABLED = fromString("Disabled"); /** - * Static value SniEnabled for BindingType. + * SniEnabled. */ public static final BindingType SNI_ENABLED = fromString("SniEnabled"); /** - * Static value Auto for BindingType. + * Auto. */ public static final BindingType AUTO = fromString("Auto"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BlobStorageTokenStore.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BlobStorageTokenStore.java index 9f0c27bd913c..fdfc0f249653 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BlobStorageTokenStore.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BlobStorageTokenStore.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -22,6 +21,21 @@ public final class BlobStorageTokenStore implements JsonSerializable tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 05158032e8db..88031e97d2ac 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -241,17 +241,6 @@ public String publicKeyHash() { return this.publicKeyHash; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (certificateKeyVaultProperties() != null) { - certificateKeyVaultProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateProvisioningState.java index d15085680060..184baf9885fc 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,32 +12,32 @@ */ public final class CertificateProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for CertificateProvisioningState. + * Succeeded. */ public static final CertificateProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for CertificateProvisioningState. + * Failed. */ public static final CertificateProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for CertificateProvisioningState. + * Canceled. */ public static final CertificateProvisioningState CANCELED = fromString("Canceled"); /** - * Static value DeleteFailed for CertificateProvisioningState. + * DeleteFailed. */ public static final CertificateProvisioningState DELETE_FAILED = fromString("DeleteFailed"); /** - * Static value Pending for CertificateProvisioningState. + * Pending. */ public static final CertificateProvisioningState PENDING = fromString("Pending"); /** - * Static value Deleting for CertificateProvisioningState. + * Deleting. */ public static final CertificateProvisioningState DELETING = fromString("Deleting"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Certificates.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Certificates.java index 8f33ff0d5d1c..3c658cc7aa19 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Certificates.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Certificates.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -14,93 +14,98 @@ */ public interface Certificates { /** - * Get the Certificates in a given managed environment. + * Get the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. + * @param certificateName Name of the Certificate. + * @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 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 Certificates in a given managed environment as paginated response with {@link PagedIterable}. + * @return the specified Certificate along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String environmentName); + Response getWithResponse(String resourceGroupName, String environmentName, String certificateName, + Context context); /** - * Get the Certificates in a given managed environment. + * Get the specified Certificate. * * @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. + * @param certificateName Name of the Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. + * @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 Certificates in a given managed environment as paginated response with {@link PagedIterable}. + * @return the specified Certificate. */ - PagedIterable list(String resourceGroupName, String environmentName, Context context); + Certificate get(String resourceGroupName, String environmentName, String certificateName); /** - * Get the specified Certificate. + * Create or Update a Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Certificate to be created or updated. * @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 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 specified Certificate along with {@link Response}. + * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with + * {@link Response}. */ - Response getWithResponse(String resourceGroupName, String environmentName, String certificateName, - Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, + String certificateName, CertificateInner certificateEnvelope, Context context); /** - * Get the specified Certificate. + * Create or Update a Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. + * @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 specified Certificate. + * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment. */ - Certificate get(String resourceGroupName, String environmentName, String certificateName); + Certificate createOrUpdate(String resourceGroupName, String environmentName, String certificateName); /** - * Create or Update a Certificate. + * Update properties of a certificate + * + * Patches a certificate. Currently only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. - * @param certificateEnvelope Certificate to be created or updated. + * @param certificateEnvelope Properties of a certificate that need to be updated. * @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 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 certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with * {@link Response}. */ - Response createOrUpdateWithResponse(String resourceGroupName, String environmentName, - String certificateName, CertificateInner certificateEnvelope, Context context); + Response updateWithResponse(String resourceGroupName, String environmentName, String certificateName, + CertificatePatch certificateEnvelope, Context context); /** - * Create or Update a Certificate. + * Update properties of a certificate + * + * Patches a certificate. Currently only patching of tags is supported. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Properties of a certificate that need to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. + * @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 certificate used for Custom Domain bindings of Container Apps in a Managed Environment. */ - Certificate createOrUpdate(String resourceGroupName, String environmentName, String certificateName); + Certificate update(String resourceGroupName, String environmentName, String certificateName, + CertificatePatch certificateEnvelope); /** * Deletes the specified Certificate. @@ -110,8 +115,7 @@ Response createOrUpdateWithResponse(String resourceGroupName, Strin * @param certificateName Name of the Certificate. * @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 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 Response}. */ @@ -125,47 +129,33 @@ Response deleteWithResponse(String resourceGroupName, String environmentNa * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. + * @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 certificateName); /** - * Update properties of a certificate - * - * Patches a certificate. Currently only patching of tags is supported. + * Get the Certificates in 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 certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need to be updated. - * @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 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 certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with - * {@link Response}. + * @return the Certificates in a given managed environment as paginated response with {@link PagedIterable}. */ - Response updateWithResponse(String resourceGroupName, String environmentName, String certificateName, - CertificatePatch certificateEnvelope, Context context); + PagedIterable list(String resourceGroupName, String environmentName); /** - * Update properties of a certificate - * - * Patches a certificate. Currently only patching of tags is supported. + * Get the Certificates in 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 certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need to be updated. + * @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 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 certificate used for Custom Domain bindings of Container Apps in a Managed Environment. + * @return the Certificates in a given managed environment as paginated response with {@link PagedIterable}. */ - Certificate update(String resourceGroupName, String environmentName, String certificateName, - CertificatePatch certificateEnvelope); + PagedIterable list(String resourceGroupName, String environmentName, Context context); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckMigrationEligibilityRequest.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckMigrationEligibilityRequest.java new file mode 100644 index 000000000000..320778b22feb --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckMigrationEligibilityRequest.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +/** + * Request body for checking whether a managed environment can migrate to a target mode. + */ +@Fluent +public final class CheckMigrationEligibilityRequest implements JsonSerializable { + /* + * The target environment mode to check migration eligibility against. + */ + private String targetMode; + + /** + * Creates an instance of CheckMigrationEligibilityRequest class. + */ + public CheckMigrationEligibilityRequest() { + } + + /** + * Get the targetMode property: The target environment mode to check migration eligibility against. + * + * @return the targetMode value. + */ + public String targetMode() { + return this.targetMode; + } + + /** + * Set the targetMode property: The target environment mode to check migration eligibility against. + * + * @param targetMode the targetMode value to set. + * @return the CheckMigrationEligibilityRequest object itself. + */ + public CheckMigrationEligibilityRequest withTargetMode(String targetMode) { + this.targetMode = targetMode; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetMode", this.targetMode); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckMigrationEligibilityRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckMigrationEligibilityRequest 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 CheckMigrationEligibilityRequest. + */ + public static CheckMigrationEligibilityRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckMigrationEligibilityRequest deserializedCheckMigrationEligibilityRequest + = new CheckMigrationEligibilityRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetMode".equals(fieldName)) { + deserializedCheckMigrationEligibilityRequest.targetMode = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckMigrationEligibilityRequest; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckMigrationEligibilityResponse.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckMigrationEligibilityResponse.java new file mode 100644 index 000000000000..edd04b21e7c9 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckMigrationEligibilityResponse.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.resourcemanager.appcontainers.fluent.models.CheckMigrationEligibilityResponseInner; +import java.util.List; + +/** + * An immutable client-side representation of CheckMigrationEligibilityResponse. + */ +public interface CheckMigrationEligibilityResponse { + /** + * Gets the isEligible property: Whether the managed environment can migrate to the requested target mode. + * + * @return the isEligible value. + */ + boolean isEligible(); + + /** + * Gets the environmentName property: The name of the managed environment that was checked. + * + * @return the environmentName value. + */ + String environmentName(); + + /** + * Gets the currentMode property: The current mode of the managed environment. + * + * @return the currentMode value. + */ + String currentMode(); + + /** + * Gets the targetMode property: The requested target mode. + * + * @return the targetMode value. + */ + String targetMode(); + + /** + * Gets the failureReasons property: The blocking reasons preventing migration. Empty when the managed environment + * is eligible. + * + * @return the failureReasons value. + */ + List failureReasons(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.CheckMigrationEligibilityResponseInner + * object. + * + * @return the inner object. + */ + CheckMigrationEligibilityResponseInner innerModel(); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityReason.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityReason.java index 186892302726..51cdbd7ce9b6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityReason.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityReason.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -8,16 +8,16 @@ import java.util.Collection; /** - * The reason why the given name is not available. + * Possible reasons for a name not being available. */ public final class CheckNameAvailabilityReason extends ExpandableStringEnum { /** - * Static value Invalid for CheckNameAvailabilityReason. + * Name is invalid. */ public static final CheckNameAvailabilityReason INVALID = fromString("Invalid"); /** - * Static value AlreadyExists for CheckNameAvailabilityReason. + * Name already exists. */ public static final CheckNameAvailabilityReason ALREADY_EXISTS = fromString("AlreadyExists"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityRequest.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityRequest.java index d964c0cf48f8..7765a8553d36 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityRequest.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityRequest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -72,14 +72,6 @@ public CheckNameAvailabilityRequest withType(String type) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityResponse.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityResponse.java index 306acb1e1ff8..ca3f029217af 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityResponse.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityResponse.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -25,7 +25,7 @@ public interface CheckNameAvailabilityResponse { CheckNameAvailabilityReason reason(); /** - * Gets the message property: Detailed reason why the given name is available. + * Gets the message property: Detailed reason why the given name is not available. * * @return the message value. */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ClientCredentialMethod.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ClientCredentialMethod.java index 1bfcc8315252..32b5a4064a4b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ClientCredentialMethod.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ClientCredentialMethod.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; /** - * The method that should be used to authenticate the user. + * Defines values for ClientCredentialMethod. */ public enum ClientCredentialMethod { /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ClientRegistration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ClientRegistration.java index 67660d403a50..1a59ae55ad96 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ClientRegistration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ClientRegistration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -72,14 +72,6 @@ public ClientRegistration withClientSecretSettingName(String clientSecretSetting return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 06b863bd1e9a..fb92e5ffd2df 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -23,9 +23,7 @@ public final class Configuration implements JsonSerializable { private List secrets; /* - * ActiveRevisionsMode controls how active revisions are handled for the Container app: - * Multiple: multiple revisions can be active.Single: Only one revision can be active at a - * time. Revision weights can not be used in this mode. If no value if provided, this is the default. + * Controls how active revisions are handled for the Container app. */ private ActiveRevisionsMode activeRevisionsMode; @@ -92,11 +90,7 @@ public Configuration withSecrets(List secrets) { } /** - * Get the activeRevisionsMode property: ActiveRevisionsMode controls how active revisions are handled for the - * Container app: - * <list><item>Multiple: multiple revisions can be active.</item><item>Single: Only one - * revision can be active at a time. Revision weights can not be used in this mode. If no value if provided, this is - * the default.</item></list>. + * Get the activeRevisionsMode property: Controls how active revisions are handled for the Container app. * * @return the activeRevisionsMode value. */ @@ -105,11 +99,7 @@ public ActiveRevisionsMode activeRevisionsMode() { } /** - * Set the activeRevisionsMode property: ActiveRevisionsMode controls how active revisions are handled for the - * Container app: - * <list><item>Multiple: multiple revisions can be active.</item><item>Single: Only one - * revision can be active at a time. Revision weights can not be used in this mode. If no value if provided, this is - * the default.</item></list>. + * Set the activeRevisionsMode property: Controls how active revisions are handled for the Container app. * * @param activeRevisionsMode the activeRevisionsMode value to set. * @return the Configuration object itself. @@ -263,35 +253,6 @@ public Configuration withIdentitySettings(List identitySetting return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (secrets() != null) { - secrets().forEach(e -> e.validate()); - } - if (ingress() != null) { - ingress().validate(); - } - if (registries() != null) { - registries().forEach(e -> e.validate()); - } - if (dapr() != null) { - dapr().validate(); - } - if (runtime() != null) { - runtime().validate(); - } - if (service() != null) { - service().validate(); - } - if (identitySettings() != null) { - identitySettings().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironment.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironment.java index 857ac1c767f0..3c7287ec685f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironment.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentPatchResource.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentPatchResource.java index f06896d67cfe..cc74c72504e7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentPatchResource.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentPatchResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -31,15 +31,6 @@ public ConnectedEnvironmentPatchResource withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentProvisioningState.java index d9ca5cac6b16..59d2da6b8748 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -13,45 +13,45 @@ public final class ConnectedEnvironmentProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for ConnectedEnvironmentProvisioningState. + * Succeeded. */ public static final ConnectedEnvironmentProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for ConnectedEnvironmentProvisioningState. + * Failed. */ public static final ConnectedEnvironmentProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for ConnectedEnvironmentProvisioningState. + * Canceled. */ public static final ConnectedEnvironmentProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Waiting for ConnectedEnvironmentProvisioningState. + * Waiting. */ public static final ConnectedEnvironmentProvisioningState WAITING = fromString("Waiting"); /** - * Static value InitializationInProgress for ConnectedEnvironmentProvisioningState. + * InitializationInProgress. */ public static final ConnectedEnvironmentProvisioningState INITIALIZATION_IN_PROGRESS = fromString("InitializationInProgress"); /** - * Static value InfrastructureSetupInProgress for ConnectedEnvironmentProvisioningState. + * InfrastructureSetupInProgress. */ public static final ConnectedEnvironmentProvisioningState INFRASTRUCTURE_SETUP_IN_PROGRESS = fromString("InfrastructureSetupInProgress"); /** - * Static value InfrastructureSetupComplete for ConnectedEnvironmentProvisioningState. + * InfrastructureSetupComplete. */ public static final ConnectedEnvironmentProvisioningState INFRASTRUCTURE_SETUP_COMPLETE = fromString("InfrastructureSetupComplete"); /** - * Static value ScheduledForDelete for ConnectedEnvironmentProvisioningState. + * ScheduledForDelete. */ public static final ConnectedEnvironmentProvisioningState SCHEDULED_FOR_DELETE = fromString("ScheduledForDelete"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentStorage.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentStorage.java index 861b0c8c0339..73528dd8de82 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentStorage.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentStorage.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -86,7 +86,7 @@ interface WithParentResource { * Specifies resourceGroupName, connectedEnvironmentName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @return the next definition stage. */ WithCreate withExistingConnectedEnvironment(String resourceGroupName, String connectedEnvironmentName); 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 21209948296d..a18daf7f4853 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -17,11 +17,6 @@ @Fluent public final class ConnectedEnvironmentStorageProperties implements JsonSerializable { - /* - * Azure file properties - */ - private AzureFileProperties azureFile; - /* * Provisioning state of the storage. */ @@ -32,30 +27,15 @@ public final class ConnectedEnvironmentStorageProperties */ private String deploymentErrors; - /** - * Creates an instance of ConnectedEnvironmentStorageProperties class. - */ - public ConnectedEnvironmentStorageProperties() { - } - - /** - * Get the azureFile property: Azure file properties. - * - * @return the azureFile value. + /* + * Azure file properties */ - public AzureFileProperties azureFile() { - return this.azureFile; - } + private AzureFileProperties azureFile; /** - * Set the azureFile property: Azure file properties. - * - * @param azureFile the azureFile value to set. - * @return the ConnectedEnvironmentStorageProperties object itself. + * Creates an instance of ConnectedEnvironmentStorageProperties class. */ - public ConnectedEnvironmentStorageProperties withAzureFile(AzureFileProperties azureFile) { - this.azureFile = azureFile; - return this; + public ConnectedEnvironmentStorageProperties() { } /** @@ -77,14 +57,23 @@ public String deploymentErrors() { } /** - * Validates the instance. + * Get the azureFile property: Azure file properties. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the azureFile value. */ - public void validate() { - if (azureFile() != null) { - azureFile().validate(); - } + public AzureFileProperties azureFile() { + return this.azureFile; + } + + /** + * Set the azureFile property: Azure file properties. + * + * @param azureFile the azureFile value to set. + * @return the ConnectedEnvironmentStorageProperties object itself. + */ + public ConnectedEnvironmentStorageProperties withAzureFile(AzureFileProperties azureFile) { + this.azureFile = azureFile; + return this; } /** @@ -113,13 +102,13 @@ public static ConnectedEnvironmentStorageProperties fromJson(JsonReader jsonRead String fieldName = reader.getFieldName(); reader.nextToken(); - if ("azureFile".equals(fieldName)) { - deserializedConnectedEnvironmentStorageProperties.azureFile = AzureFileProperties.fromJson(reader); - } else if ("provisioningState".equals(fieldName)) { + if ("provisioningState".equals(fieldName)) { deserializedConnectedEnvironmentStorageProperties.provisioningState = ConnectedEnvironmentStorageProvisioningState.fromString(reader.getString()); } else if ("deploymentErrors".equals(fieldName)) { deserializedConnectedEnvironmentStorageProperties.deploymentErrors = reader.getString(); + } else if ("azureFile".equals(fieldName)) { + deserializedConnectedEnvironmentStorageProperties.azureFile = AzureFileProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentStorageProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentStorageProvisioningState.java index aeb44cb1f187..89b5caca02ef 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentStorageProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentStorageProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -13,27 +13,27 @@ public final class ConnectedEnvironmentStorageProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for ConnectedEnvironmentStorageProvisioningState. + * Succeeded. */ public static final ConnectedEnvironmentStorageProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for ConnectedEnvironmentStorageProvisioningState. + * Failed. */ public static final ConnectedEnvironmentStorageProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for ConnectedEnvironmentStorageProvisioningState. + * Canceled. */ public static final ConnectedEnvironmentStorageProvisioningState CANCELED = fromString("Canceled"); /** - * Static value InProgress for ConnectedEnvironmentStorageProvisioningState. + * InProgress. */ public static final ConnectedEnvironmentStorageProvisioningState IN_PROGRESS = fromString("InProgress"); /** - * Static value Deleting for ConnectedEnvironmentStorageProvisioningState. + * Deleting. */ public static final ConnectedEnvironmentStorageProvisioningState DELETING = fromString("Deleting"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentStoragesCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentStoragesCollection.java index 4493ee7e11dc..78e6c218b568 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentStoragesCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentStoragesCollection.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironments.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironments.java index de84f78792a7..ed59d4d7c004 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironments.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironments.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -13,104 +13,104 @@ */ public interface ConnectedEnvironments { /** - * Get all connectedEnvironments for a subscription. + * Get the properties of an connectedEnvironment. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connectedEnvironment. + * @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 all connectedEnvironments for a subscription as paginated response with {@link PagedIterable}. + * @return the properties of an connectedEnvironment along with {@link Response}. */ - PagedIterable list(); + Response getByResourceGroupWithResponse(String resourceGroupName, + String connectedEnvironmentName, Context context); /** - * Get all connectedEnvironments for a subscription. + * Get the properties of an connectedEnvironment. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @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 all connectedEnvironments for a subscription as paginated response with {@link PagedIterable}. + * @return the properties of an connectedEnvironment. */ - PagedIterable list(Context context); + ConnectedEnvironment getByResourceGroup(String resourceGroupName, String connectedEnvironmentName); /** - * Get all connectedEnvironments in a resource group. + * Delete an connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @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 all connectedEnvironments in a resource group as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + void deleteByResourceGroup(String resourceGroupName, String connectedEnvironmentName); /** - * Get all connectedEnvironments in a resource group. + * Delete an connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @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 all connectedEnvironments in a resource group as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + void delete(String resourceGroupName, String connectedEnvironmentName, Context context); /** - * Get the properties of an connectedEnvironment. + * Get all connectedEnvironments in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connectedEnvironment. - * @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 an connectedEnvironment along with {@link Response}. + * @return all connectedEnvironments in a resource group as paginated response with {@link PagedIterable}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, - String connectedEnvironmentName, Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Get the properties of an connectedEnvironment. + * Get all connectedEnvironments in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connectedEnvironment. + * @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 an connectedEnvironment. + * @return all connectedEnvironments in a resource group as paginated response with {@link PagedIterable}. */ - ConnectedEnvironment getByResourceGroup(String resourceGroupName, String connectedEnvironmentName); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Delete an connectedEnvironment. + * Get all connectedEnvironments for a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connectedEnvironment. - * @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 all connectedEnvironments for a subscription as paginated response with {@link PagedIterable}. */ - void deleteByResourceGroup(String resourceGroupName, String connectedEnvironmentName); + PagedIterable list(); /** - * Delete an connectedEnvironment. + * Get all connectedEnvironments for a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connectedEnvironment. * @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 all connectedEnvironments for a subscription as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String connectedEnvironmentName, Context context); + PagedIterable list(Context context); /** * Checks the resource connectedEnvironmentName availability. @@ -118,7 +118,7 @@ Response getByResourceGroupWithResponse(String resourceGro * Checks if resource connectedEnvironmentName is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Managed Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param checkNameAvailabilityRequest The check connectedEnvironmentName availability request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -136,7 +136,7 @@ Response checkNameAvailabilityWithResponse(String * Checks if resource connectedEnvironmentName is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Managed Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param checkNameAvailabilityRequest The check connectedEnvironmentName availability request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentsCertificates.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentsCertificates.java index 05c0fb78146c..ad0ea79c661b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentsCertificates.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentsCertificates.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -13,82 +13,82 @@ */ public interface ConnectedEnvironmentsCertificates { /** - * Get the Certificates in a given connected environment. + * Get the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. + * @param certificateName Name of the Certificate. + * @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 Certificates in a given connected environment as paginated response with {@link PagedIterable}. + * @return the specified Certificate along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String connectedEnvironmentName); + Response getWithResponse(String resourceGroupName, String connectedEnvironmentName, + String certificateName, Context context); /** - * Get the Certificates in a given connected environment. + * Get the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. - * @param context The context to associate with this operation. + * @param certificateName Name of the Certificate. * @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 Certificates in a given connected environment as paginated response with {@link PagedIterable}. + * @return the specified Certificate. */ - PagedIterable list(String resourceGroupName, String connectedEnvironmentName, Context context); + Certificate get(String resourceGroupName, String connectedEnvironmentName, String certificateName); /** - * Get the specified Certificate. + * Deletes the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. - * @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 specified Certificate along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String connectedEnvironmentName, - String certificateName, Context context); + void delete(String resourceGroupName, String connectedEnvironmentName, String certificateName); /** - * Get the specified Certificate. + * Deletes the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. + * @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 specified Certificate. */ - Certificate get(String resourceGroupName, String connectedEnvironmentName, String certificateName); + void delete(String resourceGroupName, String connectedEnvironmentName, String certificateName, Context context); /** - * Deletes the specified Certificate. + * Get the Certificates in a given connected environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. - * @param certificateName Name of the Certificate. * @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 Certificates in a given connected environment as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String connectedEnvironmentName, String certificateName); + PagedIterable list(String resourceGroupName, String connectedEnvironmentName); /** - * Deletes the specified Certificate. + * Get the Certificates in a given connected environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. - * @param certificateName Name of the Certificate. * @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 Certificates in a given connected environment as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String connectedEnvironmentName, String certificateName, Context context); + PagedIterable list(String resourceGroupName, String connectedEnvironmentName, Context context); /** * Get the specified Certificate. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentsDaprComponents.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentsDaprComponents.java index 5f88bc7c6f79..b713739c4cda 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentsDaprComponents.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentsDaprComponents.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,33 +12,6 @@ * Resource collection API of ConnectedEnvironmentsDaprComponents. */ public interface ConnectedEnvironmentsDaprComponents { - /** - * Get the Dapr Components for a connected environment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected 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 Components for a connected environment as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String connectedEnvironmentName); - - /** - * Get the Dapr Components for a connected environment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected 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 Components for a connected environment as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String connectedEnvironmentName, Context context); - /** * Get a dapr component. * @@ -98,6 +71,33 @@ Response getWithResponse(String resourceGroupName, String connect */ void delete(String resourceGroupName, String connectedEnvironmentName, String componentName, Context context); + /** + * Get the Dapr Components for a connected environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connected 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 Components for a connected environment as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String connectedEnvironmentName); + + /** + * Get the Dapr Components for a connected environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connected 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 Components for a connected environment as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String connectedEnvironmentName, Context context); + /** * List secrets for a dapr component. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentsStorages.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentsStorages.java index b78951f50874..bfc45ae01d9f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentsStorages.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentsStorages.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -11,39 +11,11 @@ * Resource collection API of ConnectedEnvironmentsStorages. */ public interface ConnectedEnvironmentsStorages { - /** - * Get all storages for a connectedEnvironment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the 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 all storages for a connectedEnvironment along with {@link Response}. - */ - Response listWithResponse(String resourceGroupName, - String connectedEnvironmentName, Context context); - - /** - * Get all storages for a connectedEnvironment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the 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 all storages for a connectedEnvironment. - */ - ConnectedEnvironmentStoragesCollection list(String resourceGroupName, String connectedEnvironmentName); - /** * Get storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -59,7 +31,7 @@ Response getWithResponse(String resourceGroupName, * Get storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request @@ -73,7 +45,7 @@ Response getWithResponse(String resourceGroupName, * Delete storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -85,7 +57,7 @@ Response getWithResponse(String resourceGroupName, * Delete storage for a connectedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @param storageName Name of the storage. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -94,6 +66,34 @@ Response getWithResponse(String resourceGroupName, */ void delete(String resourceGroupName, String connectedEnvironmentName, String storageName, Context context); + /** + * Get all storages for a connectedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connectedEnvironment. + * @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 all storages for a connectedEnvironment along with {@link Response}. + */ + Response listWithResponse(String resourceGroupName, + String connectedEnvironmentName, Context context); + + /** + * Get all storages for a connectedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectedEnvironmentName Name of the connectedEnvironment. + * @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 all storages for a connectedEnvironment. + */ + ConnectedEnvironmentStoragesCollection list(String resourceGroupName, String connectedEnvironmentName); + /** * Get storage for a connectedEnvironment. * 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 cdb204ef9d48..5e246903dfcf 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -110,27 +110,6 @@ public Container withVolumeMounts(List volumeMounts) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void 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()); - } - } - /** * {@inheritDoc} */ 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 27aa0edd8e7f..e962a6c9576d 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -118,6 +118,13 @@ public interface ContainerApp { */ String environmentId(); + /** + * Gets the networking property: Networking configuration for the Container App. + * + * @return the networking value. + */ + ContainerAppNetworkingConfiguration networking(); + /** * Gets the workloadProfileName property: Workload profile name to pin for container app execution. * @@ -264,10 +271,10 @@ interface WithResourceGroup { * The stage of the ContainerApp 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.WithExtendedLocation, DefinitionStages.WithIdentity, - DefinitionStages.WithManagedBy, DefinitionStages.WithKind, DefinitionStages.WithManagedEnvironmentId, - DefinitionStages.WithEnvironmentId, DefinitionStages.WithWorkloadProfileName, + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithExtendedLocation, + DefinitionStages.WithIdentity, DefinitionStages.WithManagedBy, DefinitionStages.WithKind, + DefinitionStages.WithManagedEnvironmentId, DefinitionStages.WithEnvironmentId, + DefinitionStages.WithNetworking, DefinitionStages.WithWorkloadProfileName, DefinitionStages.WithConfiguration, DefinitionStages.WithTemplate { /** * Executes the create request. @@ -385,6 +392,19 @@ interface WithEnvironmentId { WithCreate withEnvironmentId(String environmentId); } + /** + * The stage of the ContainerApp definition allowing to specify networking. + */ + interface WithNetworking { + /** + * Specifies the networking property: Networking configuration for the Container App.. + * + * @param networking Networking configuration for the Container App. + * @return the next definition stage. + */ + WithCreate withNetworking(ContainerAppNetworkingConfiguration networking); + } + /** * The stage of the ContainerApp definition allowing to specify workloadProfileName. */ @@ -436,8 +456,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.WithNetworking, UpdateStages.WithWorkloadProfileName, + UpdateStages.WithConfiguration, UpdateStages.WithTemplate { /** * Executes the update request. * @@ -517,6 +537,19 @@ interface WithManagedBy { Update withManagedBy(String managedBy); } + /** + * The stage of the ContainerApp update allowing to specify networking. + */ + interface WithNetworking { + /** + * Specifies the networking property: Networking configuration for the Container App.. + * + * @param networking Networking configuration for the Container App. + * @return the next definition stage. + */ + Update withNetworking(ContainerAppNetworkingConfiguration networking); + } + /** * The stage of the ContainerApp update allowing to specify workloadProfileName. */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppAuthToken.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppAuthToken.java index 48faf0c045db..53cccf97a955 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppAuthToken.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppAuthToken.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppContainerRunningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppContainerRunningState.java index 2345993fbb89..7c362c0998fc 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppContainerRunningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppContainerRunningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,17 +12,17 @@ */ public final class ContainerAppContainerRunningState extends ExpandableStringEnum { /** - * Static value Running for ContainerAppContainerRunningState. + * Running. */ public static final ContainerAppContainerRunningState RUNNING = fromString("Running"); /** - * Static value Terminated for ContainerAppContainerRunningState. + * Terminated. */ public static final ContainerAppContainerRunningState TERMINATED = fromString("Terminated"); /** - * Static value Waiting for ContainerAppContainerRunningState. + * Waiting. */ public static final ContainerAppContainerRunningState WAITING = fromString("Waiting"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppJobExecutions.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppJobExecutions.java index 2ff642890419..3cb3b0d16d8d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppJobExecutions.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppJobExecutions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,14 +12,14 @@ */ public interface ContainerAppJobExecutions { /** - * Gets the value property: Collection of resources. + * Gets the value property: The JobExecution items on this page. * * @return the value value. */ List value(); /** - * Gets the nextLink property: Link to next page of resources. + * Gets the nextLink property: The link to the next page of items. * * @return the nextLink value. */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppNetworkingConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppNetworkingConfiguration.java new file mode 100644 index 000000000000..89a7200f9184 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppNetworkingConfiguration.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +/** + * Networking configuration for a Container App. Only supported for Container Apps deployed into an Express managed + * environment. + */ +@Fluent +public final class ContainerAppNetworkingConfiguration + implements JsonSerializable { + /* + * Resource ID of a subnet used for outbound (egress) traffic from this Container App. Only supported for Container + * Apps in an Express managed environment. Mutually exclusive with the environment-level VNet configuration and + * immutable after the Container App is created. + */ + private String outboundVnetSubnetId; + + /** + * Creates an instance of ContainerAppNetworkingConfiguration class. + */ + public ContainerAppNetworkingConfiguration() { + } + + /** + * Get the outboundVnetSubnetId property: Resource ID of a subnet used for outbound (egress) traffic from this + * Container App. Only supported for Container Apps in an Express managed environment. Mutually exclusive with the + * environment-level VNet configuration and immutable after the Container App is created. + * + * @return the outboundVnetSubnetId value. + */ + public String outboundVnetSubnetId() { + return this.outboundVnetSubnetId; + } + + /** + * Set the outboundVnetSubnetId property: Resource ID of a subnet used for outbound (egress) traffic from this + * Container App. Only supported for Container Apps in an Express managed environment. Mutually exclusive with the + * environment-level VNet configuration and immutable after the Container App is created. + * + * @param outboundVnetSubnetId the outboundVnetSubnetId value to set. + * @return the ContainerAppNetworkingConfiguration object itself. + */ + public ContainerAppNetworkingConfiguration withOutboundVnetSubnetId(String outboundVnetSubnetId) { + this.outboundVnetSubnetId = outboundVnetSubnetId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("outboundVnetSubnetId", this.outboundVnetSubnetId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerAppNetworkingConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerAppNetworkingConfiguration 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 ContainerAppNetworkingConfiguration. + */ + public static ContainerAppNetworkingConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerAppNetworkingConfiguration deserializedContainerAppNetworkingConfiguration + = new ContainerAppNetworkingConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("outboundVnetSubnetId".equals(fieldName)) { + deserializedContainerAppNetworkingConfiguration.outboundVnetSubnetId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerAppNetworkingConfiguration; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppPrivateEndpointConnections.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppPrivateEndpointConnections.java new file mode 100644 index 000000000000..f5f6d2030788 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppPrivateEndpointConnections.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; +import com.azure.resourcemanager.appcontainers.fluent.models.PrivateEndpointConnectionInner; + +/** + * Resource collection API of ContainerAppPrivateEndpointConnections. + */ +public interface ContainerAppPrivateEndpointConnections { + /** + * Get a private endpoint connection for a given Container App. + * + * Gets the details of a private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 Container App. + * + * Gets the details of a private endpoint connection associated with a Container App along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String containerAppName, + String privateEndpointConnectionName, Context context); + + /** + * Get a private endpoint connection for a given Container App. + * + * Gets the details of a private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 Container App. + * + * Gets the details of a private endpoint connection associated with a Container App. + */ + PrivateEndpointConnection get(String resourceGroupName, String containerAppName, + String privateEndpointConnectionName); + + /** + * Update the state of a private endpoint connection for a given Container App. + * + * Creates a private endpoint connection or updates its connection state 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 privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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. + */ + PrivateEndpointConnection createOrUpdate(String resourceGroupName, String containerAppName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope); + + /** + * Update the state of a private endpoint connection for a given Container App. + * + * Creates a private endpoint connection or updates its connection state 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 privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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. + */ + PrivateEndpointConnection createOrUpdate(String resourceGroupName, String containerAppName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnectionEnvelope, + Context context); + + /** + * Delete a private endpoint connection for a given Container App. + * + * Deletes the specified private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 privateEndpointConnectionName); + + /** + * Delete a private endpoint connection for a given Container App. + * + * Deletes the specified private endpoint connection associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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 privateEndpointConnectionName, + Context context); + + /** + * List private endpoint connections for a given Container App. + * + * Lists all private endpoint connections associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @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 PrivateEndpointConnection list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String containerAppName); + + /** + * List private endpoint connections for a given Container App. + * + * Lists all private endpoint connections associated with a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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.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 PrivateEndpointConnection 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/ContainerAppPrivateLinkResources.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppPrivateLinkResources.java new file mode 100644 index 000000000000..f23549978fa0 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppPrivateLinkResources.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ContainerAppPrivateLinkResources. + */ +public interface ContainerAppPrivateLinkResources { + /** + * List private link resources for a given Container App. + * + * Lists the private link resources supported by a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @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 link resources for a managed environment as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String containerAppName); + + /** + * List private link resources for a given Container App. + * + * Lists the private link resources supported by a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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.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 link resources for a managed environment as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String containerAppName, Context context); + + /** + * Get a private link resource for a given Container App. + * + * Gets the details of a private link resource supported by a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateLinkResourceName The name of the private link 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 link resource for a given Container App. + * + * Gets the details of a private link resource supported by a Container App along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String containerAppName, + String privateLinkResourceName, Context context); + + /** + * Get a private link resource for a given Container App. + * + * Gets the details of a private link resource supported by a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param privateLinkResourceName The name of the private link 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 link resource for a given Container App. + * + * Gets the details of a private link resource supported by a Container App. + */ + PrivateLinkResource get(String resourceGroupName, String containerAppName, String privateLinkResourceName); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbe.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbe.java index 417fa0b3698c..d431ee82a523 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbe.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbe.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -282,20 +282,6 @@ public ContainerAppProbe withType(Type type) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (httpGet() != null) { - httpGet().validate(); - } - if (tcpSocket() != null) { - tcpSocket().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeHttpGet.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeHttpGet.java index 75cd7d1ccba7..541698dfadba 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeHttpGet.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeHttpGet.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -153,17 +153,6 @@ public ContainerAppProbeHttpGet withScheme(Scheme scheme) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (httpHeaders() != null) { - httpHeaders().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeHttpGetHttpHeadersItem.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeHttpGetHttpHeadersItem.java index 4c947e5689a2..266c0333b40b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeHttpGetHttpHeadersItem.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeHttpGetHttpHeadersItem.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -74,26 +73,6 @@ public ContainerAppProbeHttpGetHttpHeadersItem withValue(String 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 ContainerAppProbeHttpGetHttpHeadersItem")); - } - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property value in model ContainerAppProbeHttpGetHttpHeadersItem")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ContainerAppProbeHttpGetHttpHeadersItem.class); - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeTcpSocket.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeTcpSocket.java index bf143f4a5f77..8085ba9374cc 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeTcpSocket.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProbeTcpSocket.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -75,14 +75,6 @@ public ContainerAppProbeTcpSocket withPort(int port) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProvisioningState.java index e7993871a247..67fba81f61de 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,27 +12,27 @@ */ public final class ContainerAppProvisioningState extends ExpandableStringEnum { /** - * Static value InProgress for ContainerAppProvisioningState. + * InProgress. */ public static final ContainerAppProvisioningState IN_PROGRESS = fromString("InProgress"); /** - * Static value Succeeded for ContainerAppProvisioningState. + * Succeeded. */ public static final ContainerAppProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for ContainerAppProvisioningState. + * Failed. */ public static final ContainerAppProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for ContainerAppProvisioningState. + * Canceled. */ public static final ContainerAppProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Deleting for ContainerAppProvisioningState. + * Deleting. */ public static final ContainerAppProvisioningState DELETING = fromString("Deleting"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppReplicaRunningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppReplicaRunningState.java index 327c9eb5b65f..c622e10c0922 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppReplicaRunningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppReplicaRunningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,17 +12,17 @@ */ public final class ContainerAppReplicaRunningState extends ExpandableStringEnum { /** - * Static value Running for ContainerAppReplicaRunningState. + * Running. */ public static final ContainerAppReplicaRunningState RUNNING = fromString("Running"); /** - * Static value NotRunning for ContainerAppReplicaRunningState. + * NotRunning. */ public static final ContainerAppReplicaRunningState NOT_RUNNING = fromString("NotRunning"); /** - * Static value Unknown for ContainerAppReplicaRunningState. + * Unknown. */ public static final ContainerAppReplicaRunningState UNKNOWN = fromString("Unknown"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppRunningStatus.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppRunningStatus.java index a6072e9e02da..29dc1884ce76 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppRunningStatus.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppRunningStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,27 +12,27 @@ */ public final class ContainerAppRunningStatus extends ExpandableStringEnum { /** - * Static value Progressing for ContainerAppRunningStatus. + * Container App is transitioning between Stopped and Running states. */ public static final ContainerAppRunningStatus PROGRESSING = fromString("Progressing"); /** - * Static value Running for ContainerAppRunningStatus. + * Container App is in Running state. */ public static final ContainerAppRunningStatus RUNNING = fromString("Running"); /** - * Static value Stopped for ContainerAppRunningStatus. + * Container App is in Stopped state. */ public static final ContainerAppRunningStatus STOPPED = fromString("Stopped"); /** - * Static value Suspended for ContainerAppRunningStatus. + * Container App Job is in Suspended state. */ public static final ContainerAppRunningStatus SUSPENDED = fromString("Suspended"); /** - * Static value Ready for ContainerAppRunningStatus. + * Container App Job is in Ready state. */ public static final ContainerAppRunningStatus READY = fromString("Ready"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppSecret.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppSecret.java index c647d95cff2b..eefacd1dc7c3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppSecret.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppSecret.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -40,7 +40,7 @@ public final class ContainerAppSecret implements JsonSerializable list(); + Response getByResourceGroupWithResponse(String resourceGroupName, String containerAppName, + Context context); /** - * Get the Container Apps in a given subscription. + * Get the properties of a Container App. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Container Apps in a given subscription as paginated response with {@link PagedIterable}. + * @return the properties of a Container App. */ - PagedIterable list(Context context); + ContainerApp getByResourceGroup(String resourceGroupName, String containerAppName); /** - * Get the Container Apps in a given resource group. + * Delete a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. * @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 Container Apps in a given resource group as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + void deleteByResourceGroup(String resourceGroupName, String containerAppName); /** - * Get the Container Apps in a given resource group. + * Delete a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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.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 Container Apps in a given resource group as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + void delete(String resourceGroupName, String containerAppName, Context context); /** - * Get the properties of a Container App. + * Get the Container Apps in a given resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName 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.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on - * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a Container App along with {@link Response}. + * @return the Container Apps in a given resource group as paginated response with {@link PagedIterable}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String containerAppName, - Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Get the properties of a Container App. + * Get the Container Apps in a given resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName 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.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on - * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a Container App. + * @return the Container Apps in a given resource group as paginated response with {@link PagedIterable}. */ - ContainerApp getByResourceGroup(String resourceGroupName, String containerAppName); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Delete a Container App. + * Get the Container Apps in a given subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App. - * @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 Container Apps in a given subscription as paginated response with {@link PagedIterable}. */ - void deleteByResourceGroup(String resourceGroupName, String containerAppName); + PagedIterable list(); /** - * Delete a Container App. + * Get the Container Apps in a given subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName 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.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 Container Apps in a given subscription as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String containerAppName, Context context); + PagedIterable list(Context context); /** * Analyzes a custom hostname for a Container App. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsAuthConfigs.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsAuthConfigs.java index 1859a1057108..26c9daa9acf7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsAuthConfigs.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsAuthConfigs.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -13,34 +13,37 @@ */ public interface ContainerAppsAuthConfigs { /** - * Get the Container App AuthConfigs in a given resource group. + * Get a AuthConfig of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. + * @param authConfigName Name of the Container App AuthConfig. + * @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 Container App AuthConfigs in a given resource group as paginated response with {@link PagedIterable}. + * @return a AuthConfig of a Container App along with {@link Response}. */ - PagedIterable listByContainerApp(String resourceGroupName, String containerAppName); + Response getWithResponse(String resourceGroupName, String containerAppName, String authConfigName, + Context context); /** - * Get the Container App AuthConfigs in a given resource group. + * Get a AuthConfig of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param context The context to associate with this operation. + * @param authConfigName Name of the Container App AuthConfig. * @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 Container App AuthConfigs in a given resource group as paginated response with {@link PagedIterable}. + * @return a AuthConfig of a Container App. */ - PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, Context context); + AuthConfig get(String resourceGroupName, String containerAppName, String authConfigName); /** - * Get a AuthConfig of a Container App. + * Delete a Container App AuthConfig. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. @@ -50,13 +53,13 @@ public interface ContainerAppsAuthConfigs { * @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 AuthConfig of a Container App along with {@link Response}. + * @return the {@link Response}. */ - Response getWithResponse(String resourceGroupName, String containerAppName, String authConfigName, + Response deleteWithResponse(String resourceGroupName, String containerAppName, String authConfigName, Context context); /** - * Get a AuthConfig of a Container App. + * Delete a Container App AuthConfig. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. @@ -65,38 +68,35 @@ Response getWithResponse(String resourceGroupName, String containerA * @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 AuthConfig of a Container App. */ - AuthConfig get(String resourceGroupName, String containerAppName, String authConfigName); + void delete(String resourceGroupName, String containerAppName, String authConfigName); /** - * Delete a Container App AuthConfig. + * Get the Container App AuthConfigs in a given resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param authConfigName Name of the Container App AuthConfig. - * @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}. + * @return the Container App AuthConfigs in a given resource group as paginated response with {@link PagedIterable}. */ - Response deleteWithResponse(String resourceGroupName, String containerAppName, String authConfigName, - Context context); + PagedIterable listByContainerApp(String resourceGroupName, String containerAppName); /** - * Delete a Container App AuthConfig. + * Get the Container App AuthConfigs in a given resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param authConfigName Name of the Container App AuthConfig. + * @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 Container App AuthConfigs in a given resource group as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String containerAppName, String authConfigName); + PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, Context context); /** * Get a AuthConfig of a Container App. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsDiagnostics.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsDiagnostics.java index 74e0bd45eb2c..38b7510cb31b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsDiagnostics.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsDiagnostics.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -13,149 +13,157 @@ */ public interface ContainerAppsDiagnostics { /** - * Get the list of diagnostics for a given Container App. + * Get a revision of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which detector info is needed. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the detector. + * @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 list of diagnostics for a given Container App as paginated response with {@link PagedIterable}. + * @return a revision of a Container App along with {@link Response}. */ - PagedIterable listDetectors(String resourceGroupName, String containerAppName); + Response getRevisionWithResponse(String resourceGroupName, String containerAppName, String revisionName, + Context context); /** - * Get the list of diagnostics for a given Container App. + * Get a revision of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which detector info is needed. - * @param context The context to associate with this operation. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the detector. * @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 list of diagnostics for a given Container App as paginated response with {@link PagedIterable}. + * @return a revision of a Container App. */ - PagedIterable listDetectors(String resourceGroupName, String containerAppName, Context context); + Revision getRevision(String resourceGroupName, String containerAppName, String revisionName); /** - * Get a diagnostics result of a Container App. + * Get the Revisions for a given Container App. + * + * A synchronous resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param detectorName Name of the Container App Detector. - * @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 diagnostics result of a Container App along with {@link Response}. + * @return the Revisions for a given Container App. + * + * A synchronous resource action as paginated response with {@link PagedIterable}. */ - Response getDetectorWithResponse(String resourceGroupName, String containerAppName, - String detectorName, Context context); + PagedIterable listRevisions(String resourceGroupName, String containerAppName); /** - * Get a diagnostics result of a Container App. + * Get the Revisions for a given Container App. + * + * A synchronous resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param detectorName Name of the Container App Detector. + * @param filter The filter to apply on the operation. + * @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 diagnostics result of a Container App. + * @return the Revisions for a given Container App. + * + * A synchronous resource action as paginated response with {@link PagedIterable}. */ - Diagnostics getDetector(String resourceGroupName, String containerAppName, String detectorName); + PagedIterable listRevisions(String resourceGroupName, String containerAppName, String filter, + Context context); /** - * Get the Revisions for a given Container App. + * Get the properties of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. + * @param containerAppName 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Revisions for a given Container App as paginated response with {@link PagedIterable}. + * @return the properties of a Container App along with {@link Response}. */ - PagedIterable listRevisions(String resourceGroupName, String containerAppName); + Response getRootWithResponse(String resourceGroupName, String containerAppName, Context context); /** - * Get the Revisions for a given Container App. + * Get the properties of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. + * @param containerAppName 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Revisions for a given Container App as paginated response with {@link PagedIterable}. + * @return the properties of a Container App. */ - PagedIterable listRevisions(String resourceGroupName, String containerAppName, String filter, - Context context); + ContainerApp getRoot(String resourceGroupName, String containerAppName); /** - * Get a revision of a Container App. + * Get the list of diagnostics for a given 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. - * @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 revision of a Container App along with {@link Response}. + * @return the list of diagnostics for a given Container App as paginated response with {@link PagedIterable}. */ - Response getRevisionWithResponse(String resourceGroupName, String containerAppName, String revisionName, - Context context); + PagedIterable listDetectors(String resourceGroupName, String containerAppName); /** - * Get a revision of a Container App. + * Get the list of diagnostics for a given 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. + * @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 revision of a Container App. + * @return the list of diagnostics for a given Container App as paginated response with {@link PagedIterable}. */ - Revision getRevision(String resourceGroupName, String containerAppName, String revisionName); + PagedIterable listDetectors(String resourceGroupName, String containerAppName, Context context); /** - * Get the properties of a Container App. + * Get a diagnostics result of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. + * @param detectorName Name of the detector. * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on - * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a Container App along with {@link Response}. + * @return a diagnostics result of a Container App along with {@link Response}. */ - Response getRootWithResponse(String resourceGroupName, String containerAppName, Context context); + Response getDetectorWithResponse(String resourceGroupName, String containerAppName, + String detectorName, Context context); /** - * Get the properties of a Container App. + * Get a diagnostics result of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. + * @param detectorName Name of the detector. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on - * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a Container App. + * @return a diagnostics result of a Container App. */ - ContainerApp getRoot(String resourceGroupName, String containerAppName); + Diagnostics getDetector(String resourceGroupName, String containerAppName, String detectorName); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsFunction.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsFunction.java new file mode 100644 index 000000000000..a6d7a019072c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsFunction.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsFunctionInner; + +/** + * An immutable client-side representation of ContainerAppsFunction. + */ +public interface ContainerAppsFunction { + /** + * 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 invokeUrlTemplate property: Invoke URL for the function. + * + * @return the invokeUrlTemplate value. + */ + String invokeUrlTemplate(); + + /** + * Gets the triggerType property: Trigger type of the function. + * + * @return the triggerType value. + */ + String triggerType(); + + /** + * Gets the language property: Programming language of the function. + * + * @return the language value. + */ + String language(); + + /** + * Gets the isDisabled property: Indicates whether the function is disabled. This property is deprecated; use + * `state` instead. + * + * @return the isDisabled value. + */ + Boolean isDisabled(); + + /** + * Gets the state property: The state of the function. + * + * @return the state value. + */ + ContainerAppsFunctionState state(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsFunctionInner object. + * + * @return the inner object. + */ + ContainerAppsFunctionInner innerModel(); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsFunctionState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsFunctionState.java new file mode 100644 index 000000000000..0fa934ab3420 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsFunctionState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The state of a Container App function. + */ +public final class ContainerAppsFunctionState extends ExpandableStringEnum { + /** + * The function is enabled. + */ + public static final ContainerAppsFunctionState ENABLED = fromString("Enabled"); + + /** + * The function is disabled. + */ + public static final ContainerAppsFunctionState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of ContainerAppsFunctionState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContainerAppsFunctionState() { + } + + /** + * Creates or finds a ContainerAppsFunctionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerAppsFunctionState. + */ + public static ContainerAppsFunctionState fromString(String name) { + return fromString(name, ContainerAppsFunctionState.class); + } + + /** + * Gets known ContainerAppsFunctionState values. + * + * @return known ContainerAppsFunctionState values. + */ + public static Collection values() { + return values(ContainerAppsFunctionState.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsFunctions.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsFunctions.java new file mode 100644 index 000000000000..9562b7c34a9d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsFunctions.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ContainerAppsFunctions. + */ +public interface ContainerAppsFunctions { + /** + * Get a specific function of a Container App from the latest Revision. + * + * Gets the details of a specific function from the latest Container App revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param functionName Name of the Function. + * @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 specific function of a Container App from the latest Revision. + * + * Gets the details of a specific function from the latest Container App revision along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String containerAppName, + String functionName, Context context); + + /** + * Get a specific function of a Container App from the latest Revision. + * + * Gets the details of a specific function from the latest Container App revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param functionName Name of the Function. + * @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 specific function of a Container App from the latest Revision. + * + * Gets the details of a specific function from the latest Container App revision. + */ + ContainerAppsFunction get(String resourceGroupName, String containerAppName, String functionName); + + /** + * List the functions for a given Container App from the latest Revision. + * + * Lists the functions available in the latest revision of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 container App Functions collection ARM resource as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String containerAppName); + + /** + * List the functions for a given Container App from the latest Revision. + * + * Lists the functions available in the latest revision of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 container App Functions collection ARM resource 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/ContainerAppsLabelHistories.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsLabelHistories.java new file mode 100644 index 000000000000..9de5b01e13e9 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsLabelHistories.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ContainerAppsLabelHistories. + */ +public interface ContainerAppsLabelHistories { + /** + * Get the history of a label. + * + * Gets the revision history associated with a Container App label. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param labelName Name of the label. + * @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 history of a label. + * + * Gets the revision history associated with a Container App label along with {@link Response}. + */ + Response getLabelHistoryWithResponse(String resourceGroupName, String containerAppName, + String labelName, Context context); + + /** + * Get the history of a label. + * + * Gets the revision history associated with a Container App label. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param labelName Name of the label. + * @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 history of a label. + * + * Gets the revision history associated with a Container App label. + */ + LabelHistory getLabelHistory(String resourceGroupName, String containerAppName, String labelName); + + /** + * Delete the history of a label. + * + * Deletes the revision history associated with a Container App label. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param labelName Name of the label. + * @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 deleteLabelHistoryWithResponse(String resourceGroupName, String containerAppName, String labelName, + Context context); + + /** + * Delete the history of a label. + * + * Deletes the revision history associated with a Container App label. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param labelName Name of the label. + * @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 deleteLabelHistory(String resourceGroupName, String containerAppName, String labelName); + + /** + * Get the Label History for a given Container App. + * + * Lists the label revision histories for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName 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 the Label History for a given Container App. + * + * Lists the label revision histories for a Container App as paginated response with {@link PagedIterable}. + */ + PagedIterable listLabelHistory(String resourceGroupName, String containerAppName); + + /** + * Get the Label History for a given Container App. + * + * Lists the label revision histories 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 filter The filter to apply on the operation. + * @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 Label History for a given Container App. + * + * Lists the label revision histories for a Container App as paginated response with {@link PagedIterable}. + */ + PagedIterable listLabelHistory(String resourceGroupName, String containerAppName, String filter, + Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsRevisionFunctions.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsRevisionFunctions.java new file mode 100644 index 000000000000..986dae19863f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsRevisionFunctions.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ContainerAppsRevisionFunctions. + */ +public interface ContainerAppsRevisionFunctions { + /** + * Get a specific function of a Container App Revision. + * + * Gets the details of a specific function in a Container App revision. + * + * @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. + * @param functionName Name of the Function. + * @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 specific function of a Container App Revision. + * + * Gets the details of a specific function in a Container App revision along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String containerAppName, + String revisionName, String functionName, Context context); + + /** + * Get a specific function of a Container App Revision. + * + * Gets the details of a specific function in a Container App revision. + * + * @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. + * @param functionName Name of the Function. + * @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 specific function of a Container App Revision. + * + * Gets the details of a specific function in a Container App revision. + */ + ContainerAppsFunction get(String resourceGroupName, String containerAppName, String revisionName, + String functionName); + + /** + * List the functions for a given Container App Revision. + * + * Lists the functions available in a specific Container App revision. + * + * @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. + * @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 Functions collection ARM resource as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String containerAppName, String revisionName); + + /** + * List the functions for a given Container App Revision. + * + * Lists the functions available in a specific Container App revision. + * + * @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. + * @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 Functions collection ARM resource as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String containerAppName, String revisionName, + Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsRevisionReplicas.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsRevisionReplicas.java index 0bc8de8d41d7..d9a5b3798c5e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsRevisionReplicas.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsRevisionReplicas.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsRevisions.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsRevisions.java index 60cb3b6963f7..7121514f9ad7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsRevisions.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsRevisions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -13,63 +13,63 @@ */ public interface ContainerAppsRevisions { /** - * Get the Revisions for a given Container App. + * Get a revision of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. + * @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 Revisions for a given Container App as paginated response with {@link PagedIterable}. + * @return a revision of a Container App along with {@link Response}. */ - PagedIterable listRevisions(String resourceGroupName, String containerAppName); + Response getRevisionWithResponse(String resourceGroupName, String containerAppName, String revisionName, + Context context); /** - * Get the Revisions for a given Container App. + * Get a revision of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App for which Revisions are needed. - * @param filter The filter to apply on the operation. - * @param context The context to associate with this operation. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. * @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 Revisions for a given Container App as paginated response with {@link PagedIterable}. + * @return a revision of a Container App. */ - PagedIterable listRevisions(String resourceGroupName, String containerAppName, String filter, - Context context); + Revision getRevision(String resourceGroupName, String containerAppName, String revisionName); /** - * Get a revision of a Container App. + * Get the Revisions for a given 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. - * @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 revision of a Container App along with {@link Response}. + * @return the Revisions for a given Container App as paginated response with {@link PagedIterable}. */ - Response getRevisionWithResponse(String resourceGroupName, String containerAppName, String revisionName, - Context context); + PagedIterable listRevisions(String resourceGroupName, String containerAppName); /** - * Get a revision of a Container App. + * Get the Revisions for a given 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. + * @param filter The filter to apply on the operation. + * @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 revision of a Container App. + * @return the Revisions for a given Container App as paginated response with {@link PagedIterable}. */ - Revision getRevision(String resourceGroupName, String containerAppName, String revisionName); + PagedIterable listRevisions(String resourceGroupName, String containerAppName, String filter, + Context context); /** * Activates a revision for a Container App. 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 index b07cb71bb503..9fbb2df38884 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -13,102 +13,102 @@ */ public interface ContainerAppsSessionPools { /** - * Get the session pools in a given subscription. + * 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.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 session pools in a given subscription as paginated response with {@link PagedIterable}. + * @return the properties of a session pool along with {@link Response}. */ - PagedIterable list(); + Response getByResourceGroupWithResponse(String resourceGroupName, String sessionPoolName, + Context context); /** - * Get the session pools in a given subscription. + * Get the properties of a session pool. * - * @param context The context to associate with this operation. + * @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.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 session pools in a given subscription as paginated response with {@link PagedIterable}. + * @return the properties of a session pool. */ - PagedIterable list(Context context); + SessionPool getByResourceGroup(String resourceGroupName, String sessionPoolName); /** - * Get the session pools in a given resource group of a subscription. + * 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.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 session pools in a given resource group of a subscription as paginated response with - * {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + void deleteByResourceGroup(String resourceGroupName, String sessionPoolName); /** - * Get the session pools in a given resource group of a subscription. + * 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.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 session pools in a given resource group of a subscription as paginated response with - * {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + void delete(String resourceGroupName, String sessionPoolName, Context context); /** - * Get the properties of a session pool. + * 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 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.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 properties of a session pool along with {@link Response}. + * @return the session pools in a given resource group of a subscription as paginated response with + * {@link PagedIterable}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String sessionPoolName, - Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Get the properties of a session pool. + * 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 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.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 properties of a session pool. + * @return the session pools in a given resource group of a subscription as paginated response with + * {@link PagedIterable}. */ - SessionPool getByResourceGroup(String resourceGroupName, String sessionPoolName); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Delete a session pool. - * - * Delete the session pool with the given name. + * Get the session pools in a given subscription. * - * @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.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 session pools in a given subscription as paginated response with {@link PagedIterable}. */ - void deleteByResourceGroup(String resourceGroupName, String sessionPoolName); + PagedIterable list(); /** - * Delete a session pool. - * - * Delete the session pool with the given name. + * Get the session pools in a given subscription. * - * @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.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 session pools in a given subscription as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String sessionPoolName, Context context); + PagedIterable list(Context context); /** * Get the properties of a session pool. 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 41cc21d952a2..1e5ca9e33f05 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -13,90 +13,90 @@ */ public interface ContainerAppsSourceControls { /** - * Get the Container App SourceControls in a given resource group. + * Get a SourceControl of 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 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 Container App SourceControls in a given resource group as paginated response with - * {@link PagedIterable}. + * @return a SourceControl of a Container App along with {@link Response}. */ - PagedIterable listByContainerApp(String resourceGroupName, String containerAppName); + Response getWithResponse(String resourceGroupName, String containerAppName, String sourceControlName, + Context context); /** - * Get the Container App SourceControls in a given resource group. + * Get a SourceControl of a Container App. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. - * @param context The context to associate with this operation. + * @param sourceControlName Name of the Container App SourceControl. * @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 Container App SourceControls in a given resource group as paginated response with - * {@link PagedIterable}. + * @return a SourceControl of a Container App. */ - PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, Context context); + SourceControl get(String resourceGroupName, String containerAppName, String sourceControlName); /** - * Get a SourceControl of a Container App. + * 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 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 SourceControl of a Container App along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String containerAppName, String sourceControlName, - Context context); + void delete(String resourceGroupName, String containerAppName, String sourceControlName); /** - * Get a SourceControl of a Container App. + * 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 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 SourceControl of a Container App. */ - SourceControl get(String resourceGroupName, String containerAppName, String sourceControlName); + void delete(String resourceGroupName, String containerAppName, String sourceControlName, Context context); /** - * Delete a Container App SourceControl. + * Get the Container App SourceControls in a given resource group. * * @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. * @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 Container App SourceControls in a given resource group as paginated response with + * {@link PagedIterable}. */ - void delete(String resourceGroupName, String containerAppName, String sourceControlName); + PagedIterable listByContainerApp(String resourceGroupName, String containerAppName); /** - * Delete a Container App SourceControl. + * Get the Container App SourceControls in a given resource group. * * @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 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 Container App SourceControls in a given resource group as paginated response with + * {@link PagedIterable}. */ - void delete(String resourceGroupName, String containerAppName, String sourceControlName, Context context); + PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, Context context); /** * Get a SourceControl of a Container App. 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 000000000000..96e403a090c5 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerExecutionStatus.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 Apps Job execution container status. Contains status code and reason. + */ +@Immutable +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. + */ + private ContainerExecutionStatus() { + } + + /** + * Get the name property: Container Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the code property: Exit code. + * + * @return the code value. + */ + public Integer code() { + return this.code; + } + + /** + * Get the additionalInformation property: Additional information for the container status. + * + * @return the additionalInformation value. + */ + public String additionalInformation() { + return this.additionalInformation; + } + + /** + * Get the status property: Status of the container. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * {@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/ContainerResources.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerResources.java index 5e43d89033e1..af1166c34992 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerResources.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerResources.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -86,14 +86,6 @@ public String ephemeralStorage() { return this.ephemeralStorage; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index e8b2e7cc4a58..35b4fcfe440a 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -8,16 +8,17 @@ import java.util.Collection; /** - * The container type of the sessions. + * The container type of the sessions. You can use your own container to build the session pool, or you can use a + * predefined container to run workload with specific language. */ public final class ContainerType extends ExpandableStringEnum { /** - * Static value CustomContainer for ContainerType. + * CustomContainer. */ public static final ContainerType CUSTOM_CONTAINER = fromString("CustomContainer"); /** - * Static value PythonLTS for ContainerType. + * PythonLTS. */ public static final ContainerType PYTHON_LTS = fromString("PythonLTS"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CookieExpiration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CookieExpiration.java index da298489c89e..0ebf68929390 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CookieExpiration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CookieExpiration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -72,14 +72,6 @@ public CookieExpiration withTimeToExpiration(String timeToExpiration) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CookieExpirationConvention.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CookieExpirationConvention.java index c7940865b546..d246bf439fe3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CookieExpirationConvention.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CookieExpirationConvention.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -9,12 +9,12 @@ */ public enum CookieExpirationConvention { /** - * Enum value FixedTime. + * FixedTime. */ FIXED_TIME("FixedTime"), /** - * Enum value IdentityProviderDerived. + * IdentityProviderDerived. */ IDENTITY_PROVIDER_DERIVED("IdentityProviderDerived"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CorsPolicy.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CorsPolicy.java index 29a0f3cf4d68..0440fc31807d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CorsPolicy.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CorsPolicy.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -174,20 +173,6 @@ public CorsPolicy withAllowCredentials(Boolean allowCredentials) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (allowedOrigins() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property allowedOrigins in model CorsPolicy")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CorsPolicy.class); - /** * {@inheritDoc} */ 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 index 63725b65db72..8d7a9af16ebe 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -100,23 +100,6 @@ public CustomContainerTemplate withIngress(SessionIngress 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} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomain.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomain.java index d5d83f6444e7..0a45b2dc8797 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomain.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomain.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -100,20 +99,6 @@ public CustomDomain withCertificateId(String certificateId) { 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 CustomDomain")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CustomDomain.class); - /** * {@inheritDoc} */ 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 543efc3f3adf..d750578d1dd4 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -181,17 +181,6 @@ public String subjectName() { return this.subjectName; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (certificateKeyVaultProperties() != null) { - certificateKeyVaultProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomHostnameAnalysisResult.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomHostnameAnalysisResult.java index 27c48d9aa597..e5252201ce6c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomHostnameAnalysisResult.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomHostnameAnalysisResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo.java index 12e0c9ad2519..1a90fdf2250f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Raw failure information if DNS verification fails. */ -@Fluent +@Immutable public final class CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo implements JsonSerializable { /* @@ -41,7 +41,7 @@ public final class CustomHostnameAnalysisResultCustomDomainVerificationFailureIn /** * Creates an instance of CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo class. */ - public CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo() { + private CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo() { } /** @@ -80,29 +80,6 @@ public List details) { - this.details = details; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (details() != null) { - details().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem.java index 499ba7d2784c..91c246d2b9e8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -35,7 +35,7 @@ public final class CustomHostnameAnalysisResultCustomDomainVerificationFailureIn /** * Creates an instance of CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem class. */ - public CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem() { + private CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem() { } /** @@ -65,14 +65,6 @@ public String target() { return this.target; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomOpenIdConnectProvider.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomOpenIdConnectProvider.java index 3d2c8518522f..6f5ef3a652ae 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomOpenIdConnectProvider.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomOpenIdConnectProvider.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -101,20 +101,6 @@ public CustomOpenIdConnectProvider withLogin(OpenIdConnectLogin login) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (registration() != null) { - registration().validate(); - } - if (login() != null) { - login().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomScaleRule.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomScaleRule.java index 2a63f74b802b..f1d33ea63722 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomScaleRule.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomScaleRule.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -19,6 +19,7 @@ @Fluent public final class CustomScaleRule implements JsonSerializable { /* + * * Type of the custom scale rule * eg: azure-servicebus, redis etc. */ @@ -47,7 +48,8 @@ public CustomScaleRule() { } /** - * Get the type property: Type of the custom scale rule + * Get the type property: + * Type of the custom scale rule * eg: azure-servicebus, redis etc. * * @return the type value. @@ -57,7 +59,8 @@ public String type() { } /** - * Set the type property: Type of the custom scale rule + * Set the type property: + * Type of the custom scale rule * eg: azure-servicebus, redis etc. * * @param type the type value to set. @@ -130,17 +133,6 @@ public CustomScaleRule withIdentity(String identity) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (auth() != null) { - auth().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Dapr.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Dapr.java index 3e11f57eec1d..24d0082969c7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Dapr.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Dapr.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -281,17 +281,6 @@ public Dapr withMaxConcurrency(Integer maxConcurrency) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (appHealth() != null) { - appHealth().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprAppHealth.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprAppHealth.java index f621488eb697..b7c29779f02d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprAppHealth.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprAppHealth.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -147,14 +147,6 @@ public DaprAppHealth withThreshold(Integer threshold) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 3304e44d0e82..bed4b8610bed 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -99,7 +99,7 @@ public interface DaprComponent { List scopes(); /** - * Gets the provisioningState property: Provisioning state of the Dapr Component. + * Gets the provisioningState property: Provisioning state of the Connected Environment Dapr Component. * * @return the provisioningState value. */ @@ -151,7 +151,7 @@ interface WithParentResource { * Specifies resourceGroupName, connectedEnvironmentName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected environment. + * @param connectedEnvironmentName Name of the connectedEnvironment. * @return the next definition stage. */ WithCreate withExistingConnectedEnvironment(String resourceGroupName, String connectedEnvironmentName); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentProvisioningState.java index 4a29f42af8ec..8b846749c4c6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -8,31 +8,31 @@ import java.util.Collection; /** - * Provisioning state of the Dapr Component. + * Provisioning state of the Connected Environment Dapr Component. */ public final class DaprComponentProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for DaprComponentProvisioningState. + * Succeeded. */ public static final DaprComponentProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for DaprComponentProvisioningState. + * Failed. */ public static final DaprComponentProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for DaprComponentProvisioningState. + * Canceled. */ public static final DaprComponentProvisioningState CANCELED = fromString("Canceled"); /** - * Static value InProgress for DaprComponentProvisioningState. + * InProgress. */ public static final DaprComponentProvisioningState IN_PROGRESS = fromString("InProgress"); /** - * Static value Deleting for DaprComponentProvisioningState. + * Deleting. */ public static final DaprComponentProvisioningState DELETING = fromString("Deleting"); 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 000000000000..6c5a29c8a5de --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicies.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 a Dapr component resiliency policy. + * + * Gets the details of 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 a Dapr component resiliency policy. + * + * Gets the details of a resiliency policy for a Dapr component along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String environmentName, + String componentName, String name, Context context); + + /** + * Get a Dapr component resiliency policy. + * + * Gets the details of 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. + * @return a Dapr component resiliency policy. + * + * Gets the details of a resiliency policy for a Dapr component. + */ + 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 the resiliency policies for a Dapr component. + * + * Lists the resiliency policies configured 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. + * + * Lists the resiliency policies configured 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. + * + * Lists the resiliency policies configured 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. + * + * Lists the resiliency policies configured 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. + * + * Gets the details of 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. + * @return a Dapr component resiliency policy. + * + * Gets the details of a resiliency policy for a Dapr component along with {@link Response}. + */ + DaprComponentResiliencyPolicy getById(String id); + + /** + * Get a Dapr component resiliency policy. + * + * Gets the details of 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 a Dapr component resiliency policy. + * + * Gets the details of a resiliency policy for a Dapr component 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/DaprComponentResiliencyPolicy.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicy.java new file mode 100644 index 000000000000..eda02816b63c --- /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) TypeSpec 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 000000000000..448398a92839 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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 000000000000..ff594380323a --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyConfiguration.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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 000000000000..5feee89392b0 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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 000000000000..d682d5b08445 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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 000000000000..6de8eb605d25 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponentResiliencyPolicyTimeoutPolicyConfiguration.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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/DaprComponents.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponents.java index 8834ca17b94b..48ffe4c54e91 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponents.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponents.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -13,33 +13,6 @@ * Resource collection API of DaprComponents. */ public interface DaprComponents { - /** - * Get the Dapr 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.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 Components for a managed environment as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String environmentName); - - /** - * Get the Dapr 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.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 Components for a managed environment as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String environmentName, Context context); - /** * Get a dapr component. * @@ -140,6 +113,33 @@ Response deleteWithResponse(String resourceGroupName, String environmentNa */ void delete(String resourceGroupName, String environmentName, String componentName); + /** + * Get the Dapr 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.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 Components for a managed environment as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName); + + /** + * Get the Dapr 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.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 Components for a managed environment as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName, Context context); + /** * List secrets for a dapr component. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprConfiguration.java index 98c7a26c6868..b4b4272acab0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -36,14 +36,6 @@ public String version() { return this.version; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprMetadata.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprMetadata.java index 0673beca3a57..9cf897e986d8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprMetadata.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprMetadata.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -97,14 +97,6 @@ public DaprMetadata withSecretRef(String secretRef) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSecret.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSecret.java index cd8cdbf7a4ff..7d8d57916953 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSecret.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSecret.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -29,7 +29,7 @@ public final class DaprSecret implements JsonSerializable { /** * Creates an instance of DaprSecret class. */ - public DaprSecret() { + private DaprSecret() { } /** @@ -50,14 +50,6 @@ public String value() { return this.value; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSecretsCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSecretsCollection.java index 7a8c0766d80e..360022f061e0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSecretsCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSecretsCollection.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; 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 000000000000..25ede2072d6f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DataDogConfiguration.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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/DefaultAuthorizationPolicy.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DefaultAuthorizationPolicy.java index f5abfa61892a..f36673f4afab 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DefaultAuthorizationPolicy.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DefaultAuthorizationPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -75,17 +75,6 @@ public DefaultAuthorizationPolicy withAllowedApplications(List allowedAp return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (allowedPrincipals() != null) { - allowedPrincipals().validate(); - } - } - /** * {@inheritDoc} */ 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 303949482e6b..f5d29a250708 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -51,7 +51,7 @@ public final class DefaultErrorResponseError extends ManagementError { /** * Creates an instance of DefaultErrorResponseError class. */ - public DefaultErrorResponseError() { + private DefaultErrorResponseError() { } /** @@ -113,14 +113,6 @@ public String getCode() { return this.code; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DefaultErrorResponseErrorException.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DefaultErrorResponseErrorException.java index 9b49fecbf027..16687419d4a7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DefaultErrorResponseErrorException.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DefaultErrorResponseErrorException.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; 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 000000000000..93431243ed36 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DestinationsConfiguration.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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/DiagnosticDataProviderMetadata.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataProviderMetadata.java index b858a7dd7a9a..83745d5bb5cd 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataProviderMetadata.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataProviderMetadata.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Details of a diagnostics data provider. */ -@Fluent +@Immutable public final class DiagnosticDataProviderMetadata implements JsonSerializable { /* * Name of data provider @@ -30,7 +30,7 @@ public final class DiagnosticDataProviderMetadata implements JsonSerializable propertyBag() { return this.propertyBag; } - /** - * Set the propertyBag property: Collection of properties. - * - * @param propertyBag the propertyBag value to set. - * @return the DiagnosticDataProviderMetadata object itself. - */ - public DiagnosticDataProviderMetadata - withPropertyBag(List propertyBag) { - this.propertyBag = propertyBag; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (propertyBag() != null) { - propertyBag().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataProviderMetadataPropertyBagItem.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataProviderMetadataPropertyBagItem.java index 10c41181eb45..be89664e5d72 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataProviderMetadataPropertyBagItem.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataProviderMetadataPropertyBagItem.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Property details. */ -@Fluent +@Immutable public final class DiagnosticDataProviderMetadataPropertyBagItem implements JsonSerializable { /* @@ -30,7 +30,7 @@ public final class DiagnosticDataProviderMetadataPropertyBagItem /** * Creates an instance of DiagnosticDataProviderMetadataPropertyBagItem class. */ - public DiagnosticDataProviderMetadataPropertyBagItem() { + private DiagnosticDataProviderMetadataPropertyBagItem() { } /** @@ -42,17 +42,6 @@ public String name() { return this.name; } - /** - * Set the name property: Property name. - * - * @param name the name value to set. - * @return the DiagnosticDataProviderMetadataPropertyBagItem object itself. - */ - public DiagnosticDataProviderMetadataPropertyBagItem withName(String name) { - this.name = name; - return this; - } - /** * Get the value property: Property value. * @@ -62,25 +51,6 @@ public String value() { return this.value; } - /** - * Set the value property: Property value. - * - * @param value the value value to set. - * @return the DiagnosticDataProviderMetadataPropertyBagItem object itself. - */ - public DiagnosticDataProviderMetadataPropertyBagItem withValue(String value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataTableResponseColumn.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataTableResponseColumn.java index 746623c49a05..e86671bbf391 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataTableResponseColumn.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataTableResponseColumn.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Diagnostics data column. */ -@Fluent +@Immutable public final class DiagnosticDataTableResponseColumn implements JsonSerializable { /* * Column name @@ -34,7 +34,7 @@ public final class DiagnosticDataTableResponseColumn implements JsonSerializable /** * Creates an instance of DiagnosticDataTableResponseColumn class. */ - public DiagnosticDataTableResponseColumn() { + private DiagnosticDataTableResponseColumn() { } /** @@ -46,17 +46,6 @@ public String columnName() { return this.columnName; } - /** - * Set the columnName property: Column name. - * - * @param columnName the columnName value to set. - * @return the DiagnosticDataTableResponseColumn object itself. - */ - public DiagnosticDataTableResponseColumn withColumnName(String columnName) { - this.columnName = columnName; - return this; - } - /** * Get the dataType property: Data type of the column. * @@ -66,17 +55,6 @@ public String dataType() { return this.dataType; } - /** - * Set the dataType property: Data type of the column. - * - * @param dataType the dataType value to set. - * @return the DiagnosticDataTableResponseColumn object itself. - */ - public DiagnosticDataTableResponseColumn withDataType(String dataType) { - this.dataType = dataType; - return this; - } - /** * Get the columnType property: Column type. * @@ -86,25 +64,6 @@ public String columnType() { return this.columnType; } - /** - * Set the columnType property: Column type. - * - * @param columnType the columnType value to set. - * @return the DiagnosticDataTableResponseColumn object itself. - */ - public DiagnosticDataTableResponseColumn withColumnType(String columnType) { - this.columnType = columnType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataTableResponseObject.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataTableResponseObject.java index a82b400f3b2a..29871dbb8b49 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataTableResponseObject.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticDataTableResponseObject.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Diagnostics data table. */ -@Fluent +@Immutable public final class DiagnosticDataTableResponseObject implements JsonSerializable { /* * Table name @@ -35,7 +35,7 @@ public final class DiagnosticDataTableResponseObject implements JsonSerializable /** * Creates an instance of DiagnosticDataTableResponseObject class. */ - public DiagnosticDataTableResponseObject() { + private DiagnosticDataTableResponseObject() { } /** @@ -47,17 +47,6 @@ public String tableName() { return this.tableName; } - /** - * Set the tableName property: Table name. - * - * @param tableName the tableName value to set. - * @return the DiagnosticDataTableResponseObject object itself. - */ - public DiagnosticDataTableResponseObject withTableName(String tableName) { - this.tableName = tableName; - return this; - } - /** * Get the columns property: Columns in the table. * @@ -67,17 +56,6 @@ public List columns() { return this.columns; } - /** - * Set the columns property: Columns in the table. - * - * @param columns the columns value to set. - * @return the DiagnosticDataTableResponseObject object itself. - */ - public DiagnosticDataTableResponseObject withColumns(List columns) { - this.columns = columns; - return this; - } - /** * Get the rows property: Rows in the table. * @@ -87,28 +65,6 @@ public List rows() { return this.rows; } - /** - * Set the rows property: Rows in the table. - * - * @param rows the rows value to set. - * @return the DiagnosticDataTableResponseObject object itself. - */ - public DiagnosticDataTableResponseObject withRows(List rows) { - this.rows = rows; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (columns() != null) { - columns().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticRendering.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticRendering.java index 221b8fc25e2f..2c624402110f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticRendering.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticRendering.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Rendering details of a diagnostics table. */ -@Fluent +@Immutable public final class DiagnosticRendering implements JsonSerializable { /* * Rendering type @@ -39,7 +39,7 @@ public final class DiagnosticRendering implements JsonSerializable value(); /** - * Gets the nextLink property: Link to next page of resources. + * Gets the nextLink property: The link to the next page of items. * * @return the nextLink value. */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsDataApiResponse.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsDataApiResponse.java index 9640d9549aaf..97b1d3ab5d59 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsDataApiResponse.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsDataApiResponse.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Diagnostics data returned from a detector. */ -@Fluent +@Immutable public final class DiagnosticsDataApiResponse implements JsonSerializable { /* * Table response @@ -29,7 +29,7 @@ public final class DiagnosticsDataApiResponse implements JsonSerializable { /* * Unique detector name @@ -65,7 +65,7 @@ public final class DiagnosticsDefinition implements JsonSerializable supportTopicList() { return this.supportTopicList; } - /** - * Set the supportTopicList property: List of support topics. - * - * @param supportTopicList the supportTopicList value to set. - * @return the DiagnosticsDefinition object itself. - */ - public DiagnosticsDefinition withSupportTopicList(List supportTopicList) { - this.supportTopicList = supportTopicList; - return this; - } - /** * Get the analysisTypes property: List of analysis types. * @@ -142,17 +131,6 @@ public List analysisTypes() { return this.analysisTypes; } - /** - * Set the analysisTypes property: List of analysis types. - * - * @param analysisTypes the analysisTypes value to set. - * @return the DiagnosticsDefinition object itself. - */ - public DiagnosticsDefinition withAnalysisTypes(List analysisTypes) { - this.analysisTypes = analysisTypes; - return this; - } - /** * Get the type property: Authors' names of the detector. * @@ -171,17 +149,6 @@ public Float score() { return this.score; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (supportTopicList() != null) { - supportTopicList().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsProperties.java index 47f7ea5cdb9c..7905ece80a3f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Diagnostics resource specific properties. */ -@Fluent +@Immutable public final class DiagnosticsProperties implements JsonSerializable { /* * Metadata of the diagnostics response. @@ -40,7 +40,7 @@ public final class DiagnosticsProperties implements JsonSerializable dataset() { return this.dataset; } - /** - * Set the dataset property: Set of data collections associated with the response. - * - * @param dataset the dataset value to set. - * @return the DiagnosticsProperties object itself. - */ - public DiagnosticsProperties withDataset(List dataset) { - this.dataset = dataset; - return this; - } - /** * Get the status property: Status of the diagnostics response. * @@ -92,17 +70,6 @@ public DiagnosticsStatus status() { return this.status; } - /** - * Set the status property: Status of the diagnostics response. - * - * @param status the status value to set. - * @return the DiagnosticsProperties object itself. - */ - public DiagnosticsProperties withStatus(DiagnosticsStatus status) { - this.status = status; - return this; - } - /** * Get the dataProviderMetadata property: List of data providers' metadata. * @@ -112,37 +79,6 @@ public DiagnosticDataProviderMetadata dataProviderMetadata() { return this.dataProviderMetadata; } - /** - * Set the dataProviderMetadata property: List of data providers' metadata. - * - * @param dataProviderMetadata the dataProviderMetadata value to set. - * @return the DiagnosticsProperties object itself. - */ - public DiagnosticsProperties withDataProviderMetadata(DiagnosticDataProviderMetadata dataProviderMetadata) { - this.dataProviderMetadata = dataProviderMetadata; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (metadata() != null) { - metadata().validate(); - } - if (dataset() != null) { - dataset().forEach(e -> e.validate()); - } - if (status() != null) { - status().validate(); - } - if (dataProviderMetadata() != null) { - dataProviderMetadata().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsStatus.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsStatus.java index 4514cbddf3c8..3ac12481ec84 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsStatus.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DiagnosticsStatus.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Rendering details of a diagnostics table. */ -@Fluent +@Immutable public final class DiagnosticsStatus implements JsonSerializable { /* * Diagnostic message @@ -29,7 +29,7 @@ public final class DiagnosticsStatus implements JsonSerializable 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 000000000000..470163e7cea0 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentConfigurationProperty.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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 000000000000..1cc25736160a --- /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) TypeSpec 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 { + /** + * The .NET component was provisioned successfully. + */ + public static final DotNetComponentProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * The .NET component failed to provision. + */ + public static final DotNetComponentProvisioningState FAILED = fromString("Failed"); + + /** + * Provisioning of the .NET component was canceled. + */ + public static final DotNetComponentProvisioningState CANCELED = fromString("Canceled"); + + /** + * The .NET component is being deleted. + */ + public static final DotNetComponentProvisioningState DELETING = fromString("Deleting"); + + /** + * The .NET component is being provisioned. + */ + 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 000000000000..3c3be2006af4 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponentServiceBind.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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 000000000000..5f2a44bf44c6 --- /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) TypeSpec 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 { + /** + * An Aspire dashboard component. + */ + 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 000000000000..4535b58033b0 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DotNetComponents.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 a .NET Component. + * + * Gets the details of 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 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. + * + * Gets the details of a .NET component in a managed environment along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String environmentName, String name, + Context context); + + /** + * Get a .NET Component. + * + * Gets the details of 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. + * @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. + * + * Gets the details of a .NET component in a managed environment. + */ + DotNetComponent get(String resourceGroupName, String environmentName, String name); + + /** + * Delete a .NET Component. + * + * Deletes a .NET component 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 .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. + * + * Deletes a .NET component 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 .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 the .NET Components for a managed environment. + * + * Lists the .NET components in 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. + * + * Lists the .NET components in a managed environment as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName); + + /** + * Get the .NET Components for a managed environment. + * + * Lists the .NET components 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 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. + * + * Lists the .NET components in a managed environment as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName, Context context); + + /** + * Get a .NET Component. + * + * Gets the details of a .NET component in a 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 .NET Component. + * + * Gets the details of a .NET component in a managed environment along with {@link Response}. + */ + DotNetComponent getById(String id); + + /** + * Get a .NET Component. + * + * Gets the details of a .NET component in 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.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. + * + * Gets the details of a .NET component in a managed environment along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a .NET Component. + * + * Deletes a .NET component from a 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 .NET Component. + * + * Deletes a .NET component 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.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/DynamicPoolConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DynamicPoolConfiguration.java index 477c946d64b0..213d1373af71 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -47,17 +47,6 @@ public DynamicPoolConfiguration withLifecycleConfiguration(LifecycleConfiguratio return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (lifecycleConfiguration() != null) { - lifecycleConfiguration().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EncryptionSettings.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EncryptionSettings.java index af0d032eca02..1dfe666f5eb0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EncryptionSettings.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EncryptionSettings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -73,14 +73,6 @@ public EncryptionSettings withContainerAppAuthSigningSecretName(String container return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentAuthToken.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentAuthToken.java index 46933f2d9ed0..071b5e8da915 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentAuthToken.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentAuthToken.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentProvisioningState.java index ae124cc770b2..2ea785070559 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,55 +12,55 @@ */ public final class EnvironmentProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for EnvironmentProvisioningState. + * Succeeded. */ public static final EnvironmentProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for EnvironmentProvisioningState. + * Failed. */ public static final EnvironmentProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for EnvironmentProvisioningState. + * Canceled. */ public static final EnvironmentProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Waiting for EnvironmentProvisioningState. + * Waiting. */ public static final EnvironmentProvisioningState WAITING = fromString("Waiting"); /** - * Static value InitializationInProgress for EnvironmentProvisioningState. + * InitializationInProgress. */ public static final EnvironmentProvisioningState INITIALIZATION_IN_PROGRESS = fromString("InitializationInProgress"); /** - * Static value InfrastructureSetupInProgress for EnvironmentProvisioningState. + * InfrastructureSetupInProgress. */ public static final EnvironmentProvisioningState INFRASTRUCTURE_SETUP_IN_PROGRESS = fromString("InfrastructureSetupInProgress"); /** - * Static value InfrastructureSetupComplete for EnvironmentProvisioningState. + * InfrastructureSetupComplete. */ public static final EnvironmentProvisioningState INFRASTRUCTURE_SETUP_COMPLETE = fromString("InfrastructureSetupComplete"); /** - * Static value ScheduledForDelete for EnvironmentProvisioningState. + * ScheduledForDelete. */ public static final EnvironmentProvisioningState SCHEDULED_FOR_DELETE = fromString("ScheduledForDelete"); /** - * Static value UpgradeRequested for EnvironmentProvisioningState. + * UpgradeRequested. */ public static final EnvironmentProvisioningState UPGRADE_REQUESTED = fromString("UpgradeRequested"); /** - * Static value UpgradeFailed for EnvironmentProvisioningState. + * UpgradeFailed. */ public static final EnvironmentProvisioningState UPGRADE_FAILED = fromString("UpgradeFailed"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentVar.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentVar.java index 3f9385a95d30..e730f5d5f3e2 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentVar.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentVar.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -97,14 +97,6 @@ public EnvironmentVar withSecretRef(String secretRef) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index cae94ab237ff..88bff92a7b15 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Body of the error response returned from the API. */ -@Fluent +@Immutable public final class ErrorEntity implements JsonSerializable { /* * Type of error. @@ -60,7 +60,7 @@ public final class ErrorEntity implements JsonSerializable { /** * Creates an instance of ErrorEntity class. */ - public ErrorEntity() { + private ErrorEntity() { } /** @@ -72,17 +72,6 @@ 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. * @@ -92,17 +81,6 @@ 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. * @@ -112,17 +90,6 @@ 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. * @@ -132,17 +99,6 @@ 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. * @@ -152,17 +108,6 @@ 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. * @@ -172,17 +117,6 @@ 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. * @@ -192,17 +126,6 @@ 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. * @@ -212,31 +135,6 @@ 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} */ 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 000000000000..5a4a2d82eb28 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExecutionStatus.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +/** + * Container Apps Job execution status. + */ +@Immutable +public final class ExecutionStatus implements JsonSerializable { + /* + * Replicas in the execution. + */ + private List replicas; + + /** + * Creates an instance of ExecutionStatus class. + */ + private ExecutionStatus() { + } + + /** + * Get the replicas property: Replicas in the execution. + * + * @return the replicas value. + */ + public List replicas() { + return this.replicas; + } + + /** + * {@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/ExtendedLocation.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExtendedLocation.java index 9aba5ee961a6..dd385ca8480e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExtendedLocation.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExtendedLocation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -72,14 +72,6 @@ public ExtendedLocation withType(ExtendedLocationTypes type) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExtendedLocationTypes.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExtendedLocationTypes.java index 4fa976b9cf7a..b806eda47194 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExtendedLocationTypes.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ExtendedLocationTypes.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,7 +12,7 @@ */ public final class ExtendedLocationTypes extends ExpandableStringEnum { /** - * Static value CustomLocation for ExtendedLocationTypes. + * CustomLocation. */ public static final ExtendedLocationTypes CUSTOM_LOCATION = fromString("CustomLocation"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Facebook.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Facebook.java index aa1dc33ec6e7..39ce31e4fc9a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Facebook.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Facebook.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -125,20 +125,6 @@ public Facebook withLogin(LoginScopes login) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (registration() != null) { - registration().validate(); - } - if (login() != null) { - login().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ForwardProxy.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ForwardProxy.java index e801d06ae074..a7aec4fc1f10 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ForwardProxy.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ForwardProxy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -97,14 +97,6 @@ public ForwardProxy withCustomProtoHeaderName(String customProtoHeaderName) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ForwardProxyConvention.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ForwardProxyConvention.java index 09328d7ffc58..759a6eeeef2b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ForwardProxyConvention.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ForwardProxyConvention.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -9,17 +9,17 @@ */ public enum ForwardProxyConvention { /** - * Enum value NoProxy. + * NoProxy. */ NO_PROXY("NoProxy"), /** - * Enum value Standard. + * Standard. */ STANDARD("Standard"), /** - * Enum value Custom. + * Custom. */ CUSTOM("Custom"); 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 000000000000..dd89cdd6ae27 --- /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) TypeSpec 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. + * @param functionAppName Name of the Function. + * @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 sequence of textual characters 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. + * @param functionAppName Name of the Function. + * @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 sequence of textual characters. + */ + 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/GitHub.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GitHub.java index 7b8bffb3e23d..e405359c0a27 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GitHub.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GitHub.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -100,20 +100,6 @@ public GitHub withLogin(LoginScopes login) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (registration() != null) { - registration().validate(); - } - if (login() != null) { - login().validate(); - } - } - /** * {@inheritDoc} */ 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 4d06f4ad64f2..c99f084f765a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -247,20 +247,6 @@ public GithubActionConfiguration withRuntimeVersion(String runtimeVersion) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (registryInfo() != null) { - registryInfo().validate(); - } - if (azureCredentials() != null) { - azureCredentials().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GlobalValidation.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GlobalValidation.java index 6038833d1ef3..3213716d7421 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GlobalValidation.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/GlobalValidation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -111,14 +111,6 @@ public GlobalValidation withExcludedPaths(List excludedPaths) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Google.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Google.java index dd44d71ca9ea..c7ffb0ac2dd0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Google.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Google.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -125,23 +125,6 @@ public Google withValidation(AllowedAudiencesValidation validation) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (registration() != null) { - registration().validate(); - } - if (login() != null) { - login().validate(); - } - if (validation() != null) { - validation().validate(); - } - } - /** * {@inheritDoc} */ 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 000000000000..2a4c631b9431 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Header.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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/HttpRoute.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRoute.java index aff193b8a9e7..c4814b7e77a0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRoute.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRoute.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -72,20 +72,6 @@ public HttpRoute withAction(HttpRouteAction action) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (match() != null) { - match().validate(); - } - if (action() != null) { - action().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteAction.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteAction.java index 8e3e1af00936..52e01a22879f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteAction.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteAction.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -47,14 +47,6 @@ public HttpRouteAction withPrefixRewrite(String prefixRewrite) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteConfig.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteConfig.java index f71a6154c09d..edcc0771bde0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteConfig.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteConfig.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -86,7 +86,7 @@ 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. + * @param environmentName Name of the managed environment. * @return the next definition stage. */ WithCreate withExistingManagedEnvironment(String resourceGroupName, String environmentName); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteConfigProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteConfigProperties.java index 569f0a8fe8b5..4f90de8aba28 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteConfigProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteConfigProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -18,7 +18,7 @@ @Fluent public final class HttpRouteConfigProperties implements JsonSerializable { /* - * The provisioning state of the Http Route Config + * The provisioning state of the Http Route Config in cluster */ private HttpRouteProvisioningState provisioningState; @@ -33,12 +33,12 @@ public final class HttpRouteConfigProperties implements JsonSerializable customDomains; /* - * Routing Rules for the Http Route resource. + * Routing Rules for http route resource. */ private List rules; @@ -49,7 +49,7 @@ public HttpRouteConfigProperties() { } /** - * Get the provisioningState property: The provisioning state of the Http Route Config. + * Get the provisioningState property: The provisioning state of the Http Route Config in cluster. * * @return the provisioningState value. */ @@ -76,7 +76,7 @@ public String fqdn() { } /** - * Get the customDomains property: Custom domain bindings for Http Routes' hostnames. + * Get the customDomains property: Custom domain bindings for http Routes' hostnames. * * @return the customDomains value. */ @@ -85,7 +85,7 @@ public List customDomains() { } /** - * Set the customDomains property: Custom domain bindings for Http Routes' hostnames. + * Set the customDomains property: Custom domain bindings for http Routes' hostnames. * * @param customDomains the customDomains value to set. * @return the HttpRouteConfigProperties object itself. @@ -96,7 +96,7 @@ public HttpRouteConfigProperties withCustomDomains(List customDoma } /** - * Get the rules property: Routing Rules for the Http Route resource. + * Get the rules property: Routing Rules for http route resource. * * @return the rules value. */ @@ -105,7 +105,7 @@ public List rules() { } /** - * Set the rules property: Routing Rules for the Http Route resource. + * Set the rules property: Routing Rules for http route resource. * * @param rules the rules value to set. * @return the HttpRouteConfigProperties object itself. @@ -115,23 +115,6 @@ public HttpRouteConfigProperties withRules(List rules) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (provisioningErrors() != null) { - provisioningErrors().forEach(e -> e.validate()); - } - if (customDomains() != null) { - customDomains().forEach(e -> e.validate()); - } - if (rules() != null) { - rules().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteConfigs.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteConfigs.java index 77e3ee471d2a..7c73b581c8ac 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteConfigs.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteConfigs.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -15,15 +15,19 @@ public interface HttpRouteConfigs { /** * Get the specified Http Route Config. * + * Get the specified Managed Http Route Config. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. - * @param httpRouteName Name of the Http Route Config Resource. + * @param environmentName Name of the managed environment. + * @param httpRouteName Name of the Http Route Config. * @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 specified Http Route Config along with {@link Response}. + * @return the specified Http Route Config. + * + * Get the specified Managed Http Route Config along with {@link Response}. */ Response getWithResponse(String resourceGroupName, String environmentName, String httpRouteName, Context context); @@ -31,22 +35,28 @@ Response getWithResponse(String resourceGroupName, String envir /** * Get the specified Http Route Config. * + * Get the specified Managed Http Route Config. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. - * @param httpRouteName Name of the Http Route Config Resource. + * @param environmentName Name of the managed environment. + * @param httpRouteName Name of the Http Route Config. * @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 specified Http Route Config. + * + * Get the specified Managed Http Route Config. */ HttpRouteConfig get(String resourceGroupName, String environmentName, String httpRouteName); /** * Deletes the specified Http Route Config. * + * Deletes the specified Managed Http Route. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param httpRouteName Name of the Http Route Config Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -57,8 +67,10 @@ Response getWithResponse(String resourceGroupName, String envir /** * Deletes the specified Http Route Config. * + * Deletes the specified Managed Http Route. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param httpRouteName Name of the Http Route Config Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -70,8 +82,10 @@ Response getWithResponse(String resourceGroupName, String envir /** * List the Http Route Configs in a given managed environment. * + * Get the Managed Http Routes in 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 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. @@ -83,8 +97,10 @@ Response getWithResponse(String resourceGroupName, String envir /** * List the Http Route Configs in a given managed environment. * + * Get the Managed Http Routes in 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 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 @@ -97,31 +113,41 @@ Response getWithResponse(String resourceGroupName, String envir /** * Get the specified Http Route Config. * + * Get the specified Managed Http Route Config. + * * @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 specified Http Route Config along with {@link Response}. + * @return the specified Http Route Config. + * + * Get the specified Managed Http Route Config along with {@link Response}. */ HttpRouteConfig getById(String id); /** * Get the specified Http Route Config. * + * Get the specified Managed Http Route Config. + * * @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 specified Http Route Config along with {@link Response}. + * @return the specified Http Route Config. + * + * Get the specified Managed Http Route Config along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); /** * Deletes the specified Http Route Config. * + * Deletes the specified Managed Http Route. + * * @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. @@ -132,6 +158,8 @@ Response getWithResponse(String resourceGroupName, String envir /** * Deletes the specified Http Route Config. * + * Deletes the specified Managed Http Route. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteMatch.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteMatch.java index ff553b2b59d3..8a8bdf17a250 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteMatch.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteMatch.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -122,14 +122,6 @@ public HttpRouteMatch withCaseSensitive(Boolean caseSensitive) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteProvisioningErrors.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteProvisioningErrors.java index 080bf68d5e99..c8f69854782f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteProvisioningErrors.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteProvisioningErrors.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -31,7 +31,7 @@ public final class HttpRouteProvisioningErrors implements JsonSerializable { /** - * Static value Succeeded for HttpRouteProvisioningState. + * Succeeded. */ public static final HttpRouteProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for HttpRouteProvisioningState. + * Failed. */ public static final HttpRouteProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for HttpRouteProvisioningState. + * Canceled. */ public static final HttpRouteProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Waiting for HttpRouteProvisioningState. + * Waiting. */ public static final HttpRouteProvisioningState WAITING = fromString("Waiting"); /** - * Static value Updating for HttpRouteProvisioningState. + * Updating. */ public static final HttpRouteProvisioningState UPDATING = fromString("Updating"); /** - * Static value Deleting for HttpRouteProvisioningState. + * Deleting. */ public static final HttpRouteProvisioningState DELETING = fromString("Deleting"); /** - * Static value Pending for HttpRouteProvisioningState. + * Pending. */ public static final HttpRouteProvisioningState PENDING = fromString("Pending"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteRule.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteRule.java index a169261ddcc6..0954aff4e337 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteRule.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteRule.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -98,20 +98,6 @@ public HttpRouteRule withDescription(String description) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (targets() != null) { - targets().forEach(e -> e.validate()); - } - if (routes() != null) { - routes().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteTarget.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteTarget.java index 05ce8c0b7b51..3d6e4ed81b34 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteTarget.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpRouteTarget.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -98,20 +97,6 @@ public HttpRouteTarget withLabel(String label) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (containerApp() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property containerApp in model HttpRouteTarget")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(HttpRouteTarget.class); - /** * {@inheritDoc} */ 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 9624ae09d213..be35e5f78477 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -102,17 +102,6 @@ public HttpScaleRule withIdentity(String identity) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (auth() != null) { - auth().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpSettings.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpSettings.java index b886a17dfa2e..7688b69f3eb1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpSettings.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpSettings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -101,20 +101,6 @@ public HttpSettings withForwardProxy(ForwardProxy forwardProxy) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (routes() != null) { - routes().validate(); - } - if (forwardProxy() != null) { - forwardProxy().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpSettingsRoutes.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpSettingsRoutes.java index f37d6f68d3e0..cb8304ee4943 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpSettingsRoutes.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/HttpSettingsRoutes.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -47,14 +47,6 @@ public HttpSettingsRoutes withApiPrefix(String apiPrefix) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IdentityProviders.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IdentityProviders.java index ae59391c0d2d..9c391a8fc426 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IdentityProviders.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IdentityProviders.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -230,42 +230,6 @@ public Map customOpenIdConnectProviders() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (azureActiveDirectory() != null) { - azureActiveDirectory().validate(); - } - if (facebook() != null) { - facebook().validate(); - } - if (gitHub() != null) { - gitHub().validate(); - } - if (google() != null) { - google().validate(); - } - if (twitter() != null) { - twitter().validate(); - } - if (apple() != null) { - apple().validate(); - } - if (azureStaticWebApps() != null) { - azureStaticWebApps().validate(); - } - if (customOpenIdConnectProviders() != null) { - customOpenIdConnectProviders().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - } - /** * {@inheritDoc} */ 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 index 700777e85038..19022d03c0e7 100644 --- 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -78,20 +77,6 @@ public IdentitySettings withLifecycle(IdentitySettingsLifeCycle 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} */ 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 index 3df9c4c12245..75995df1c308 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,22 +12,22 @@ */ public final class IdentitySettingsLifeCycle extends ExpandableStringEnum { /** - * Static value Init for IdentitySettingsLifeCycle. + * Do not use managed identity during any lifecycle stage. */ - public static final IdentitySettingsLifeCycle INIT = fromString("Init"); + public static final IdentitySettingsLifeCycle NONE = fromString("None"); /** - * Static value Main for IdentitySettingsLifeCycle. + * Use managed identity during the main stage of the Container App lifecycle. */ public static final IdentitySettingsLifeCycle MAIN = fromString("Main"); /** - * Static value None for IdentitySettingsLifeCycle. + * Use managed identity during the init stage of the Container App lifecycle. */ - public static final IdentitySettingsLifeCycle NONE = fromString("None"); + public static final IdentitySettingsLifeCycle INIT = fromString("Init"); /** - * Static value All for IdentitySettingsLifeCycle. + * Use managed identity during all lifecycle stages of the Container App. */ public static final IdentitySettingsLifeCycle ALL = fromString("All"); 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 f06b3c3f2df7..a6f4e9721857 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -346,32 +346,6 @@ public Ingress withAdditionalPortMappings(List additionalPor return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (traffic() != null) { - traffic().forEach(e -> e.validate()); - } - if (customDomains() != null) { - customDomains().forEach(e -> e.validate()); - } - if (ipSecurityRestrictions() != null) { - ipSecurityRestrictions().forEach(e -> e.validate()); - } - if (stickySessions() != null) { - stickySessions().validate(); - } - if (corsPolicy() != null) { - corsPolicy().validate(); - } - if (additionalPortMappings() != null) { - additionalPortMappings().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressClientCertificateMode.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressClientCertificateMode.java index f5608a399d61..5fcafd198f7a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressClientCertificateMode.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressClientCertificateMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -14,17 +14,17 @@ */ public final class IngressClientCertificateMode extends ExpandableStringEnum { /** - * Static value ignore for IngressClientCertificateMode. + * ignore. */ public static final IngressClientCertificateMode IGNORE = fromString("ignore"); /** - * Static value accept for IngressClientCertificateMode. + * accept. */ public static final IngressClientCertificateMode ACCEPT = fromString("accept"); /** - * Static value require for IngressClientCertificateMode. + * require. */ public static final IngressClientCertificateMode REQUIRE = fromString("require"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressConfiguration.java index 5e2b7263b88c..49abec656e54 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -130,14 +130,6 @@ public IngressConfiguration withRequestIdleTimeout(Integer requestIdleTimeout) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressPortMapping.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressPortMapping.java index a63a4cc5c689..b3786c396183 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressPortMapping.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressPortMapping.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -99,14 +99,6 @@ public IngressPortMapping withExposedPort(Integer exposedPort) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressStickySessions.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressStickySessions.java index 7db79d0ba2d7..00ea052023bf 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressStickySessions.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressStickySessions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -47,14 +47,6 @@ public IngressStickySessions withAffinity(Affinity affinity) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressTransportMethod.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressTransportMethod.java index b8c6fd366086..7995ab7987c6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressTransportMethod.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressTransportMethod.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,22 +12,22 @@ */ public final class IngressTransportMethod extends ExpandableStringEnum { /** - * Static value auto for IngressTransportMethod. + * auto. */ public static final IngressTransportMethod AUTO = fromString("auto"); /** - * Static value http for IngressTransportMethod. + * http. */ public static final IngressTransportMethod HTTP = fromString("http"); /** - * Static value http2 for IngressTransportMethod. + * http2. */ public static final IngressTransportMethod HTTP2 = fromString("http2"); /** - * Static value tcp for IngressTransportMethod. + * tcp. */ public static final IngressTransportMethod TCP = fromString("tcp"); 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 0b6a44491d2e..a7983a60f93a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -85,24 +85,6 @@ public InitContainer withVolumeMounts(List volumeMounts) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (env() != null) { - env().forEach(e -> e.validate()); - } - if (resources() != null) { - resources().validate(); - } - if (volumeMounts() != null) { - volumeMounts().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IpSecurityRestrictionRule.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IpSecurityRestrictionRule.java index 26c3df77d00e..798e5010f7f7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IpSecurityRestrictionRule.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IpSecurityRestrictionRule.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -127,30 +126,6 @@ public IpSecurityRestrictionRule withAction(Action action) { 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 IpSecurityRestrictionRule")); - } - if (ipAddressRange() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property ipAddressRange in model IpSecurityRestrictionRule")); - } - if (action() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property action in model IpSecurityRestrictionRule")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(IpSecurityRestrictionRule.class); - /** * {@inheritDoc} */ 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 index 0faa35c4e557..771c29fca972 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -86,7 +86,7 @@ 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. + * @param environmentName Name of the managed environment. * @return the next definition stage. */ WithCreate withExistingManagedEnvironment(String resourceGroupName, String environmentName); 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 index 923aae747536..f13a1cc7c498 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -72,14 +72,6 @@ public JavaComponentConfigurationProperty withValue(String value) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index bf0d5ec6b725..e468a49a3a15 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -36,14 +36,6 @@ public String fqdn() { return this.fqdn; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index 06ba2752603c..7cdb6d940ed4 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -137,23 +137,6 @@ public JavaComponentProperties withServiceBinds(List s 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} */ 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 index 52f374b5767e..aeb8444a8c07 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -72,14 +72,6 @@ public JavaComponentPropertiesScale withMaxReplicas(Integer maxReplicas) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index 74f85932f5fa..9d7c5347fd02 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,27 +12,27 @@ */ public final class JavaComponentProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for JavaComponentProvisioningState. + * Succeeded. */ public static final JavaComponentProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for JavaComponentProvisioningState. + * Failed. */ public static final JavaComponentProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for JavaComponentProvisioningState. + * Canceled. */ public static final JavaComponentProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Deleting for JavaComponentProvisioningState. + * Deleting. */ public static final JavaComponentProvisioningState DELETING = fromString("Deleting"); /** - * Static value InProgress for JavaComponentProvisioningState. + * InProgress. */ public static final JavaComponentProvisioningState IN_PROGRESS = fromString("InProgress"); 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 index d09561fc2907..a3eb5856c683 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -72,14 +72,6 @@ public JavaComponentServiceBind withServiceId(String serviceId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index 6991bbaf0a90..edfa3875fab0 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,17 +12,17 @@ */ public final class JavaComponentType extends ExpandableStringEnum { /** - * Static value SpringBootAdmin for JavaComponentType. + * SpringBootAdmin. */ public static final JavaComponentType SPRING_BOOT_ADMIN = fromString("SpringBootAdmin"); /** - * Static value SpringCloudEureka for JavaComponentType. + * SpringCloudEureka. */ public static final JavaComponentType SPRING_CLOUD_EUREKA = fromString("SpringCloudEureka"); /** - * Static value SpringCloudConfig for JavaComponentType. + * SpringCloudConfig. */ public static final JavaComponentType SPRING_CLOUD_CONFIG = fromString("SpringCloudConfig"); 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 index 5ea71455d5b4..c0dc44adbc9b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,36 +12,11 @@ * 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 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. @@ -56,7 +31,7 @@ Response getWithResponse(String resourceGroupName, String environ * 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 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. @@ -71,7 +46,7 @@ Response getWithResponse(String resourceGroupName, String environ * 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 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. @@ -85,7 +60,7 @@ Response getWithResponse(String resourceGroupName, String environ * 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 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. @@ -94,6 +69,31 @@ Response getWithResponse(String resourceGroupName, String environ */ void delete(String resourceGroupName, String environmentName, String name, 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 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. * 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 705ec61cb7ab..0c406b9eafd1 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -52,8 +52,7 @@ public interface Job { Map tags(); /** - * 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. + * Gets the identity property: The managed service identities assigned to this resource. * * @return the identity value. */ @@ -73,6 +72,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. * @@ -235,11 +241,9 @@ interface WithTags { */ interface WithIdentity { /** - * Specifies 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.. + * Specifies the identity property: The managed service identities assigned to this resource.. * - * @param identity Managed identities needed by a container app job to interact with other Azure services to - * not maintain any secrets or credentials in code. + * @param identity The managed service identities assigned to this resource. * @return the next definition stage. */ WithCreate withIdentity(ManagedServiceIdentity identity); @@ -363,9 +367,9 @@ interface WithIdentity { */ interface WithProperties { /** - * Specifies the properties property: The properties property.. + * Specifies the properties property: Container Apps Job patch resource properties.. * - * @param properties The properties property. + * @param properties Container Apps Job patch resource properties. * @return the next definition stage. */ Update withProperties(JobPatchPropertiesProperties properties); @@ -453,4 +457,52 @@ interface WithProperties { * @return container Apps Job Secrets Collection ARM resource. */ JobSecretsCollection listSecrets(); + + /** + * Resumes a suspended job + * + * Resumes execution for a suspended Container Apps 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 + * + * Resumes execution for a suspended Container Apps 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 + * + * Suspends execution for a running Container Apps 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 + * + * Suspends execution for a running Container Apps 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 5f8e8c2f509a..3fd935cb4efe 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -258,38 +257,6 @@ public JobConfiguration withIdentitySettings(List identitySett return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (secrets() != null) { - secrets().forEach(e -> e.validate()); - } - if (triggerType() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property triggerType in model JobConfiguration")); - } - if (manualTriggerConfig() != null) { - manualTriggerConfig().validate(); - } - if (scheduleTriggerConfig() != null) { - scheduleTriggerConfig().validate(); - } - if (eventTriggerConfig() != null) { - eventTriggerConfig().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); - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationEventTriggerConfig.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationEventTriggerConfig.java index 583fc0410cf3..e7a0fcebcea0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationEventTriggerConfig.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationEventTriggerConfig.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -99,17 +99,6 @@ public JobConfigurationEventTriggerConfig withScale(JobScale scale) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (scale() != null) { - scale().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationManualTriggerConfig.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationManualTriggerConfig.java index 70349f5ae83c..9c70e6d8e4c0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationManualTriggerConfig.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationManualTriggerConfig.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -76,14 +76,6 @@ public JobConfigurationManualTriggerConfig withParallelism(Integer parallelism) return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationScheduleTriggerConfig.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationScheduleTriggerConfig.java index 935e05c9fca0..1c4ddeec51c8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationScheduleTriggerConfig.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationScheduleTriggerConfig.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -102,21 +101,6 @@ public JobConfigurationScheduleTriggerConfig withParallelism(Integer parallelism return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (cronExpression() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property cronExpression in model JobConfigurationScheduleTriggerConfig")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(JobConfigurationScheduleTriggerConfig.class); - /** * {@inheritDoc} */ 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 cf83584a4386..4024bb0d42fe 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 @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionInner; import java.time.OffsetDateTime; @@ -12,26 +13,33 @@ */ public interface JobExecution { /** - * Gets the name property: Job execution Name. + * Gets the id property: Fully qualified resource Id for the resource. * - * @return the name value. + * @return the id value. */ - String name(); + String id(); /** - * Gets the id property: Job execution Id. + * Gets the name property: The name of the resource. * - * @return the id value. + * @return the name value. */ - String id(); + String name(); /** - * Gets the type property: Job execution type. + * 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 status property: Current running State of the job. * @@ -60,6 +68,28 @@ public interface JobExecution { */ JobExecutionTemplate template(); + /** + * Gets the detailedStatus property: Detailed status of the job execution. + * + * @return the detailedStatus value. + */ + ExecutionStatus detailedStatus(); + + /** + * Gets the reason property: Reason for the current condition of job execution. + * + * @return the reason value. + */ + String reason(); + + /** + * Gets the message property: Human readable message indicating details about the current condition of the job + * execution. + * + * @return the message value. + */ + String message(); + /** * 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/JobExecutionBase.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionBase.java index 9a987dc30d60..65343ab278b9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionBase.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionBase.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionContainer.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionContainer.java index 483f1ddc4b94..8ec4ccef7806 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionContainer.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionContainer.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -173,20 +173,6 @@ public JobExecutionContainer withResources(ContainerResources 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} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionRunningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionRunningState.java index c8f20477420e..1f6ea9753c00 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionRunningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionRunningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,37 +12,37 @@ */ public final class JobExecutionRunningState extends ExpandableStringEnum { /** - * Static value Running for JobExecutionRunningState. + * Running. */ public static final JobExecutionRunningState RUNNING = fromString("Running"); /** - * Static value Processing for JobExecutionRunningState. + * Processing. */ public static final JobExecutionRunningState PROCESSING = fromString("Processing"); /** - * Static value Stopped for JobExecutionRunningState. + * Stopped. */ public static final JobExecutionRunningState STOPPED = fromString("Stopped"); /** - * Static value Degraded for JobExecutionRunningState. + * Degraded. */ public static final JobExecutionRunningState DEGRADED = fromString("Degraded"); /** - * Static value Failed for JobExecutionRunningState. + * Failed. */ public static final JobExecutionRunningState FAILED = fromString("Failed"); /** - * Static value Unknown for JobExecutionRunningState. + * Unknown. */ public static final JobExecutionRunningState UNKNOWN = fromString("Unknown"); /** - * Static value Succeeded for JobExecutionRunningState. + * Succeeded. */ public static final JobExecutionRunningState SUCCEEDED = fromString("Succeeded"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionTemplate.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionTemplate.java index 1bb37ef45909..adea80873a9e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionTemplate.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionTemplate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -73,20 +73,6 @@ public JobExecutionTemplate withInitContainers(List initC 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()); - } - if (initContainers() != null) { - initContainers().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ 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 32de8d05cc33..fd4b83e01826 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -29,7 +29,7 @@ public final class JobPatchProperties implements JsonSerializable tags; /* - * The properties property. + * Container Apps Job patch resource properties. */ private JobPatchPropertiesProperties properties; @@ -82,7 +82,7 @@ public JobPatchProperties withTags(Map tags) { } /** - * Get the properties property: The properties property. + * Get the properties property: Container Apps Job patch resource properties. * * @return the properties value. */ @@ -91,7 +91,7 @@ public JobPatchPropertiesProperties properties() { } /** - * Set the properties property: The properties property. + * Set the properties property: Container Apps Job patch resource properties. * * @param properties the properties value to set. * @return the JobPatchProperties object itself. @@ -101,20 +101,6 @@ public JobPatchProperties withProperties(JobPatchPropertiesProperties properties return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchPropertiesProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchPropertiesProperties.java index 3fb56c96772f..b2eabe3ae22a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchPropertiesProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchPropertiesProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -13,7 +13,7 @@ import java.util.List; /** - * The JobPatchPropertiesProperties model. + * Container Apps Job patch properties. */ @Fluent public final class JobPatchPropertiesProperties implements JsonSerializable { @@ -148,20 +148,6 @@ public JobPatchPropertiesProperties withEventStreamEndpoint(String eventStreamEn return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - if (template() != null) { - template().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobProvisioningState.java index c623bfdcef2e..f4d1fe7ac271 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,27 +12,27 @@ */ public final class JobProvisioningState extends ExpandableStringEnum { /** - * Static value InProgress for JobProvisioningState. + * InProgress. */ public static final JobProvisioningState IN_PROGRESS = fromString("InProgress"); /** - * Static value Succeeded for JobProvisioningState. + * Succeeded. */ public static final JobProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for JobProvisioningState. + * Failed. */ public static final JobProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for JobProvisioningState. + * Canceled. */ public static final JobProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Deleting for JobProvisioningState. + * Deleting. */ public static final JobProvisioningState DELETING = fromString("Deleting"); 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 000000000000..7f24acd946ce --- /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) TypeSpec 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 { + /** + * The job is ready to run. + */ + public static final JobRunningState READY = fromString("Ready"); + + /** + * The job is transitioning to its target state. + */ + public static final JobRunningState PROGRESSING = fromString("Progressing"); + + /** + * The job is suspended. + */ + 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/JobScale.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobScale.java index b19d9ada4f41..f8cb26355b49 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobScale.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobScale.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -123,17 +123,6 @@ public JobScale withRules(List rules) { 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} */ 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 3d791d94d1b6..5462453f93a2 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -23,6 +23,7 @@ public final class JobScaleRule implements JsonSerializable { private String name; /* + * * Type of the scale rule * eg: azure-servicebus, redis etc. */ @@ -39,8 +40,8 @@ public final class JobScaleRule 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. + * The resource ID of a user-assigned managed identity that is assigned to the job, or 'system' for system-assigned + * identity. */ private String identity; @@ -71,7 +72,8 @@ public JobScaleRule withName(String name) { } /** - * Get the type property: Type of the scale rule + * Get the type property: + * Type of the scale rule * eg: azure-servicebus, redis etc. * * @return the type value. @@ -81,7 +83,8 @@ public String type() { } /** - * Set the type property: Type of the scale rule + * Set the type property: + * Type of the scale rule * eg: azure-servicebus, redis etc. * * @param type the type value to set. @@ -133,8 +136,8 @@ public JobScaleRule withAuth(List auth) { } /** - * 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. + * 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. */ @@ -143,8 +146,8 @@ public String 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. + * 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. @@ -154,17 +157,6 @@ public JobScaleRule withIdentity(String identity) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (auth() != null) { - auth().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobSecretsCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobSecretsCollection.java index d7abd9c403d6..5089cb8a918a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobSecretsCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobSecretsCollection.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobTemplate.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobTemplate.java index 0ad7cf857b38..ecedfe501a2a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobTemplate.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobTemplate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -99,23 +99,6 @@ public JobTemplate withVolumes(List volumes) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (initContainers() != null) { - initContainers().forEach(e -> e.validate()); - } - if (containers() != null) { - containers().forEach(e -> e.validate()); - } - if (volumes() != null) { - volumes().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ 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 f789354e54f9..61724a129a5a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -13,98 +13,81 @@ */ public interface Jobs { /** - * Get the list of diagnostics for a given Container App Job. - * - * Get the list of diagnostics for a Container App Job. + * Get the properties of a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 the list of diagnostics for a Container App Job as paginated response with {@link PagedIterable}. + * @return the properties of a Container Apps Job along with {@link Response}. */ - PagedIterable listDetectors(String resourceGroupName, String jobName); + Response getByResourceGroupWithResponse(String resourceGroupName, String jobName, Context context); /** - * Get the list of diagnostics for a given Container App Job. - * - * Get the list of diagnostics for a Container App Job. + * Get the properties of a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 the list of diagnostics for a Container App Job as paginated response with {@link PagedIterable}. + * @return the properties of a Container Apps Job. */ - PagedIterable listDetectors(String resourceGroupName, String jobName, Context context); + Job getByResourceGroup(String resourceGroupName, String jobName); /** - * Get the diagnostics data for a given Container App Job. - * - * Get the diagnostics data for a Container App Job. + * Delete a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param detectorName Name of the Container App Job detector. - * @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 diagnostics data for a Container App Job along with {@link Response}. */ - Response getDetectorWithResponse(String resourceGroupName, String jobName, String detectorName, - Context context); + void deleteByResourceGroup(String resourceGroupName, String jobName); /** - * Get the diagnostics data for a given Container App Job. - * - * Get the diagnostics data for a Container App Job. + * Delete a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param detectorName Name of the Container App Job detector. + * @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 diagnostics data for a Container App Job. */ - Diagnostics getDetector(String resourceGroupName, String jobName, String detectorName); + void delete(String resourceGroupName, String jobName, Context context); /** - * Get the properties of a Container App Job. + * Get the Container Apps Jobs in a given resource group. * * @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 * 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 along with {@link Response}. + * @return the Container Apps Jobs in a given resource group as paginated response with {@link PagedIterable}. */ - Response proxyGetWithResponse(String resourceGroupName, String jobName, String apiName, Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Get the properties of a Container App Job. + * Get the Container Apps Jobs in a given resource group. * * @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 * 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. + * @return the Container Apps Jobs in a given resource group as paginated response with {@link PagedIterable}. */ - Job proxyGet(String resourceGroupName, String jobName, String apiName); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Get the Container Apps Jobs in a given subscription. @@ -129,109 +112,144 @@ Response getDetectorWithResponse(String resourceGroupName, String j PagedIterable list(Context context); /** - * Get the Container Apps Jobs in a given resource group. + * Start a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job 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 the Container Apps Jobs in a given resource group as paginated response with {@link PagedIterable}. + * @return container App's Job execution name. */ - PagedIterable listByResourceGroup(String resourceGroupName); + JobExecutionBase start(String resourceGroupName, String jobName); /** - * Get the Container Apps Jobs in a given resource group. + * Start a Container Apps Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param template Properties used to start a job execution. * @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 Container Apps Jobs in a given resource group as paginated response with {@link PagedIterable}. + * @return container App's Job execution name. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + JobExecutionBase start(String resourceGroupName, String jobName, JobExecutionTemplate template, Context context); /** - * Get the properties of a Container Apps Job. + * Terminates execution of a running container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 the properties of a Container Apps Job along with {@link Response}. + * @return container App executions collection ARM resource. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String jobName, Context context); + ContainerAppJobExecutions stopMultipleExecutions(String resourceGroupName, String jobName); /** - * Get the properties of a Container Apps Job. + * Terminates execution of a running container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 the properties of a Container Apps Job. + * @return container App executions collection ARM resource. */ - Job getByResourceGroup(String resourceGroupName, String jobName); + ContainerAppJobExecutions stopMultipleExecutions(String resourceGroupName, String jobName, Context context); /** - * Delete a Container Apps Job. + * List secrets for a container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 container Apps Job Secrets Collection ARM resource along with {@link Response}. */ - void deleteByResourceGroup(String resourceGroupName, String jobName); + Response listSecretsWithResponse(String resourceGroupName, String jobName, Context context); /** - * Delete a Container Apps Job. + * List secrets for a container apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 container Apps Job Secrets Collection ARM resource. */ - void delete(String resourceGroupName, String jobName, Context context); + JobSecretsCollection listSecrets(String resourceGroupName, String jobName); /** - * Start a Container Apps Job. + * Resumes a suspended job + * + * Resumes execution for a suspended Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job 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 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's Job execution name. + * @return container App Job. */ - JobExecutionBase start(String resourceGroupName, String jobName); + Job resume(String resourceGroupName, String jobName); /** - * Start a Container Apps Job. + * Resumes a suspended job + * + * Resumes execution for a suspended Container Apps job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param jobName Job Name. - * @param template Properties used to start a job execution. * @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 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's Job execution name. + * @return container App Job. */ - JobExecutionBase start(String resourceGroupName, String jobName, JobExecutionTemplate template, Context context); + Job resume(String resourceGroupName, String jobName, Context context); + + /** + * Suspends a job + * + * Suspends execution for a running Container Apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @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 + * + * Suspends execution for a running Container Apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @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); /** * Terminates execution of a running container apps job. @@ -261,58 +279,114 @@ Response getDetectorWithResponse(String resourceGroupName, String j void stopExecution(String resourceGroupName, String jobName, String jobExecutionName, Context context); /** - * Terminates execution of a running container apps job. + * Get the properties of a Container App Job. + * + * Get the properties for a given 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 * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container App executions collection ARM resource. + * @return the properties of a Container App Job. + * + * Get the properties for a given Container App Job along with {@link Response}. */ - ContainerAppJobExecutions stopMultipleExecutions(String resourceGroupName, String jobName); + Response proxyGetWithResponse(String resourceGroupName, String jobName, String apiName, Context context); /** - * Terminates execution of a running container apps job. + * Get the properties of a Container App Job. + * + * Get the properties for a given 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. + * + * Get the properties for a given Container App Job. + */ + Job proxyGet(String resourceGroupName, String jobName, String apiName); + + /** + * Get the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the 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 list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job as paginated response with {@link PagedIterable}. + */ + PagedIterable listDetectors(String resourceGroupName, String jobName); + + /** + * Get the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the 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 * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container App executions collection ARM resource. + * @return the list of diagnostics for a given Container App Job. + * + * Get the list of diagnostics for a Container App Job as paginated response with {@link PagedIterable}. */ - ContainerAppJobExecutions stopMultipleExecutions(String resourceGroupName, String jobName, Context context); + PagedIterable listDetectors(String resourceGroupName, String jobName, Context context); /** - * List secrets for a container apps job. + * Get the diagnostics data for a given Container App Job. + * + * Get the diagnostics data for a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. + * @param jobName Name of the Container App Job. + * @param detectorName 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 * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container Apps Job Secrets Collection ARM resource along with {@link Response}. + * @return the diagnostics data for a given Container App Job. + * + * Get the diagnostics data for a Container App Job along with {@link Response}. */ - Response listSecretsWithResponse(String resourceGroupName, String jobName, Context context); + Response getDetectorWithResponse(String resourceGroupName, String jobName, String detectorName, + Context context); /** - * List secrets for a container apps job. + * Get the diagnostics data for a given Container App Job. + * + * Get the diagnostics data for a Container App Job. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. + * @param jobName Name of the Container App Job. + * @param detectorName 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 container Apps Job Secrets Collection ARM resource. + * @return the diagnostics data for a given Container App Job. + * + * Get the diagnostics data for a Container App Job. */ - JobSecretsCollection listSecrets(String resourceGroupName, String jobName); + Diagnostics getDetector(String resourceGroupName, String jobName, String detectorName); /** * Get the properties of a Container Apps Job. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobsExecutions.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobsExecutions.java index d97086ea8549..697878d018a1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobsExecutions.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobsExecutions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JwtClaimChecks.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JwtClaimChecks.java index ff6540250084..fa2da9c6a7c0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JwtClaimChecks.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JwtClaimChecks.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -73,14 +73,6 @@ public JwtClaimChecks withAllowedClientApplications(List allowedClientAp return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/KedaConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/KedaConfiguration.java index efa2c552c104..c5f89cadd2e0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/KedaConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/KedaConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -36,14 +36,6 @@ public String version() { return this.version; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index 05d7acfb016a..f3dacd371c69 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,12 +12,12 @@ */ public final class Kind extends ExpandableStringEnum { /** - * Static value workflowapp for Kind. + * workflowapp. */ public static final Kind WORKFLOWAPP = fromString("workflowapp"); /** - * Static value functionapp for Kind. + * functionapp. */ public static final Kind FUNCTIONAPP = fromString("functionapp"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LabelHistory.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LabelHistory.java new file mode 100644 index 000000000000..00b66558440b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LabelHistory.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appcontainers.fluent.models.LabelHistoryInner; + +/** + * An immutable client-side representation of LabelHistory. + */ +public interface LabelHistory { + /** + * 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: Container App Label History resource specific properties. + * + * @return the properties value. + */ + LabelHistoryProperties 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.LabelHistoryInner object. + * + * @return the inner object. + */ + LabelHistoryInner innerModel(); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LabelHistoryProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LabelHistoryProperties.java new file mode 100644 index 000000000000..56798ca89787 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LabelHistoryProperties.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +/** + * Container App Label History resource specific properties. + */ +@Immutable +public final class LabelHistoryProperties implements JsonSerializable { + /* + * List of label history records. + */ + private List records; + + /** + * Creates an instance of LabelHistoryProperties class. + */ + private LabelHistoryProperties() { + } + + /** + * Get the records property: List of label history records. + * + * @return the records value. + */ + public List records() { + return this.records; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LabelHistoryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LabelHistoryProperties 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 LabelHistoryProperties. + */ + public static LabelHistoryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LabelHistoryProperties deserializedLabelHistoryProperties = new LabelHistoryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("records".equals(fieldName)) { + List records + = reader.readArray(reader1 -> LabelHistoryRecordItem.fromJson(reader1)); + deserializedLabelHistoryProperties.records = records; + } else { + reader.skipChildren(); + } + } + + return deserializedLabelHistoryProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LabelHistoryRecordItem.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LabelHistoryRecordItem.java new file mode 100644 index 000000000000..589fe9c224e3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LabelHistoryRecordItem.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +/** + * Container App Label History Item resource specific properties. + */ +@Immutable +public final class LabelHistoryRecordItem implements JsonSerializable { + /* + * Container App revision name that label was applied to. + */ + private String revision; + + /* + * Timestamp describing when the label was applied to the revision. + */ + private OffsetDateTime start; + + /* + * Timestamp describing when the label was removed from the revision. Only meaningful when the label is currently + * applied to the revision. + */ + private OffsetDateTime stop; + + /* + * Status of the label history record. + */ + private Status status; + + /** + * Creates an instance of LabelHistoryRecordItem class. + */ + private LabelHistoryRecordItem() { + } + + /** + * Get the revision property: Container App revision name that label was applied to. + * + * @return the revision value. + */ + public String revision() { + return this.revision; + } + + /** + * Get the start property: Timestamp describing when the label was applied to the revision. + * + * @return the start value. + */ + public OffsetDateTime start() { + return this.start; + } + + /** + * Get the stop property: Timestamp describing when the label was removed from the revision. Only meaningful when + * the label is currently applied to the revision. + * + * @return the stop value. + */ + public OffsetDateTime stop() { + return this.stop; + } + + /** + * Get the status property: Status of the label history record. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LabelHistoryRecordItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LabelHistoryRecordItem 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 LabelHistoryRecordItem. + */ + public static LabelHistoryRecordItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LabelHistoryRecordItem deserializedLabelHistoryRecordItem = new LabelHistoryRecordItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("revision".equals(fieldName)) { + deserializedLabelHistoryRecordItem.revision = reader.getString(); + } else if ("start".equals(fieldName)) { + deserializedLabelHistoryRecordItem.start = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("stop".equals(fieldName)) { + deserializedLabelHistoryRecordItem.stop = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + deserializedLabelHistoryRecordItem.status = Status.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLabelHistoryRecordItem; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LifecycleConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LifecycleConfiguration.java index bda5589196f1..da17d85786a9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LifecycleConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LifecycleConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -101,14 +101,6 @@ public LifecycleConfiguration withMaxAlivePeriodInSeconds(Integer maxAlivePeriod return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LifecycleType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LifecycleType.java index 2ef8db51ef22..2055d1e99ef7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LifecycleType.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LifecycleType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,12 +12,12 @@ */ public final class LifecycleType extends ExpandableStringEnum { /** - * Static value Timed for LifecycleType. + * Timed. */ public static final LifecycleType TIMED = fromString("Timed"); /** - * Static value OnContainerExit for LifecycleType. + * OnContainerExit. */ public static final LifecycleType ON_CONTAINER_EXIT = fromString("OnContainerExit"); 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 4aaeb16fe2ae..2c3766d2b1d9 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -72,14 +72,6 @@ public LogAnalyticsConfiguration withSharedKey(String sharedKey) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogLevel.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogLevel.java index 7243f9058fb1..2218badc92ac 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogLevel.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogLevel.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,22 +12,22 @@ */ public final class LogLevel extends ExpandableStringEnum { /** - * Static value info for LogLevel. + * info. */ public static final LogLevel INFO = fromString("info"); /** - * Static value debug for LogLevel. + * debug. */ public static final LogLevel DEBUG = fromString("debug"); /** - * Static value warn for LogLevel. + * warn. */ public static final LogLevel WARN = fromString("warn"); /** - * Static value error for LogLevel. + * error. */ public static final LogLevel ERROR = fromString("error"); 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 index ec81478c58fb..484d5e433f6b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; 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 index 587c1a63b9c9..0b9c247c5fee 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -17,7 +17,7 @@ public interface LogicApps { * * @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. + * @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 @@ -33,7 +33,7 @@ Response getWithResponse(String resourceGroupName, String containerApp * * @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. + * @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. @@ -47,7 +47,7 @@ Response getWithResponse(String resourceGroupName, String containerApp * * @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. + * @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 @@ -63,7 +63,7 @@ Response deleteWithResponse(String resourceGroupName, String containerAppN * * @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. + * @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. @@ -72,42 +72,41 @@ Response deleteWithResponse(String resourceGroupName, String containerAppN void delete(String resourceGroupName, String containerAppName, String logicAppName); /** - * List the workflows for a logic app. + * 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. + * @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}. + * @return logic app's connections along with {@link Response}. */ - PagedIterable listWorkflows(String resourceGroupName, String containerAppName, - String logicAppName); + Response listWorkflowsConnectionsWithResponse(String resourceGroupName, String containerAppName, + String logicAppName, Context context); /** - * List the workflows for a logic app. + * 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. - * @param context The context to associate with this operation. + * @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}. + * @return logic app's connections. */ - PagedIterable listWorkflows(String resourceGroupName, String containerAppName, - String logicAppName, Context context); + WorkflowEnvelope listWorkflowsConnections(String resourceGroupName, String containerAppName, String logicAppName); /** * 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. + * @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. @@ -124,7 +123,7 @@ Response getWorkflowWithResponse(String resourceGroupName, Str * * @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. + * @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 @@ -136,34 +135,35 @@ WorkflowEnvelope getWorkflow(String resourceGroupName, String containerAppName, String workflowName); /** - * Gets logic app's connections. + * 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. - * @param context The context to associate with this operation. + * @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 along with {@link Response}. + * @return collection of workflow information elements as paginated response with {@link PagedIterable}. */ - Response listWorkflowsConnectionsWithResponse(String resourceGroupName, String containerAppName, - String logicAppName, Context context); + PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + String logicAppName); /** - * Gets logic app's connections. + * 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. + * @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. + * @return collection of workflow information elements as paginated response with {@link PagedIterable}. */ - WorkflowEnvelope listWorkflowsConnections(String resourceGroupName, String containerAppName, String logicAppName); + PagedIterable listWorkflows(String resourceGroupName, String containerAppName, + String logicAppName, Context context); /** * Gets a logic app extension resource. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Login.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Login.java index 5ba8609f9238..cf419da01d38 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Login.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Login.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -185,26 +185,6 @@ public Login withNonce(Nonce nonce) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (routes() != null) { - routes().validate(); - } - if (tokenStore() != null) { - tokenStore().validate(); - } - if (cookieExpiration() != null) { - cookieExpiration().validate(); - } - if (nonce() != null) { - nonce().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LoginRoutes.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LoginRoutes.java index 0cf8abaaa2af..56d8f8d022b6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LoginRoutes.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LoginRoutes.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -47,14 +47,6 @@ public LoginRoutes withLogoutEndpoint(String logoutEndpoint) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LoginScopes.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LoginScopes.java index f35b2f4abad4..962852aeb7c4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LoginScopes.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LoginScopes.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -48,14 +48,6 @@ public LoginScopes withScopes(List scopes) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 000000000000..7d9e84d64e7f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogsConfiguration.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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/MaintenanceConfigurationResource.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/MaintenanceConfigurationResource.java index d87059504337..2d30a26e91f9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/MaintenanceConfigurationResource.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/MaintenanceConfigurationResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -88,7 +88,7 @@ interface WithParentResource { * Specifies resourceGroupName, environmentName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. + * @param environmentName Name of the managed environment. * @return the next definition stage. */ WithCreate withExistingManagedEnvironment(String resourceGroupName, String environmentName); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/MaintenanceConfigurations.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/MaintenanceConfigurations.java index 36481df37592..d24f72781372 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/MaintenanceConfigurations.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/MaintenanceConfigurations.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -13,39 +13,39 @@ */ public interface MaintenanceConfigurations { /** - * Gets all maintenance configurations in the specified Managed Environment. + * Gets the maintenance configuration of a ManagedEnvironment . * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. + * @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 all maintenance configurations in the specified Managed Environment as paginated response with - * {@link PagedIterable}. + * @return the maintenance configuration of a ManagedEnvironment along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String environmentName); + Response getWithResponse(String resourceGroupName, String environmentName, + String configName, Context context); /** - * Gets all maintenance configurations in the specified Managed Environment. + * Gets the maintenance configuration of a ManagedEnvironment . * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param context The context to associate with this operation. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. * @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 all maintenance configurations in the specified Managed Environment as paginated response with - * {@link PagedIterable}. + * @return the maintenance configuration of a ManagedEnvironment. */ - PagedIterable list(String resourceGroupName, String environmentName, - Context context); + MaintenanceConfigurationResource get(String resourceGroupName, String environmentName, String configName); /** * Deletes the maintenance configuration of a ManagedEnvironment . * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. * @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. @@ -59,8 +59,8 @@ Response deleteWithResponse(String resourceGroupName, String environmentNa * Deletes the maintenance configuration of a ManagedEnvironment . * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. + * @param environmentName Name of the managed environment. + * @param configName Name of the Maintenance Configuration. * @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. @@ -68,32 +68,32 @@ Response deleteWithResponse(String resourceGroupName, String environmentNa void delete(String resourceGroupName, String environmentName, String configName); /** - * Gets the maintenance configuration of a ManagedEnvironment . + * Gets all maintenance configurations in the specified Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. - * @param context The context to associate with this operation. + * @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 maintenance configuration of a ManagedEnvironment along with {@link Response}. + * @return all maintenance configurations in the specified Managed Environment as paginated response with + * {@link PagedIterable}. */ - Response getWithResponse(String resourceGroupName, String environmentName, - String configName, Context context); + PagedIterable list(String resourceGroupName, String environmentName); /** - * Gets the maintenance configuration of a ManagedEnvironment . + * Gets all maintenance configurations in the specified Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName The name of the Managed Environment. - * @param configName The name of the maintenance configuration. + * @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 maintenance configuration of a ManagedEnvironment. + * @return all maintenance configurations in the specified Managed Environment as paginated response with + * {@link PagedIterable}. */ - MaintenanceConfigurationResource get(String resourceGroupName, String environmentName, String configName); + PagedIterable list(String resourceGroupName, String environmentName, + Context context); /** * Gets the maintenance configuration of a ManagedEnvironment . diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificate.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificate.java index d3863e678425..f25585d448a9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificate.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateDomainControlValidation.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateDomainControlValidation.java index bcab6ba0fdbb..2325728e1f94 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateDomainControlValidation.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateDomainControlValidation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -13,17 +13,17 @@ public final class ManagedCertificateDomainControlValidation extends ExpandableStringEnum { /** - * Static value CNAME for ManagedCertificateDomainControlValidation. + * CNAME. */ public static final ManagedCertificateDomainControlValidation CNAME = fromString("CNAME"); /** - * Static value HTTP for ManagedCertificateDomainControlValidation. + * HTTP. */ public static final ManagedCertificateDomainControlValidation HTTP = fromString("HTTP"); /** - * Static value TXT for ManagedCertificateDomainControlValidation. + * TXT. */ public static final ManagedCertificateDomainControlValidation TXT = fromString("TXT"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificatePatch.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificatePatch.java index a42c2bde29e2..dac52d4aae26 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificatePatch.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificatePatch.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -48,14 +48,6 @@ public ManagedCertificatePatch withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateProperties.java index 1670c52f5f6b..7441e3bf22c4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -116,14 +116,6 @@ public String validationToken() { return this.validationToken; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificates.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificates.java index 6a41e1d6758c..a7158035e7ce 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificates.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificates.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -16,12 +16,11 @@ public interface ManagedCertificates { * Get the specified Managed Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. * @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 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 specified Managed Certificate along with {@link Response}. */ @@ -32,11 +31,10 @@ Response getWithResponse(String resourceGroupName, String en * Get the specified Managed Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. + * @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 specified Managed Certificate. */ @@ -46,12 +44,11 @@ Response getWithResponse(String resourceGroupName, String en * Deletes the specified Managed Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. * @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 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 Response}. */ @@ -62,11 +59,10 @@ Response deleteWithResponse(String resourceGroupName, String environmentNa * Deletes the specified Managed Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param managedCertificateName Name of the Managed Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. + * @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 managedCertificateName); @@ -75,10 +71,9 @@ Response deleteWithResponse(String resourceGroupName, String environmentNa * Get the Managed Certificates in 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 environmentName Name of the 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 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 Managed Certificates in a given managed environment as paginated response with {@link PagedIterable}. */ @@ -88,11 +83,10 @@ Response deleteWithResponse(String resourceGroupName, String environmentNa * Get the Managed Certificates in 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 environmentName Name of the 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 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 Managed Certificates in a given managed environment as paginated response with {@link PagedIterable}. */ @@ -103,8 +97,7 @@ Response deleteWithResponse(String resourceGroupName, String environmentNa * * @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 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 specified Managed Certificate along with {@link Response}. */ @@ -116,8 +109,7 @@ Response deleteWithResponse(String resourceGroupName, String environmentNa * @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 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 specified Managed Certificate along with {@link Response}. */ @@ -128,8 +120,7 @@ Response deleteWithResponse(String resourceGroupName, String environmentNa * * @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 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); @@ -140,8 +131,7 @@ Response deleteWithResponse(String resourceGroupName, String environmentNa * @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 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 Response}. */ 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 5726691ad7de..3ef362b94764 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -59,8 +59,7 @@ 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. + * Gets the identity property: The managed service identities assigned to this resource. * * @return the identity value. */ @@ -132,6 +131,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. * @@ -204,6 +217,14 @@ public interface ManagedEnvironment { */ IngressConfiguration ingressConfiguration(); + /** + * Gets the environmentMode property: Mode of the environment. Allowed Values: 'ConsumptionOnly', + * 'WorkloadProfiles', 'Express', 'Archived'. + * + * @return the environmentMode value. + */ + ManagedEnvironmentMode environmentMode(); + /** * Gets the privateEndpointConnections property: Private endpoint connections to the resource. * @@ -302,15 +323,16 @@ interface WithResourceGroup { * The stage of the ManagedEnvironment 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.WithKind, DefinitionStages.WithIdentity, - 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.WithIngressConfiguration, DefinitionStages.WithPublicNetworkAccess { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithKind, + 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.WithIngressConfiguration, + DefinitionStages.WithEnvironmentMode, DefinitionStages.WithPublicNetworkAccess { /** * Executes the create request. * @@ -358,11 +380,9 @@ interface WithKind { */ 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.. + * Specifies the identity property: The managed service identities assigned to this resource.. * - * @param identity Managed identities for the Managed Environment to interact with other Azure services - * without maintaining any secrets or credentials in code. + * @param identity The managed service identities assigned to this resource. * @return the next definition stage. */ WithCreate withIdentity(ManagedServiceIdentity identity); @@ -417,7 +437,7 @@ interface WithVnetConfiguration { interface WithAppLogsConfiguration { /** * Specifies the appLogsConfiguration property: Cluster configuration which enables the log daemon to export - * app logs to configured destination.. + * app logs to configured destination. * * @param appLogsConfiguration Cluster configuration which enables the log daemon to export app logs to * configured destination. @@ -426,6 +446,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. */ @@ -548,6 +594,21 @@ interface WithIngressConfiguration { WithCreate withIngressConfiguration(IngressConfiguration ingressConfiguration); } + /** + * The stage of the ManagedEnvironment definition allowing to specify environmentMode. + */ + interface WithEnvironmentMode { + /** + * Specifies the environmentMode property: Mode of the environment. Allowed Values: 'ConsumptionOnly', + * 'WorkloadProfiles', 'Express', 'Archived'.. + * + * @param environmentMode Mode of the environment. Allowed Values: 'ConsumptionOnly', 'WorkloadProfiles', + * 'Express', 'Archived'. + * @return the next definition stage. + */ + WithCreate withEnvironmentMode(ManagedEnvironmentMode environmentMode); + } + /** * The stage of the ManagedEnvironment definition allowing to specify publicNetworkAccess. */ @@ -577,10 +638,11 @@ interface WithPublicNetworkAccess { 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.WithIngressConfiguration, - UpdateStages.WithPublicNetworkAccess { + UpdateStages.WithEnvironmentMode, UpdateStages.WithPublicNetworkAccess { /** * Executes the update request. * @@ -632,11 +694,9 @@ interface WithKind { */ 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.. + * Specifies the identity property: The managed service identities assigned to this resource.. * - * @param identity Managed identities for the Managed Environment to interact with other Azure services - * without maintaining any secrets or credentials in code. + * @param identity The managed service identities assigned to this resource. * @return the next definition stage. */ Update withIdentity(ManagedServiceIdentity identity); @@ -691,7 +751,7 @@ interface WithVnetConfiguration { interface WithAppLogsConfiguration { /** * Specifies the appLogsConfiguration property: Cluster configuration which enables the log daemon to export - * app logs to configured destination.. + * app logs to configured destination. * * @param appLogsConfiguration Cluster configuration which enables the log daemon to export app logs to * configured destination. @@ -700,6 +760,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. */ @@ -792,6 +878,21 @@ interface WithIngressConfiguration { Update withIngressConfiguration(IngressConfiguration ingressConfiguration); } + /** + * The stage of the ManagedEnvironment update allowing to specify environmentMode. + */ + interface WithEnvironmentMode { + /** + * Specifies the environmentMode property: Mode of the environment. Allowed Values: 'ConsumptionOnly', + * 'WorkloadProfiles', 'Express', 'Archived'.. + * + * @param environmentMode Mode of the environment. Allowed Values: 'ConsumptionOnly', 'WorkloadProfiles', + * 'Express', 'Archived'. + * @return the next definition stage. + */ + Update withEnvironmentMode(ManagedEnvironmentMode environmentMode); + } + /** * The stage of the ManagedEnvironment update allowing to specify publicNetworkAccess. */ @@ -830,10 +931,11 @@ interface WithPublicNetworkAccess { * * @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 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 environment Auth Token along with {@link Response}. + * @return auth token for a managed environment + * + * Checks if resource name is available along with {@link Response}. */ Response getAuthTokenWithResponse(Context context); @@ -842,10 +944,37 @@ interface WithPublicNetworkAccess { * * Checks if resource name is available. * + * @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 auth token for a managed environment + * + * Checks if resource name is available. + */ + EnvironmentAuthToken getAuthToken(); + + /** + * Checks whether a Managed Environment can be migrated to a target mode. + * + * @param body The migration eligibility check request. + * @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 result of a read-only managed environment migration eligibility check along with {@link Response}. + */ + Response + checkMigrationEligibilityWithResponse(CheckMigrationEligibilityRequest body, Context context); + + /** + * Checks whether a Managed Environment can be migrated to a target mode. + * + * @param body The migration eligibility check request. + * @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 environment Auth Token. + * @return result of a read-only managed environment migration eligibility check. */ - EnvironmentAuthToken getAuthToken(); + CheckMigrationEligibilityResponse checkMigrationEligibility(CheckMigrationEligibilityRequest body); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentDiagnostics.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentDiagnostics.java index 03a0cb082365..c81c5755e664 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentDiagnostics.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentDiagnostics.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -17,14 +17,15 @@ public interface ManagedEnvironmentDiagnostics { * Get the list of diagnostics for a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. + * @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 list of diagnostics for a Managed Environment used to host container apps along with - * {@link Response}. + * @return the list of diagnostics for a given Managed Environment. + * + * Get the list of diagnostics for a Managed Environment used to host container apps along with {@link Response}. */ Response listDetectorsWithResponse(String resourceGroupName, String environmentName, Context context); @@ -35,12 +36,14 @@ Response listDetectorsWithResponse(String resourceGroupNa * Get the list of diagnostics for a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. + * @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 list of diagnostics for a Managed Environment used to host container apps. + * @return the list of diagnostics for a given Managed Environment. + * + * Get the list of diagnostics for a Managed Environment used to host container apps. */ DiagnosticsCollection listDetectors(String resourceGroupName, String environmentName); @@ -50,14 +53,16 @@ Response listDetectorsWithResponse(String resourceGroupNa * Get the diagnostics data for a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param detectorName Name of the Managed Environment detector. + * @param environmentName Name of the Managed Environment. + * @param detectorName Name of the detector. * @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 diagnostics data for a Managed Environment used to host container apps along with {@link Response}. + * @return the diagnostics data for a given Managed Environment. + * + * Get the diagnostics data for a Managed Environment used to host container apps along with {@link Response}. */ Response getDetectorWithResponse(String resourceGroupName, String environmentName, String detectorName, Context context); @@ -68,13 +73,15 @@ Response getDetectorWithResponse(String resourceGroupName, String e * Get the diagnostics data for a Managed Environment used to host container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param detectorName Name of the Managed Environment detector. + * @param environmentName Name of the Managed Environment. + * @param detectorName Name of the detector. * @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 diagnostics data for a Managed Environment used to host container apps. + * @return the diagnostics data for a given Managed Environment. + * + * Get the diagnostics data for a Managed Environment used to host container apps. */ Diagnostics getDetector(String resourceGroupName, String environmentName, String detectorName); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentMode.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentMode.java new file mode 100644 index 000000000000..f8ff9c0adcfd --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentMode.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Mode of the managed environment. + */ +public final class ManagedEnvironmentMode extends ExpandableStringEnum { + /** + * The environment supports consumption-only workloads. + */ + public static final ManagedEnvironmentMode CONSUMPTION_ONLY = fromString("ConsumptionOnly"); + + /** + * The environment supports workload profiles. + */ + public static final ManagedEnvironmentMode WORKLOAD_PROFILES = fromString("WorkloadProfiles"); + + /** + * The environment uses the Express mode. + */ + public static final ManagedEnvironmentMode EXPRESS = fromString("Express"); + + /** + * The environment is archived. + */ + public static final ManagedEnvironmentMode ARCHIVED = fromString("Archived"); + + /** + * Creates a new instance of ManagedEnvironmentMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedEnvironmentMode() { + } + + /** + * Creates or finds a ManagedEnvironmentMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedEnvironmentMode. + */ + public static ManagedEnvironmentMode fromString(String name) { + return fromString(name, ManagedEnvironmentMode.class); + } + + /** + * Gets known ManagedEnvironmentMode values. + * + * @return known ManagedEnvironmentMode values. + */ + public static Collection values() { + return values(ManagedEnvironmentMode.class); + } +} 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 index 7bb6dfb9d798..5998bd189e5d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -13,90 +13,86 @@ */ public interface ManagedEnvironmentPrivateEndpointConnections { /** - * List private endpoint connections for a given managed environment. + * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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}. + * @return a private endpoint connection for a given managed environment along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String environmentName); + Response getWithResponse(String resourceGroupName, String environmentName, + String privateEndpointConnectionName, Context context); /** - * List private endpoint connections for a given managed environment. + * 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 context The context to associate with this operation. + * @param environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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}. + * @return a private endpoint connection for a given managed environment. */ - PagedIterable list(String resourceGroupName, String environmentName, Context context); + PrivateEndpointConnection get(String resourceGroupName, String environmentName, + String privateEndpointConnectionName); /** - * Get a private endpoint connection for a given managed environment. + * 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. + * @param environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. * @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); + void delete(String resourceGroupName, String environmentName, String privateEndpointConnectionName); /** - * Get a private endpoint connection for a given managed environment. + * 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 environmentName Name of the managed environment. + * @param privateEndpointConnectionName Name of the Private Endpoint Connection. + * @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. */ - PrivateEndpointConnection get(String resourceGroupName, String environmentName, - String privateEndpointConnectionName); + void delete(String resourceGroupName, String environmentName, String privateEndpointConnectionName, + Context context); /** - * Delete a private endpoint connection for a given managed environment. + * 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @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 response of a PrivateEndpointConnection list operation as paginated response with + * {@link PagedIterable}. */ - void delete(String resourceGroupName, String environmentName, String privateEndpointConnectionName); + PagedIterable list(String resourceGroupName, String environmentName); /** - * Delete a private endpoint connection for a given managed environment. + * 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * @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 response of a PrivateEndpointConnection list operation as paginated response with + * {@link PagedIterable}. */ - void delete(String resourceGroupName, String environmentName, String privateEndpointConnectionName, - Context context); + PagedIterable list(String resourceGroupName, String environmentName, Context context); /** * Get a private endpoint connection for a given managed environment. 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 index 480e3073148a..2266d0dfbfd5 100644 --- 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 @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; /** @@ -15,11 +16,12 @@ 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. + * @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}. + * @return list of private link resources for a managed environment as paginated response with + * {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String environmentName); @@ -27,12 +29,49 @@ 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. + * @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}. + * @return list of private link resources for a managed environment as paginated response with + * {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String environmentName, Context context); + + /** + * Get a private link resource for a given managed environment. + * + * Gets the details of a private link resource supported by a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the managed environment. + * @param privateLinkResourceName The name of the private link 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 link resource for a given managed environment. + * + * Gets the details of a private link resource supported by a managed environment along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String environmentName, + String privateLinkResourceName, Context context); + + /** + * Get a private link resource for a given managed environment. + * + * Gets the details of a private link resource supported by a managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the managed environment. + * @param privateLinkResourceName The name of the private link 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 link resource for a given managed environment. + * + * Gets the details of a private link resource supported by a managed environment. + */ + PrivateLinkResource get(String resourceGroupName, String environmentName, String privateLinkResourceName); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerAuthentication.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerAuthentication.java index d9539e3202d6..190a71b26bc3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerAuthentication.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerAuthentication.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -48,17 +48,6 @@ public ManagedEnvironmentPropertiesPeerAuthentication withMtls(Mtls mtls) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (mtls() != null) { - mtls().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerTrafficConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerTrafficConfiguration.java index 92e4a2e6fa14..9f4bda232050 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerTrafficConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerTrafficConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -49,17 +49,6 @@ public ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption encryption return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (encryption() != null) { - encryption().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption.java index 4fc1776940a2..e82ab7b87315 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -48,14 +48,6 @@ public ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption withEnable return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentStorage.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentStorage.java index 2e1a0fcd4b12..13a8202004f3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentStorage.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentStorage.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; 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 84c56b6a4eee..f96362275786 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -73,20 +73,6 @@ public ManagedEnvironmentStorageProperties withNfsAzureFile(NfsAzureFileProperti return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (azureFile() != null) { - azureFile().validate(); - } - if (nfsAzureFile() != null) { - nfsAzureFile().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentStoragesCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentStoragesCollection.java index 2e891809bbce..5c6f667ab1f8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentStoragesCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentStoragesCollection.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentUsages.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentUsages.java index c9c1d12477fe..43d8058f0b9e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentUsages.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentUsages.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironments.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironments.java index cf2ffc7fc4f8..25959161341c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironments.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironments.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -13,120 +13,124 @@ */ public interface ManagedEnvironments { /** - * Get all Environments for a subscription. + * Get the properties of a Managed Environment. * - * Get all Managed Environments for a subscription. + * Get the properties of a Managed Environment used to host container apps. * - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the 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 all Managed Environments for a subscription as paginated response with {@link PagedIterable}. + * @return the properties of a Managed Environment. + * + * Get the properties of a Managed Environment used to host container apps along with {@link Response}. */ - PagedIterable list(); + Response getByResourceGroupWithResponse(String resourceGroupName, String environmentName, + Context context); /** - * Get all Environments for a subscription. + * Get the properties of a Managed Environment. * - * Get all Managed Environments for a subscription. + * Get the properties of a Managed Environment used to host container apps. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the 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 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 all Managed Environments for a subscription as paginated response with {@link PagedIterable}. + * @return the properties of a Managed Environment. + * + * Get the properties of a Managed Environment used to host container apps. */ - PagedIterable list(Context context); + ManagedEnvironment getByResourceGroup(String resourceGroupName, String environmentName); /** - * Get all the Environments in a resource group. + * Delete a Managed Environment. * - * Get all the Managed Environments in a resource group. + * Delete a Managed Environment if it does not have any container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the 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 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 all the Managed Environments in a resource group as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + void deleteByResourceGroup(String resourceGroupName, String environmentName); /** - * Get all the Environments in a resource group. + * Delete a Managed Environment. * - * Get all the Managed Environments in a resource group. + * Delete a Managed Environment if it does not have any container apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the 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 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 all the Managed Environments in a resource group as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + void delete(String resourceGroupName, String environmentName, Context context); /** - * Get the properties of a Managed Environment. + * Get all the Environments in a resource group. * - * Get the properties of a Managed Environment used to host container apps. + * Get all the Managed Environments in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the 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 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 properties of a Managed Environment used to host container apps along with {@link Response}. + * @return all the Environments in a resource group. + * + * Get all the Managed Environments in a resource group as paginated response with {@link PagedIterable}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String environmentName, - Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Get the properties of a Managed Environment. + * Get all the Environments in a resource group. * - * Get the properties of a Managed Environment used to host container apps. + * Get all the Managed Environments in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the 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 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 properties of a Managed Environment used to host container apps. + * @return all the Environments in a resource group. + * + * Get all the Managed Environments in a resource group as paginated response with {@link PagedIterable}. */ - ManagedEnvironment getByResourceGroup(String resourceGroupName, String environmentName); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Delete a Managed Environment. + * Get all Environments for a subscription. * - * Delete a Managed Environment if it does not have any container apps. + * Get all Managed Environments for a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the 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 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 all Environments for a subscription. + * + * Get all Managed Environments for a subscription as paginated response with {@link PagedIterable}. */ - void deleteByResourceGroup(String resourceGroupName, String environmentName); + PagedIterable list(); /** - * Delete a Managed Environment. + * Get all Environments for a subscription. * - * Delete a Managed Environment if it does not have any container apps. + * Get all Managed Environments for a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the 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 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 all Environments for a subscription. + * + * Get all Managed Environments for a subscription as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String environmentName, Context context); + PagedIterable list(Context context); /** * Get auth token for a managed environment @@ -134,13 +138,14 @@ Response getByResourceGroupWithResponse(String resourceGroup * Checks if resource name is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the 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 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 environment Auth Token along with {@link Response}. + * @return auth token for a managed environment + * + * Checks if resource name is available along with {@link Response}. */ Response getAuthTokenWithResponse(String resourceGroupName, String environmentName, Context context); @@ -151,12 +156,13 @@ Response getAuthTokenWithResponse(String resourceGroupName * Checks if resource name is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the 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 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 environment Auth Token. + * @return auth token for a managed environment + * + * Checks if resource name is available. */ EnvironmentAuthToken getAuthToken(String resourceGroupName, String environmentName); @@ -166,12 +172,13 @@ Response getAuthTokenWithResponse(String resourceGroupName * Get all workload Profile States 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 environmentName Name of the 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 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 all workload Profile States for a Managed Environment as paginated response with {@link PagedIterable}. + * @return all workload Profile States for a Managed Environment.. + * + * Get all workload Profile States for a Managed Environment as paginated response with {@link PagedIterable}. */ PagedIterable listWorkloadProfileStates(String resourceGroupName, String environmentName); @@ -181,17 +188,49 @@ Response getAuthTokenWithResponse(String resourceGroupName * Get all workload Profile States 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 environmentName Name of the 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 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 all workload Profile States for a Managed Environment as paginated response with {@link PagedIterable}. + * @return all workload Profile States for a Managed Environment.. + * + * Get all workload Profile States for a Managed Environment as paginated response with {@link PagedIterable}. */ PagedIterable listWorkloadProfileStates(String resourceGroupName, String environmentName, Context context); + /** + * Checks whether a Managed Environment can be migrated to a target mode. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Environment. + * @param body The migration eligibility check request. + * @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 result of a read-only managed environment migration eligibility check along with {@link Response}. + */ + Response checkMigrationEligibilityWithResponse(String resourceGroupName, + String environmentName, CheckMigrationEligibilityRequest body, Context context); + + /** + * Checks whether a Managed Environment can be migrated to a target mode. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Environment. + * @param body The migration eligibility check request. + * @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 result of a read-only managed environment migration eligibility check. + */ + CheckMigrationEligibilityResponse checkMigrationEligibility(String resourceGroupName, String environmentName, + CheckMigrationEligibilityRequest body); + /** * Get the properties of a Managed Environment. * @@ -199,10 +238,11 @@ PagedIterable listWorkloadProfileStates(String resourceGr * * @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 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 properties of a Managed Environment used to host container apps along with {@link Response}. + * @return the properties of a Managed Environment. + * + * Get the properties of a Managed Environment used to host container apps along with {@link Response}. */ ManagedEnvironment getById(String id); @@ -214,10 +254,11 @@ PagedIterable listWorkloadProfileStates(String resourceGr * @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 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 properties of a Managed Environment used to host container apps along with {@link Response}. + * @return the properties of a Managed Environment. + * + * Get the properties of a Managed Environment used to host container apps along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -228,8 +269,7 @@ PagedIterable listWorkloadProfileStates(String resourceGr * * @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 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); @@ -242,8 +282,7 @@ PagedIterable listWorkloadProfileStates(String resourceGr * @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 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); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentsDiagnostics.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentsDiagnostics.java index f4c6fb165f76..c8eed3f54aa0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentsDiagnostics.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentsDiagnostics.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -23,7 +23,9 @@ public interface ManagedEnvironmentsDiagnostics { * @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 Managed Environment used to host container apps along with {@link Response}. + * @return the properties of a Managed Environment. + * + * Get the properties of a Managed Environment used to host container apps along with {@link Response}. */ Response getRootWithResponse(String resourceGroupName, String environmentName, Context context); @@ -38,7 +40,9 @@ public interface ManagedEnvironmentsDiagnostics { * @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 Managed Environment used to host container apps. + * @return the properties of a Managed Environment. + * + * Get the properties of a Managed Environment used to host container apps. */ ManagedEnvironment getRoot(String resourceGroupName, String environmentName); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentsStorages.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentsStorages.java index a1be60b7e13a..5a33fecb86de 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentsStorages.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentsStorages.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,35 +12,37 @@ */ public interface ManagedEnvironmentsStorages { /** - * Get all storages for a managedEnvironment. + * Get storage for a managedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. + * @param storageName Name of the storage. * @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 all storages for a managedEnvironment along with {@link Response}. + * @return storage for a managedEnvironment along with {@link Response}. */ - Response listWithResponse(String resourceGroupName, String environmentName, - Context context); + Response getWithResponse(String resourceGroupName, String environmentName, + String storageName, Context context); /** - * Get all storages for a managedEnvironment. + * Get storage for a managedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. + * @param storageName Name of the storage. * @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 all storages for a managedEnvironment. + * @return storage for a managedEnvironment. */ - ManagedEnvironmentStoragesCollection list(String resourceGroupName, String environmentName); + ManagedEnvironmentStorage get(String resourceGroupName, String environmentName, String storageName); /** - * Get storage for a managedEnvironment. + * Delete storage for a managedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. @@ -50,13 +52,13 @@ Response listWithResponse(String resourceG * @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 storage for a managedEnvironment along with {@link Response}. + * @return the {@link Response}. */ - Response getWithResponse(String resourceGroupName, String environmentName, - String storageName, Context context); + Response deleteWithResponse(String resourceGroupName, String environmentName, String storageName, + Context context); /** - * Get storage for a managedEnvironment. + * Delete storage for a managedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. @@ -65,38 +67,36 @@ Response getWithResponse(String resourceGroupName, St * @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 storage for a managedEnvironment. */ - ManagedEnvironmentStorage get(String resourceGroupName, String environmentName, String storageName); + void delete(String resourceGroupName, String environmentName, String storageName); /** - * Delete storage for a managedEnvironment. + * Get all storages for a managedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. - * @param storageName Name of the storage. * @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}. + * @return all storages for a managedEnvironment along with {@link Response}. */ - Response deleteWithResponse(String resourceGroupName, String environmentName, String storageName, + Response listWithResponse(String resourceGroupName, String environmentName, Context context); /** - * Delete storage for a managedEnvironment. + * Get all storages for a managedEnvironment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Environment. - * @param storageName Name of the storage. * @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 all storages for a managedEnvironment. */ - void delete(String resourceGroupName, String environmentName, String storageName); + ManagedEnvironmentStoragesCollection list(String resourceGroupName, String environmentName); /** * Get storage for a managedEnvironment. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedIdentitySetting.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedIdentitySetting.java index 1fdac6a7e8cf..24f98c8662dd 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedIdentitySetting.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedIdentitySetting.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -26,7 +25,7 @@ public final class ManagedIdentitySetting implements JsonSerializable userAssignedIdentities; @@ -56,7 +51,7 @@ public ManagedServiceIdentity() { * * @return the principalId value. */ - public UUID principalId() { + public String principalId() { return this.principalId; } @@ -66,13 +61,12 @@ public UUID principalId() { * * @return the tenantId value. */ - public UUID tenantId() { + public String tenantId() { return this.tenantId; } /** - * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are - * allowed). + * Get the type property: The type of managed identity assigned to this resource. * * @return the type value. */ @@ -81,8 +75,7 @@ public ManagedServiceIdentityType type() { } /** - * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are - * allowed). + * Set the type property: The type of managed identity assigned to this resource. * * @param type the type value to set. * @return the ManagedServiceIdentity object itself. @@ -93,10 +86,7 @@ public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { } /** - * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The - * userAssignedIdentities dictionary keys will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - * The dictionary values can be empty objects ({}) in requests. + * Get the userAssignedIdentities property: The identities assigned to this resource by the user. * * @return the userAssignedIdentities value. */ @@ -105,10 +95,7 @@ public Map userAssignedIdentities() { } /** - * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The - * userAssignedIdentities dictionary keys will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - * The dictionary values can be empty objects ({}) in requests. + * Set the userAssignedIdentities property: The identities assigned to this resource by the user. * * @param userAssignedIdentities the userAssignedIdentities value to set. * @return the ManagedServiceIdentity object itself. @@ -118,27 +105,6 @@ public ManagedServiceIdentity withUserAssignedIdentities(Map { - if (e != null) { - e.validate(); - } - }); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); - /** * {@inheritDoc} */ @@ -170,11 +136,9 @@ public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOEx if ("type".equals(fieldName)) { deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); } else if ("principalId".equals(fieldName)) { - deserializedManagedServiceIdentity.principalId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedManagedServiceIdentity.principalId = reader.getString(); } else if ("tenantId".equals(fieldName)) { - deserializedManagedServiceIdentity.tenantId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedManagedServiceIdentity.tenantId = reader.getString(); } else if ("userAssignedIdentities".equals(fieldName)) { Map userAssignedIdentities = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedServiceIdentityType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedServiceIdentityType.java index a1e459c32245..6710e95477cc 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedServiceIdentityType.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedServiceIdentityType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,22 +12,22 @@ */ public final class ManagedServiceIdentityType extends ExpandableStringEnum { /** - * Static value None for ManagedServiceIdentityType. + * No managed identity. */ public static final ManagedServiceIdentityType NONE = fromString("None"); /** - * Static value SystemAssigned for ManagedServiceIdentityType. + * System assigned managed identity. */ public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); /** - * Static value UserAssigned for ManagedServiceIdentityType. + * User assigned managed identity. */ public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); /** - * Static value SystemAssigned,UserAssigned for ManagedServiceIdentityType. + * System and user assigned managed identity. */ public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = fromString("SystemAssigned,UserAssigned"); 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 000000000000..cd18375cf065 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/MetricsConfiguration.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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/MigrationEligibilityFailureReason.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/MigrationEligibilityFailureReason.java new file mode 100644 index 000000000000..246f839a41b5 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/MigrationEligibilityFailureReason.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +/** + * A blocking reason that prevents a managed environment migration. + */ +@Immutable +public final class MigrationEligibilityFailureReason implements JsonSerializable { + /* + * The error code identifying the blocker. + */ + private String code; + + /* + * A human-readable description of the blocker. + */ + private String message; + + /** + * Creates an instance of MigrationEligibilityFailureReason class. + */ + private MigrationEligibilityFailureReason() { + } + + /** + * Get the code property: The error code identifying the blocker. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: A human-readable description of the blocker. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationEligibilityFailureReason from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationEligibilityFailureReason 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 MigrationEligibilityFailureReason. + */ + public static MigrationEligibilityFailureReason fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationEligibilityFailureReason deserializedMigrationEligibilityFailureReason + = new MigrationEligibilityFailureReason(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedMigrationEligibilityFailureReason.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedMigrationEligibilityFailureReason.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationEligibilityFailureReason; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Mtls.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Mtls.java index b0abfb2e584d..037be445a55f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Mtls.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Mtls.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -47,14 +47,6 @@ public Mtls withEnabled(Boolean enabled) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Namespaces.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Namespaces.java index 48776943b50c..1d90d1395650 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Namespaces.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Namespaces.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -17,12 +17,11 @@ public interface Namespaces { * Checks if resource name is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param checkNameAvailabilityRequest The check name availability request. * @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 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 check availability result along with {@link Response}. */ @@ -35,11 +34,10 @@ Response checkNameAvailabilityWithResponse(String * Checks if resource name is available. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param environmentName Name of the Environment. * @param checkNameAvailabilityRequest The check name availability request. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. + * @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 check availability result. */ 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 index 83b390bd608f..681aea8e7f9c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -97,14 +97,6 @@ public NfsAzureFileProperties withShareName(String shareName) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Nonce.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Nonce.java index 0bca70149015..00b0dca0f8c8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Nonce.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Nonce.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -75,14 +75,6 @@ public Nonce withNonceExpirationInterval(String nonceExpirationInterval) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectClientCredential.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectClientCredential.java index 8b485cce291a..62d4fa6f302e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectClientCredential.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectClientCredential.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -74,14 +74,6 @@ public OpenIdConnectClientCredential withClientSecretSettingName(String clientSe return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectConfig.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectConfig.java index 4475c52237f0..92ccfa9972d6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectConfig.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectConfig.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -149,14 +149,6 @@ public OpenIdConnectConfig withWellKnownOpenIdConfiguration(String wellKnownOpen return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectLogin.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectLogin.java index 7573976627a8..f5b83fe55e83 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectLogin.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectLogin.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -73,14 +73,6 @@ public OpenIdConnectLogin withScopes(List scopes) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectRegistration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectRegistration.java index 9bcbbae2afb3..acdee5a66c27 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectRegistration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenIdConnectRegistration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -99,20 +99,6 @@ public OpenIdConnectRegistration withOpenIdConnectConfiguration(OpenIdConnectCon return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (clientCredential() != null) { - clientCredential().validate(); - } - if (openIdConnectConfiguration() != null) { - openIdConnectConfiguration().validate(); - } - } - /** * {@inheritDoc} */ 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 000000000000..65ab22c3cafd --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OpenTelemetryConfiguration.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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/OperationDetail.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OperationDetail.java index e3796d6840cc..cf37c675e404 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OperationDetail.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OperationDetail.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OperationDisplay.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OperationDisplay.java index c24950a8cf09..b980d259870c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OperationDisplay.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/OperationDisplay.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Operation display payload. */ -@Fluent +@Immutable public final class OperationDisplay implements JsonSerializable { /* * Resource provider of the operation @@ -39,7 +39,7 @@ public final class OperationDisplay 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; + } + + /** + * {@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/PoolManagementType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/PoolManagementType.java index a7c307747cd0..88c4dc6eed32 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,12 +12,12 @@ */ public final class PoolManagementType extends ExpandableStringEnum { /** - * Static value Manual for PoolManagementType. + * Manual. */ public static final PoolManagementType MANUAL = fromString("Manual"); /** - * Static value Dynamic for PoolManagementType. + * Dynamic. */ public static final PoolManagementType DYNAMIC = fromString("Dynamic"); 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 index 93625e4abf73..2fb52e7f82ad 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -36,14 +36,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index d0cd177423c3..935eeaf91bd0 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -109,7 +109,7 @@ 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. + * @param environmentName Name of the managed environment. * @return the next definition stage. */ WithCreate withExistingManagedEnvironment(String resourceGroupName, String environmentName); 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 index 8f010fe26dd4..85fb3bd21ebf 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -13,37 +13,37 @@ public final class PrivateEndpointConnectionProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for PrivateEndpointConnectionProvisioningState. + * Succeeded. */ public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for PrivateEndpointConnectionProvisioningState. + * Failed. */ public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for PrivateEndpointConnectionProvisioningState. + * Canceled. */ public static final PrivateEndpointConnectionProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Waiting for PrivateEndpointConnectionProvisioningState. + * Waiting. */ public static final PrivateEndpointConnectionProvisioningState WAITING = fromString("Waiting"); /** - * Static value Updating for PrivateEndpointConnectionProvisioningState. + * Updating. */ public static final PrivateEndpointConnectionProvisioningState UPDATING = fromString("Updating"); /** - * Static value Deleting for PrivateEndpointConnectionProvisioningState. + * Deleting. */ public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); /** - * Static value Pending for PrivateEndpointConnectionProvisioningState. + * Pending. */ public static final PrivateEndpointConnectionProvisioningState PENDING = fromString("Pending"); 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 index b56460c10ee8..b76b8eee76df 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -13,22 +13,22 @@ public final class PrivateEndpointServiceConnectionStatus extends ExpandableStringEnum { /** - * Static value Pending for PrivateEndpointServiceConnectionStatus. + * Pending. */ public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); /** - * Static value Approved for PrivateEndpointServiceConnectionStatus. + * Approved. */ public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); /** - * Static value Rejected for PrivateEndpointServiceConnectionStatus. + * Rejected. */ public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); /** - * Static value Disconnected for PrivateEndpointServiceConnectionStatus. + * Disconnected. */ public static final PrivateEndpointServiceConnectionStatus DISCONNECTED = fromString("Disconnected"); 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 index 43ea727b07d3..1d70cbdf9230 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; 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 index 0c31b2ae3d9c..e9e776e64c72 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -101,14 +101,6 @@ public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequi return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index 0dacf1daad39..e5890bd45b90 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,12 +12,12 @@ */ public final class PublicNetworkAccess extends ExpandableStringEnum { /** - * Static value Enabled for PublicNetworkAccess. + * Enabled. */ public static final PublicNetworkAccess ENABLED = fromString("Enabled"); /** - * Static value Disabled for PublicNetworkAccess. + * Disabled. */ public static final PublicNetworkAccess DISABLED = fromString("Disabled"); 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 207032b0546c..378879f319bf 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -151,17 +151,6 @@ public QueueScaleRule withIdentity(String identity) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (auth() != null) { - auth().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RegistryCredentials.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RegistryCredentials.java index 0321d642e9a4..35fb4fa88c63 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RegistryCredentials.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RegistryCredentials.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -127,14 +127,6 @@ public RegistryCredentials withIdentity(String identity) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RegistryInfo.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RegistryInfo.java index cd2e6ce356d3..1207e5b38818 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RegistryInfo.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RegistryInfo.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -97,14 +97,6 @@ public RegistryInfo withRegistryPassword(String registryPassword) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Replica.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Replica.java index 7c9a93485af9..9070f4a38780 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Replica.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Replica.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ReplicaCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ReplicaCollection.java index 5f224d043a2a..fc1129ffda06 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ReplicaCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ReplicaCollection.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; 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 7e6a12306caa..1436388e4ae5 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Container object under Container App Revision Replica. */ -@Fluent +@Immutable public final class ReplicaContainer implements JsonSerializable { /* * The Name of the Container @@ -61,10 +61,15 @@ 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. + */ + private ReplicaExecutionStatus() { + } + + /** + * Get the name property: Replica Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the containers property: Containers in the execution replica. + * + * @return the containers value. + */ + public List containers() { + return this.containers; + } + + /** + * {@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/ResourceProviders.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ResourceProviders.java index 11d4944e9880..9b73caf96f2c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ResourceProviders.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ResourceProviders.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,54 +12,54 @@ */ public interface ResourceProviders { /** - * Get details of a single job execution. + * Get the verification id of a subscription used for verifying custom domains. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. - * @param jobExecutionName Job execution 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 details of a single job execution along with {@link Response}. + * @return the verification id of a subscription used for verifying custom domains along with {@link Response}. */ - Response jobExecutionWithResponse(String resourceGroupName, String jobName, String jobExecutionName, - Context context); + Response getCustomDomainVerificationIdWithResponse(Context context); /** - * Get details of a single job execution. + * Get the verification id of a subscription used for verifying custom domains. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Job Name. - * @param jobExecutionName Job execution 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 details of a single job execution. + * @return the verification id of a subscription used for verifying custom domains. */ - JobExecution jobExecution(String resourceGroupName, String jobName, String jobExecutionName); + String getCustomDomainVerificationId(); /** - * Get the verification id of a subscription used for verifying custom domains. + * Get details of a single job execution. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param jobExecutionName Job execution 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 the verification id of a subscription used for verifying custom domains along with {@link Response}. + * @return details of a single job execution along with {@link Response}. */ - Response getCustomDomainVerificationIdWithResponse(Context context); + Response jobExecutionWithResponse(String resourceGroupName, String jobName, String jobExecutionName, + Context context); /** - * Get the verification id of a subscription used for verifying custom domains. + * Get details of a single job execution. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Job Name. + * @param jobExecutionName Job execution 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 the verification id of a subscription used for verifying custom domains. + * @return details of a single job execution. */ - String getCustomDomainVerificationId(); + JobExecution jobExecution(String resourceGroupName, String jobName, String jobExecutionName); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ResourceTags.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ResourceTags.java index b2cf92d0ebbc..c28a5ecf76fe 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ResourceTags.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ResourceTags.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -48,14 +48,6 @@ public ResourceTags withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Revision.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Revision.java index 5f83c296e50c..0e7adad5a822 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Revision.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Revision.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionHealthState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionHealthState.java index 4a3c0e74cd96..75e6bef19d95 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionHealthState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionHealthState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,17 +12,17 @@ */ public final class RevisionHealthState extends ExpandableStringEnum { /** - * Static value Healthy for RevisionHealthState. + * Healthy. */ public static final RevisionHealthState HEALTHY = fromString("Healthy"); /** - * Static value Unhealthy for RevisionHealthState. + * Unhealthy. */ public static final RevisionHealthState UNHEALTHY = fromString("Unhealthy"); /** - * Static value None for RevisionHealthState. + * None. */ public static final RevisionHealthState NONE = fromString("None"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionProvisioningState.java index 1d30087e32ed..cd498ddb285b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,27 +12,27 @@ */ public final class RevisionProvisioningState extends ExpandableStringEnum { /** - * Static value Provisioning for RevisionProvisioningState. + * Provisioning. */ public static final RevisionProvisioningState PROVISIONING = fromString("Provisioning"); /** - * Static value Provisioned for RevisionProvisioningState. + * Provisioned. */ public static final RevisionProvisioningState PROVISIONED = fromString("Provisioned"); /** - * Static value Failed for RevisionProvisioningState. + * Failed. */ public static final RevisionProvisioningState FAILED = fromString("Failed"); /** - * Static value Deprovisioning for RevisionProvisioningState. + * Deprovisioning. */ public static final RevisionProvisioningState DEPROVISIONING = fromString("Deprovisioning"); /** - * Static value Deprovisioned for RevisionProvisioningState. + * Deprovisioned. */ public static final RevisionProvisioningState DEPROVISIONED = fromString("Deprovisioned"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionRunningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionRunningState.java index d5ec4ea95a50..f03392f7edcd 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionRunningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionRunningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,32 +12,32 @@ */ public final class RevisionRunningState extends ExpandableStringEnum { /** - * Static value Running for RevisionRunningState. + * Running. */ public static final RevisionRunningState RUNNING = fromString("Running"); /** - * Static value Processing for RevisionRunningState. + * Processing. */ public static final RevisionRunningState PROCESSING = fromString("Processing"); /** - * Static value Stopped for RevisionRunningState. + * Stopped. */ public static final RevisionRunningState STOPPED = fromString("Stopped"); /** - * Static value Degraded for RevisionRunningState. + * Degraded. */ public static final RevisionRunningState DEGRADED = fromString("Degraded"); /** - * Static value Failed for RevisionRunningState. + * Failed. */ public static final RevisionRunningState FAILED = fromString("Failed"); /** - * Static value Unknown for RevisionRunningState. + * Unknown. */ public static final RevisionRunningState UNKNOWN = fromString("Unknown"); 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 index dcbadf50b1cf..79d7f6b67794 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -47,17 +47,6 @@ public Runtime withJava(RuntimeJava java) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (java() != null) { - java().validate(); - } - } - /** * {@inheritDoc} */ 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 index 46d95eea9b05..3372a32a304b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -47,14 +47,6 @@ public RuntimeJava withEnableMetrics(Boolean enableMetrics) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SandboxGroup.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SandboxGroup.java new file mode 100644 index 000000000000..9940e44267ae --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SandboxGroup.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.SandboxGroupInner; +import java.util.Map; + +/** + * An immutable client-side representation of SandboxGroup. + */ +public interface SandboxGroup { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + SandboxGroupProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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.SandboxGroupInner object. + * + * @return the inner object. + */ + SandboxGroupInner innerModel(); + + /** + * The entirety of the SandboxGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The SandboxGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SandboxGroup definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the SandboxGroup 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 SandboxGroup 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 SandboxGroup 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + SandboxGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SandboxGroup create(Context context); + } + + /** + * The stage of the SandboxGroup 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 SandboxGroup 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(SandboxGroupProperties properties); + } + } + + /** + * Begins update for the SandboxGroup resource. + * + * @return the stage of resource update. + */ + SandboxGroup.Update update(); + + /** + * The template for SandboxGroup update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SandboxGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SandboxGroup apply(Context context); + } + + /** + * The SandboxGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the SandboxGroup 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 SandboxGroup 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(SandboxGroupProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SandboxGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SandboxGroup refresh(Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SandboxGroupPatch.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SandboxGroupPatch.java new file mode 100644 index 000000000000..10a1cbb26f6b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SandboxGroupPatch.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.Map; + +/** + * A SandboxGroup resource for use in patch requests. + */ +@Fluent +public final class SandboxGroupPatch implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /* + * SandboxGroup properties that can be updated. + */ + private SandboxGroupPatchProperties properties; + + /** + * Creates an instance of SandboxGroupPatch class. + */ + public SandboxGroupPatch() { + } + + /** + * 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 SandboxGroupPatch object itself. + */ + public SandboxGroupPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: SandboxGroup properties that can be updated. + * + * @return the properties value. + */ + public SandboxGroupPatchProperties properties() { + return this.properties; + } + + /** + * Set the properties property: SandboxGroup properties that can be updated. + * + * @param properties the properties value to set. + * @return the SandboxGroupPatch object itself. + */ + public SandboxGroupPatch withProperties(SandboxGroupPatchProperties properties) { + this.properties = properties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SandboxGroupPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SandboxGroupPatch 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 SandboxGroupPatch. + */ + public static SandboxGroupPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SandboxGroupPatch deserializedSandboxGroupPatch = new SandboxGroupPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSandboxGroupPatch.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedSandboxGroupPatch.properties = SandboxGroupPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSandboxGroupPatch; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SandboxGroupPatchProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SandboxGroupPatchProperties.java new file mode 100644 index 000000000000..16b1ec02057d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SandboxGroupPatchProperties.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +/** + * SandboxGroup resource specific properties for patch requests. + */ +@Fluent +public final class SandboxGroupPatchProperties implements JsonSerializable { + /* + * The resource ID of the Azure Container Apps environment to link to the sandbox group. A sandbox group can be + * linked after creation, but the link cannot then be changed or removed. For subsequent create-or-update (PUT) + * requests, specify the same environment ID; omitting or changing it returns 409 Conflict. Omitting it from an + * update (PATCH) request leaves the existing link unchanged. + */ + private String environmentId; + + /** + * Creates an instance of SandboxGroupPatchProperties class. + */ + public SandboxGroupPatchProperties() { + } + + /** + * Get the environmentId property: The resource ID of the Azure Container Apps environment to link to the sandbox + * group. A sandbox group can be linked after creation, but the link cannot then be changed or removed. For + * subsequent create-or-update (PUT) requests, specify the same environment ID; omitting or changing it returns 409 + * Conflict. Omitting it from an update (PATCH) request leaves the existing link unchanged. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set the environmentId property: The resource ID of the Azure Container Apps environment to link to the sandbox + * group. A sandbox group can be linked after creation, but the link cannot then be changed or removed. For + * subsequent create-or-update (PUT) requests, specify the same environment ID; omitting or changing it returns 409 + * Conflict. Omitting it from an update (PATCH) request leaves the existing link unchanged. + * + * @param environmentId the environmentId value to set. + * @return the SandboxGroupPatchProperties object itself. + */ + public SandboxGroupPatchProperties withEnvironmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("environmentId", this.environmentId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SandboxGroupPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SandboxGroupPatchProperties 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 SandboxGroupPatchProperties. + */ + public static SandboxGroupPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SandboxGroupPatchProperties deserializedSandboxGroupPatchProperties = new SandboxGroupPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("environmentId".equals(fieldName)) { + deserializedSandboxGroupPatchProperties.environmentId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSandboxGroupPatchProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SandboxGroupProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SandboxGroupProperties.java new file mode 100644 index 000000000000..3b6d168f9f0d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SandboxGroupProperties.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +/** + * SandboxGroup resource specific properties. + */ +@Fluent +public final class SandboxGroupProperties implements JsonSerializable { + /* + * The resource ID of the Azure Container Apps environment to link to the sandbox group. A sandbox group can be + * linked after creation, but the link cannot then be changed or removed. For subsequent create-or-update (PUT) + * requests, specify the same environment ID; omitting or changing it returns 409 Conflict. Omitting it from an + * update (PATCH) request leaves the existing link unchanged. + */ + private String environmentId; + + /* + * The default domain of the linked Azure Container Apps environment. Sandbox endpoints use subdomains of this + * domain. This read-only property is populated by the service and is omitted when no environment is linked. + */ + private String defaultDomain; + + /* + * The provisioningState property. + */ + private SandboxGroupProvisioningState provisioningState; + + /** + * Creates an instance of SandboxGroupProperties class. + */ + public SandboxGroupProperties() { + } + + /** + * Get the environmentId property: The resource ID of the Azure Container Apps environment to link to the sandbox + * group. A sandbox group can be linked after creation, but the link cannot then be changed or removed. For + * subsequent create-or-update (PUT) requests, specify the same environment ID; omitting or changing it returns 409 + * Conflict. Omitting it from an update (PATCH) request leaves the existing link unchanged. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set the environmentId property: The resource ID of the Azure Container Apps environment to link to the sandbox + * group. A sandbox group can be linked after creation, but the link cannot then be changed or removed. For + * subsequent create-or-update (PUT) requests, specify the same environment ID; omitting or changing it returns 409 + * Conflict. Omitting it from an update (PATCH) request leaves the existing link unchanged. + * + * @param environmentId the environmentId value to set. + * @return the SandboxGroupProperties object itself. + */ + public SandboxGroupProperties withEnvironmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Get the defaultDomain property: The default domain of the linked Azure Container Apps environment. Sandbox + * endpoints use subdomains of this domain. This read-only property is populated by the service and is omitted when + * no environment is linked. + * + * @return the defaultDomain value. + */ + public String defaultDomain() { + return this.defaultDomain; + } + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public SandboxGroupProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("environmentId", this.environmentId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SandboxGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SandboxGroupProperties 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 SandboxGroupProperties. + */ + public static SandboxGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SandboxGroupProperties deserializedSandboxGroupProperties = new SandboxGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("environmentId".equals(fieldName)) { + deserializedSandboxGroupProperties.environmentId = reader.getString(); + } else if ("defaultDomain".equals(fieldName)) { + deserializedSandboxGroupProperties.defaultDomain = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedSandboxGroupProperties.provisioningState + = SandboxGroupProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSandboxGroupProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SandboxGroupProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SandboxGroupProvisioningState.java new file mode 100644 index 000000000000..50398a786814 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SandboxGroupProvisioningState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of the SandboxGroup. + */ +public final class SandboxGroupProvisioningState extends ExpandableStringEnum { + /** + * Resource has been created. + */ + public static final SandboxGroupProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Resource creation failed. + */ + public static final SandboxGroupProvisioningState FAILED = fromString("Failed"); + + /** + * Resource creation was canceled. + */ + public static final SandboxGroupProvisioningState CANCELED = fromString("Canceled"); + + /** + * The resource is being provisioned. + */ + public static final SandboxGroupProvisioningState IN_PROGRESS = fromString("InProgress"); + + /** + * The resource is being updated. + */ + public static final SandboxGroupProvisioningState UPDATING = fromString("Updating"); + + /** + * The resource is being deleted. + */ + public static final SandboxGroupProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of SandboxGroupProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SandboxGroupProvisioningState() { + } + + /** + * Creates or finds a SandboxGroupProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SandboxGroupProvisioningState. + */ + public static SandboxGroupProvisioningState fromString(String name) { + return fromString(name, SandboxGroupProvisioningState.class); + } + + /** + * Gets known SandboxGroupProvisioningState values. + * + * @return known SandboxGroupProvisioningState values. + */ + public static Collection values() { + return values(SandboxGroupProvisioningState.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SandboxGroups.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SandboxGroups.java new file mode 100644 index 000000000000..242638dfcf3a --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SandboxGroups.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 SandboxGroups. + */ +public interface SandboxGroups { + /** + * Get the properties of a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @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 properties of a SandboxGroup along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String sandboxGroupName, + Context context); + + /** + * Get the properties of a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @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 properties of a SandboxGroup. + */ + SandboxGroup getByResourceGroup(String resourceGroupName, String sandboxGroupName); + + /** + * Patches a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param properties 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. + */ + void update(String resourceGroupName, String sandboxGroupName, SandboxGroupPatch properties); + + /** + * Patches a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param properties 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. + */ + void update(String resourceGroupName, String sandboxGroupName, SandboxGroupPatch properties, Context context); + + /** + * Delete a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @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 sandboxGroupName); + + /** + * Delete a SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @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 sandboxGroupName, Context context); + + /** + * Get all SandboxGroups in a 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 all SandboxGroups in a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get all SandboxGroups in a 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 all SandboxGroups in a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get all SandboxGroups for a subscription. + * + * @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 all SandboxGroups for a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Get all SandboxGroups for a subscription. + * + * @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 all SandboxGroups for a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Get the properties of a SandboxGroup. + * + * @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 the properties of a SandboxGroup along with {@link Response}. + */ + SandboxGroup getById(String id); + + /** + * Get the properties of a SandboxGroup. + * + * @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 the properties of a SandboxGroup along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a SandboxGroup. + * + * @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 SandboxGroup. + * + * @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 SandboxGroup resource. + * + * @param name resource name. + * @return the first stage of the new SandboxGroup definition. + */ + SandboxGroup.DefinitionStages.Blank define(String name); +} 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 7340e4e8d0da..cc98751baffa 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -37,6 +37,12 @@ public final class Scale implements JsonSerializable { */ private Integer pollingInterval; + /* + * Optional. Whether custom scale rules can override the automatic scale rules. This property is only applicable to + * Function Apps. + */ + private Boolean allowScalingRuleOverride; + /* * Scaling rules. */ @@ -128,6 +134,28 @@ public Scale withPollingInterval(Integer pollingInterval) { return this; } + /** + * Get the allowScalingRuleOverride property: Optional. Whether custom scale rules can override the automatic scale + * rules. This property is only applicable to Function Apps. + * + * @return the allowScalingRuleOverride value. + */ + public Boolean allowScalingRuleOverride() { + return this.allowScalingRuleOverride; + } + + /** + * Set the allowScalingRuleOverride property: Optional. Whether custom scale rules can override the automatic scale + * rules. This property is only applicable to Function Apps. + * + * @param allowScalingRuleOverride the allowScalingRuleOverride value to set. + * @return the Scale object itself. + */ + public Scale withAllowScalingRuleOverride(Boolean allowScalingRuleOverride) { + this.allowScalingRuleOverride = allowScalingRuleOverride; + return this; + } + /** * Get the rules property: Scaling rules. * @@ -148,17 +176,6 @@ public Scale withRules(List rules) { 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} */ @@ -169,6 +186,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("maxReplicas", this.maxReplicas); jsonWriter.writeNumberField("cooldownPeriod", this.cooldownPeriod); jsonWriter.writeNumberField("pollingInterval", this.pollingInterval); + jsonWriter.writeBooleanField("allowScalingRuleOverride", this.allowScalingRuleOverride); jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -196,6 +214,8 @@ public static Scale fromJson(JsonReader jsonReader) throws IOException { deserializedScale.cooldownPeriod = reader.getNullable(JsonReader::getInt); } else if ("pollingInterval".equals(fieldName)) { deserializedScale.pollingInterval = reader.getNullable(JsonReader::getInt); + } else if ("allowScalingRuleOverride".equals(fieldName)) { + deserializedScale.allowScalingRuleOverride = reader.getNullable(JsonReader::getBoolean); } 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 index 2450afb2fa28..9b777e657e5a 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -72,14 +72,6 @@ public ScaleConfiguration withReadySessionInstances(Integer readySessionInstance return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleRule.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleRule.java index 1600f1fe5965..a1b7ef3e5d3c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleRule.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleRule.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -147,26 +147,6 @@ public ScaleRule withTcp(TcpScaleRule tcp) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (azureQueue() != null) { - azureQueue().validate(); - } - if (custom() != null) { - custom().validate(); - } - if (http() != null) { - http().validate(); - } - if (tcp() != null) { - tcp().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleRuleAuth.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleRuleAuth.java index 484986dbf8e0..c295e6cefc1b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleRuleAuth.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScaleRuleAuth.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -72,14 +72,6 @@ public ScaleRuleAuth withTriggerParameter(String triggerParameter) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScheduledEntry.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScheduledEntry.java index a343a5272664..bc330966e37d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScheduledEntry.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ScheduledEntry.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -100,20 +99,6 @@ public ScheduledEntry withDurationHours(int durationHours) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (weekDay() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property weekDay in model ScheduledEntry")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ScheduledEntry.class); - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Scheme.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Scheme.java index 7e5db52178ca..feb7b5045227 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Scheme.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Scheme.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,12 +12,12 @@ */ public final class Scheme extends ExpandableStringEnum { /** - * Static value HTTP for Scheme. + * HTTP. */ public static final Scheme HTTP = fromString("HTTP"); /** - * Static value HTTPS for Scheme. + * HTTPS. */ public static final Scheme HTTPS = fromString("HTTPS"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Secret.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Secret.java index 34838a2bb6e5..d0013f75355a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Secret.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Secret.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -125,14 +125,6 @@ public Secret withKeyVaultUrl(String keyVaultUrl) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SecretKeyVaultProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SecretKeyVaultProperties.java index 7bbb2b6bac73..febb0fc1e711 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SecretKeyVaultProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SecretKeyVaultProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -75,14 +75,6 @@ public SecretKeyVaultProperties withKeyVaultUrl(String keyVaultUrl) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SecretVolumeItem.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SecretVolumeItem.java index c1bc22b58433..bf7bc4777ccb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SecretVolumeItem.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SecretVolumeItem.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -74,14 +74,6 @@ public SecretVolumeItem withPath(String path) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SecretsCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SecretsCollection.java index a7c46963e8e3..b8471b67a281 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SecretsCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SecretsCollection.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Service.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Service.java index df27e5741c47..31b711715a77 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Service.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Service.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -48,19 +47,6 @@ public Service withType(String type) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (type() == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Missing required property type in model Service")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Service.class); - /** * {@inheritDoc} */ 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 0bf6482a7897..d5f98436662e 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -72,14 +72,6 @@ public ServiceBind withName(String name) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index f762c588cbc3..8f7c9e2e1db0 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -47,6 +47,11 @@ public final class SessionContainer implements JsonSerializable probes; + /** * Creates an instance of SessionContainer class. */ @@ -174,17 +179,23 @@ public SessionContainer withResources(SessionContainerResources resources) { } /** - * Validates the instance. + * Get the probes property: List of probes for the container. + * + * @return the probes value. + */ + public List probes() { + return this.probes; + } + + /** + * Set the probes property: List of probes for the container. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @param probes the probes value to set. + * @return the SessionContainer object itself. */ - public void validate() { - if (env() != null) { - env().forEach(e -> e.validate()); - } - if (resources() != null) { - resources().validate(); - } + public SessionContainer withProbes(List probes) { + this.probes = probes; + return this; } /** @@ -199,6 +210,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { 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); + jsonWriter.writeArrayField("probes", this.probes, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -232,6 +244,9 @@ public static SessionContainer fromJson(JsonReader jsonReader) throws IOExceptio deserializedSessionContainer.env = env; } else if ("resources".equals(fieldName)) { deserializedSessionContainer.resources = SessionContainerResources.fromJson(reader); + } else if ("probes".equals(fieldName)) { + List probes = reader.readArray(reader1 -> SessionProbe.fromJson(reader1)); + deserializedSessionContainer.probes = probes; } else { reader.skipChildren(); } 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 index 3a8dc5ac072f..94f602d6854c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -72,14 +72,6 @@ public SessionContainerResources withMemory(String memory) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index 59b318068c96..115d3dd1e675 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -47,14 +47,6 @@ public SessionIngress withTargetPort(Integer targetPort) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index 36279a48ba12..582224bb0135 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -47,14 +47,6 @@ public SessionNetworkConfiguration withStatus(SessionNetworkStatus status) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index e6e7e6b37e90..076f5c3ba3b2 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,12 +12,12 @@ */ public final class SessionNetworkStatus extends ExpandableStringEnum { /** - * Static value EgressEnabled for SessionNetworkStatus. + * EgressEnabled. */ public static final SessionNetworkStatus EGRESS_ENABLED = fromString("EgressEnabled"); /** - * Static value EgressDisabled for SessionNetworkStatus. + * EgressDisabled. */ public static final SessionNetworkStatus EGRESS_DISABLED = fromString("EgressDisabled"); 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 index a471b3513dc2..553fffc6de78 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -51,8 +51,7 @@ public interface SessionPool { Map tags(); /** - * Gets the identity property: Managed identities needed by a session pool to interact with other Azure services to - * not maintain any secrets or credentials in code. + * Gets the identity property: The managed service identities assigned to this resource. * * @return the identity value. */ @@ -73,7 +72,8 @@ public interface SessionPool { String environmentId(); /** - * Gets the containerType property: The container type of the sessions. + * Gets the containerType property: The container type of the sessions. You can use your own container to build the + * session pool, or you can use a predefined container to run workload with specific language. * * @return the containerType value. */ @@ -274,11 +274,9 @@ interface WithTags { */ interface WithIdentity { /** - * Specifies the identity property: Managed identities needed by a session pool to interact with other Azure - * services to not maintain any secrets or credentials in code.. + * Specifies the identity property: The managed service identities assigned to this resource.. * - * @param identity Managed identities needed by a session pool to interact with other Azure services to not - * maintain any secrets or credentials in code. + * @param identity The managed service identities assigned to this resource. * @return the next definition stage. */ WithCreate withIdentity(ManagedServiceIdentity identity); @@ -302,9 +300,11 @@ interface WithEnvironmentId { */ interface WithContainerType { /** - * Specifies the containerType property: The container type of the sessions.. + * Specifies the containerType property: The container type of the sessions. You can use your own container + * to build the session pool, or you can use a predefined container to run workload with specific language.. * - * @param containerType The container type of the sessions. + * @param containerType The container type of the sessions. You can use your own container to build the + * session pool, or you can use a predefined container to run workload with specific language. * @return the next definition stage. */ WithCreate withContainerType(ContainerType containerType); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolIdentityLifeCycle.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolIdentityLifeCycle.java new file mode 100644 index 000000000000..bfb510ea2a52 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionPoolIdentityLifeCycle.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 Session Pool during which the Managed Identity should be available. + */ +public final class SessionPoolIdentityLifeCycle extends ExpandableStringEnum { + /** + * Do not use managed identity during any lifecycle stage. + */ + public static final SessionPoolIdentityLifeCycle NONE = fromString("None"); + + /** + * Use managed identity during the main stage of the Container App lifecycle. + */ + public static final SessionPoolIdentityLifeCycle MAIN = fromString("Main"); + + /** + * Creates a new instance of SessionPoolIdentityLifeCycle value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SessionPoolIdentityLifeCycle() { + } + + /** + * Creates or finds a SessionPoolIdentityLifeCycle from its string representation. + * + * @param name a name to look for. + * @return the corresponding SessionPoolIdentityLifeCycle. + */ + public static SessionPoolIdentityLifeCycle fromString(String name) { + return fromString(name, SessionPoolIdentityLifeCycle.class); + } + + /** + * Gets known SessionPoolIdentityLifeCycle values. + * + * @return known SessionPoolIdentityLifeCycle values. + */ + public static Collection values() { + return values(SessionPoolIdentityLifeCycle.class); + } +} 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 index 8b4fd83bbc76..7f7ed09f11e4 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,27 +12,27 @@ */ public final class SessionPoolProvisioningState extends ExpandableStringEnum { /** - * Static value InProgress for SessionPoolProvisioningState. + * InProgress. */ public static final SessionPoolProvisioningState IN_PROGRESS = fromString("InProgress"); /** - * Static value Succeeded for SessionPoolProvisioningState. + * Succeeded. */ public static final SessionPoolProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for SessionPoolProvisioningState. + * Failed. */ public static final SessionPoolProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for SessionPoolProvisioningState. + * Canceled. */ public static final SessionPoolProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Deleting for SessionPoolProvisioningState. + * Deleting. */ public static final SessionPoolProvisioningState DELETING = fromString("Deleting"); 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 index 4d80150f7cf5..4215a928582d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -72,14 +72,6 @@ public SessionPoolSecret withValue(String value) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index 8bf5d7545782..b543110cc5b2 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -211,20 +211,6 @@ public SessionNetworkConfiguration sessionNetworkConfiguration() { 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} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionProbe.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionProbe.java new file mode 100644 index 000000000000..532d0149d2de --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionProbe.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 probe configuration. + */ +@Fluent +public final class SessionProbe implements JsonSerializable { + /* + * Denotes the type of probe. Can be Liveness or Startup, Readiness probe is not supported in sessions. Type must be + * unique for each probe within the context of a list of probes (SessionProbes). + */ + private SessionProbeType type; + + /* + * HTTPGet specifies the http request to perform. + */ + private SessionProbeHttpGet httpGet; + + /* + * TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported. + */ + private SessionProbeTcpSocket tcpSocket; + + /* + * Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum + * value is 1. Maximum value is 10. + */ + private Integer failureThreshold; + + /* + * Number of seconds after the container has started before liveness probes are initiated. Minimum value is 1. + * Maximum value is 60. + */ + private Integer initialDelaySeconds; + + /* + * How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. Maximum value is 240. + */ + private Integer periodSeconds; + + /* + * Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must + * be 1 for liveness and startup. Minimum value is 1. Maximum value is 10. + */ + private Integer successThreshold; + + /* + * Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the + * duration in seconds after the processes running in the pod are sent a termination signal and the time when the + * processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your + * process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value + * overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop + * immediately via the kill signal (no opportunity to shut down). This is an alpha field and requires enabling + * ProbeTerminationGracePeriod feature gate. Maximum value is 3600 seconds (1 hour) + */ + private Long terminationGracePeriodSeconds; + + /* + * Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. Maximum value is + * 240. + */ + private Integer timeoutSeconds; + + /** + * Creates an instance of SessionProbe class. + */ + public SessionProbe() { + } + + /** + * Get the type property: Denotes the type of probe. Can be Liveness or Startup, Readiness probe is not supported in + * sessions. Type must be unique for each probe within the context of a list of probes (SessionProbes). + * + * @return the type value. + */ + public SessionProbeType type() { + return this.type; + } + + /** + * Set the type property: Denotes the type of probe. Can be Liveness or Startup, Readiness probe is not supported in + * sessions. Type must be unique for each probe within the context of a list of probes (SessionProbes). + * + * @param type the type value to set. + * @return the SessionProbe object itself. + */ + public SessionProbe withType(SessionProbeType type) { + this.type = type; + return this; + } + + /** + * Get the httpGet property: HTTPGet specifies the http request to perform. + * + * @return the httpGet value. + */ + public SessionProbeHttpGet httpGet() { + return this.httpGet; + } + + /** + * Set the httpGet property: HTTPGet specifies the http request to perform. + * + * @param httpGet the httpGet value to set. + * @return the SessionProbe object itself. + */ + public SessionProbe withHttpGet(SessionProbeHttpGet httpGet) { + this.httpGet = httpGet; + return this; + } + + /** + * Get the tcpSocket property: TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported. + * + * @return the tcpSocket value. + */ + public SessionProbeTcpSocket tcpSocket() { + return this.tcpSocket; + } + + /** + * Set the tcpSocket property: TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported. + * + * @param tcpSocket the tcpSocket value to set. + * @return the SessionProbe object itself. + */ + public SessionProbe withTcpSocket(SessionProbeTcpSocket tcpSocket) { + this.tcpSocket = tcpSocket; + return this; + } + + /** + * Get the failureThreshold property: Minimum consecutive failures for the probe to be considered failed after + * having succeeded. Defaults to 3. Minimum value is 1. Maximum value is 10. + * + * @return the failureThreshold value. + */ + public Integer failureThreshold() { + return this.failureThreshold; + } + + /** + * Set the failureThreshold property: Minimum consecutive failures for the probe to be considered failed after + * having succeeded. Defaults to 3. Minimum value is 1. Maximum value is 10. + * + * @param failureThreshold the failureThreshold value to set. + * @return the SessionProbe object itself. + */ + public SessionProbe withFailureThreshold(Integer failureThreshold) { + this.failureThreshold = failureThreshold; + return this; + } + + /** + * Get the initialDelaySeconds property: Number of seconds after the container has started before liveness probes + * are initiated. Minimum value is 1. Maximum value is 60. + * + * @return the initialDelaySeconds value. + */ + public Integer initialDelaySeconds() { + return this.initialDelaySeconds; + } + + /** + * Set the initialDelaySeconds property: Number of seconds after the container has started before liveness probes + * are initiated. Minimum value is 1. Maximum value is 60. + * + * @param initialDelaySeconds the initialDelaySeconds value to set. + * @return the SessionProbe object itself. + */ + public SessionProbe withInitialDelaySeconds(Integer initialDelaySeconds) { + this.initialDelaySeconds = initialDelaySeconds; + return this; + } + + /** + * Get the periodSeconds property: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value + * is 1. Maximum value is 240. + * + * @return the periodSeconds value. + */ + public Integer periodSeconds() { + return this.periodSeconds; + } + + /** + * Set the periodSeconds property: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value + * is 1. Maximum value is 240. + * + * @param periodSeconds the periodSeconds value to set. + * @return the SessionProbe object itself. + */ + public SessionProbe withPeriodSeconds(Integer periodSeconds) { + this.periodSeconds = periodSeconds; + return this; + } + + /** + * Get the successThreshold property: Minimum consecutive successes for the probe to be considered successful after + * having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. Maximum value is 10. + * + * @return the successThreshold value. + */ + public Integer successThreshold() { + return this.successThreshold; + } + + /** + * Set the successThreshold property: Minimum consecutive successes for the probe to be considered successful after + * having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. Maximum value is 10. + * + * @param successThreshold the successThreshold value to set. + * @return the SessionProbe object itself. + */ + public SessionProbe withSuccessThreshold(Integer successThreshold) { + this.successThreshold = successThreshold; + return this; + } + + /** + * Get the terminationGracePeriodSeconds property: Optional duration in seconds the pod needs to terminate + * gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod + * are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this + * value longer than the expected cleanup time for your process. If this value is nil, the pod's + * terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. + * Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity + * to shut down). This is an alpha field and requires enabling ProbeTerminationGracePeriod feature gate. Maximum + * value is 3600 seconds (1 hour). + * + * @return the terminationGracePeriodSeconds value. + */ + public Long terminationGracePeriodSeconds() { + return this.terminationGracePeriodSeconds; + } + + /** + * Set the terminationGracePeriodSeconds property: Optional duration in seconds the pod needs to terminate + * gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod + * are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this + * value longer than the expected cleanup time for your process. If this value is nil, the pod's + * terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. + * Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity + * to shut down). This is an alpha field and requires enabling ProbeTerminationGracePeriod feature gate. Maximum + * value is 3600 seconds (1 hour). + * + * @param terminationGracePeriodSeconds the terminationGracePeriodSeconds value to set. + * @return the SessionProbe object itself. + */ + public SessionProbe withTerminationGracePeriodSeconds(Long terminationGracePeriodSeconds) { + this.terminationGracePeriodSeconds = terminationGracePeriodSeconds; + return this; + } + + /** + * Get the timeoutSeconds property: Number of seconds after which the probe times out. Defaults to 1 second. Minimum + * value is 1. Maximum value is 240. + * + * @return the timeoutSeconds value. + */ + public Integer timeoutSeconds() { + return this.timeoutSeconds; + } + + /** + * Set the timeoutSeconds property: Number of seconds after which the probe times out. Defaults to 1 second. Minimum + * value is 1. Maximum value is 240. + * + * @param timeoutSeconds the timeoutSeconds value to set. + * @return the SessionProbe object itself. + */ + public SessionProbe withTimeoutSeconds(Integer timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeJsonField("httpGet", this.httpGet); + jsonWriter.writeJsonField("tcpSocket", this.tcpSocket); + jsonWriter.writeNumberField("failureThreshold", this.failureThreshold); + jsonWriter.writeNumberField("initialDelaySeconds", this.initialDelaySeconds); + jsonWriter.writeNumberField("periodSeconds", this.periodSeconds); + jsonWriter.writeNumberField("successThreshold", this.successThreshold); + jsonWriter.writeNumberField("terminationGracePeriodSeconds", this.terminationGracePeriodSeconds); + jsonWriter.writeNumberField("timeoutSeconds", this.timeoutSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionProbe from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionProbe 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 SessionProbe. + */ + public static SessionProbe fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionProbe deserializedSessionProbe = new SessionProbe(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedSessionProbe.type = SessionProbeType.fromString(reader.getString()); + } else if ("httpGet".equals(fieldName)) { + deserializedSessionProbe.httpGet = SessionProbeHttpGet.fromJson(reader); + } else if ("tcpSocket".equals(fieldName)) { + deserializedSessionProbe.tcpSocket = SessionProbeTcpSocket.fromJson(reader); + } else if ("failureThreshold".equals(fieldName)) { + deserializedSessionProbe.failureThreshold = reader.getNullable(JsonReader::getInt); + } else if ("initialDelaySeconds".equals(fieldName)) { + deserializedSessionProbe.initialDelaySeconds = reader.getNullable(JsonReader::getInt); + } else if ("periodSeconds".equals(fieldName)) { + deserializedSessionProbe.periodSeconds = reader.getNullable(JsonReader::getInt); + } else if ("successThreshold".equals(fieldName)) { + deserializedSessionProbe.successThreshold = reader.getNullable(JsonReader::getInt); + } else if ("terminationGracePeriodSeconds".equals(fieldName)) { + deserializedSessionProbe.terminationGracePeriodSeconds = reader.getNullable(JsonReader::getLong); + } else if ("timeoutSeconds".equals(fieldName)) { + deserializedSessionProbe.timeoutSeconds = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionProbe; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionProbeHttpGet.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionProbeHttpGet.java new file mode 100644 index 000000000000..da8915c67031 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionProbeHttpGet.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +/** + * HTTPGet specifies the http request to perform. + */ +@Fluent +public final class SessionProbeHttpGet implements JsonSerializable { + /* + * Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. + */ + private String host; + + /* + * Custom headers to set in the request. HTTP allows repeated headers. + */ + private List httpHeaders; + + /* + * Path to access on the HTTP server. + */ + private String path; + + /* + * Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an + * IANA_SVC_NAME. + */ + private int port; + + /* + * Scheme to use for connecting to the host. Defaults to HTTP. + */ + private Scheme scheme; + + /** + * Creates an instance of SessionProbeHttpGet class. + */ + public SessionProbeHttpGet() { + } + + /** + * Get the host property: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in + * httpHeaders instead. + * + * @return the host value. + */ + public String host() { + return this.host; + } + + /** + * Set the host property: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in + * httpHeaders instead. + * + * @param host the host value to set. + * @return the SessionProbeHttpGet object itself. + */ + public SessionProbeHttpGet withHost(String host) { + this.host = host; + return this; + } + + /** + * Get the httpHeaders property: Custom headers to set in the request. HTTP allows repeated headers. + * + * @return the httpHeaders value. + */ + public List httpHeaders() { + return this.httpHeaders; + } + + /** + * Set the httpHeaders property: Custom headers to set in the request. HTTP allows repeated headers. + * + * @param httpHeaders the httpHeaders value to set. + * @return the SessionProbeHttpGet object itself. + */ + public SessionProbeHttpGet withHttpHeaders(List httpHeaders) { + this.httpHeaders = httpHeaders; + return this; + } + + /** + * Get the path property: Path to access on the HTTP server. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Path to access on the HTTP server. + * + * @param path the path value to set. + * @return the SessionProbeHttpGet object itself. + */ + public SessionProbeHttpGet withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the port property: Name or number of the port to access on the container. Number must be in the range 1 to + * 65535. Name must be an IANA_SVC_NAME. + * + * @return the port value. + */ + public int port() { + return this.port; + } + + /** + * Set the port property: Name or number of the port to access on the container. Number must be in the range 1 to + * 65535. Name must be an IANA_SVC_NAME. + * + * @param port the port value to set. + * @return the SessionProbeHttpGet object itself. + */ + public SessionProbeHttpGet withPort(int port) { + this.port = port; + return this; + } + + /** + * Get the scheme property: Scheme to use for connecting to the host. Defaults to HTTP. + * + * @return the scheme value. + */ + public Scheme scheme() { + return this.scheme; + } + + /** + * Set the scheme property: Scheme to use for connecting to the host. Defaults to HTTP. + * + * @param scheme the scheme value to set. + * @return the SessionProbeHttpGet object itself. + */ + public SessionProbeHttpGet withScheme(Scheme scheme) { + this.scheme = scheme; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("port", this.port); + jsonWriter.writeStringField("host", this.host); + jsonWriter.writeArrayField("httpHeaders", this.httpHeaders, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeStringField("scheme", this.scheme == null ? null : this.scheme.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionProbeHttpGet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionProbeHttpGet 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 SessionProbeHttpGet. + */ + public static SessionProbeHttpGet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionProbeHttpGet deserializedSessionProbeHttpGet = new SessionProbeHttpGet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("port".equals(fieldName)) { + deserializedSessionProbeHttpGet.port = reader.getInt(); + } else if ("host".equals(fieldName)) { + deserializedSessionProbeHttpGet.host = reader.getString(); + } else if ("httpHeaders".equals(fieldName)) { + List httpHeaders + = reader.readArray(reader1 -> SessionProbeHttpGetHttpHeadersItem.fromJson(reader1)); + deserializedSessionProbeHttpGet.httpHeaders = httpHeaders; + } else if ("path".equals(fieldName)) { + deserializedSessionProbeHttpGet.path = reader.getString(); + } else if ("scheme".equals(fieldName)) { + deserializedSessionProbeHttpGet.scheme = Scheme.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionProbeHttpGet; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionProbeHttpGetHttpHeadersItem.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionProbeHttpGetHttpHeadersItem.java new file mode 100644 index 000000000000..9480cb0e3cf9 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionProbeHttpGetHttpHeadersItem.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +/** + * HTTPHeader describes a custom header to be used in HTTP probes. + */ +@Fluent +public final class SessionProbeHttpGetHttpHeadersItem implements JsonSerializable { + /* + * The header field name + */ + private String name; + + /* + * The header field value + */ + private String value; + + /** + * Creates an instance of SessionProbeHttpGetHttpHeadersItem class. + */ + public SessionProbeHttpGetHttpHeadersItem() { + } + + /** + * Get the name property: The header field name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The header field name. + * + * @param name the name value to set. + * @return the SessionProbeHttpGetHttpHeadersItem object itself. + */ + public SessionProbeHttpGetHttpHeadersItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The header field value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The header field value. + * + * @param value the value value to set. + * @return the SessionProbeHttpGetHttpHeadersItem object itself. + */ + public SessionProbeHttpGetHttpHeadersItem withValue(String value) { + this.value = value; + return this; + } + + /** + * {@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 SessionProbeHttpGetHttpHeadersItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionProbeHttpGetHttpHeadersItem 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 SessionProbeHttpGetHttpHeadersItem. + */ + public static SessionProbeHttpGetHttpHeadersItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionProbeHttpGetHttpHeadersItem deserializedSessionProbeHttpGetHttpHeadersItem + = new SessionProbeHttpGetHttpHeadersItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSessionProbeHttpGetHttpHeadersItem.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedSessionProbeHttpGetHttpHeadersItem.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionProbeHttpGetHttpHeadersItem; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionProbeTcpSocket.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionProbeTcpSocket.java new file mode 100644 index 000000000000..7a5000e23efc --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionProbeTcpSocket.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +/** + * TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported. + */ +@Fluent +public final class SessionProbeTcpSocket implements JsonSerializable { + /* + * Optional: Host name to connect to, defaults to the pod IP. + */ + private String host; + + /* + * Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an + * IANA_SVC_NAME. + */ + private int port; + + /** + * Creates an instance of SessionProbeTcpSocket class. + */ + public SessionProbeTcpSocket() { + } + + /** + * Get the host property: Optional: Host name to connect to, defaults to the pod IP. + * + * @return the host value. + */ + public String host() { + return this.host; + } + + /** + * Set the host property: Optional: Host name to connect to, defaults to the pod IP. + * + * @param host the host value to set. + * @return the SessionProbeTcpSocket object itself. + */ + public SessionProbeTcpSocket withHost(String host) { + this.host = host; + return this; + } + + /** + * Get the port property: Number or name of the port to access on the container. Number must be in the range 1 to + * 65535. Name must be an IANA_SVC_NAME. + * + * @return the port value. + */ + public int port() { + return this.port; + } + + /** + * Set the port property: Number or name of the port to access on the container. Number must be in the range 1 to + * 65535. Name must be an IANA_SVC_NAME. + * + * @param port the port value to set. + * @return the SessionProbeTcpSocket object itself. + */ + public SessionProbeTcpSocket withPort(int port) { + this.port = port; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("port", this.port); + jsonWriter.writeStringField("host", this.host); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionProbeTcpSocket from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionProbeTcpSocket 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 SessionProbeTcpSocket. + */ + public static SessionProbeTcpSocket fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionProbeTcpSocket deserializedSessionProbeTcpSocket = new SessionProbeTcpSocket(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("port".equals(fieldName)) { + deserializedSessionProbeTcpSocket.port = reader.getInt(); + } else if ("host".equals(fieldName)) { + deserializedSessionProbeTcpSocket.host = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionProbeTcpSocket; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionProbeType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionProbeType.java new file mode 100644 index 000000000000..7ac7a039a8b5 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SessionProbeType.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Denotes the type of probe. Can be Liveness or Startup, Readiness probe is not supported in sessions. Type must be + * unique for each probe within the context of a list of probes (SessionProbes). + */ +public final class SessionProbeType extends ExpandableStringEnum { + /** + * Checks whether the session is still running and healthy. + */ + public static final SessionProbeType LIVENESS = fromString("Liveness"); + + /** + * Checks whether the session has started successfully. + */ + public static final SessionProbeType STARTUP = fromString("Startup"); + + /** + * Creates a new instance of SessionProbeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SessionProbeType() { + } + + /** + * Creates or finds a SessionProbeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SessionProbeType. + */ + public static SessionProbeType fromString(String name) { + return fromString(name, SessionProbeType.class); + } + + /** + * Gets known SessionProbeType values. + * + * @return known SessionProbeType values. + */ + public static Collection values() { + return values(SessionProbeType.class); + } +} 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 index 8ae7f727a55f..7d1efe92df95 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -127,14 +127,6 @@ public SessionRegistryCredentials withIdentity(String identity) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 14349f87c7ce..6e2b5db5fa08 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControlOperationState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControlOperationState.java index 512eb73c3744..4289d95d93f1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControlOperationState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControlOperationState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,22 +12,22 @@ */ public final class SourceControlOperationState extends ExpandableStringEnum { /** - * Static value InProgress for SourceControlOperationState. + * InProgress. */ public static final SourceControlOperationState IN_PROGRESS = fromString("InProgress"); /** - * Static value Succeeded for SourceControlOperationState. + * Succeeded. */ public static final SourceControlOperationState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for SourceControlOperationState. + * Failed. */ public static final SourceControlOperationState FAILED = fromString("Failed"); /** - * Static value Canceled for SourceControlOperationState. + * Canceled. */ public static final SourceControlOperationState CANCELED = fromString("Canceled"); 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 index 591b167a3b6d..6781c474df21 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -89,27 +89,6 @@ public SpringBootAdminComponent withServiceBinds(List 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} */ 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 index 70e5e50c9bad..1bb66ef03e9e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -64,24 +64,6 @@ public SpringCloudConfigComponent withServiceBinds(List e.validate()); - } - if (scale() != null) { - scale().validate(); - } - if (serviceBinds() != null) { - serviceBinds().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ 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 index 2612b6a770c6..5f4cd38cbade 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -89,27 +89,6 @@ public SpringCloudEurekaComponent withServiceBinds(List e.validate()); - } - if (scale() != null) { - scale().validate(); - } - if (serviceBinds() != null) { - serviceBinds().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Status.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Status.java new file mode 100644 index 000000000000..f2426961df69 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Status.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status of the label history record. + */ +public final class Status extends ExpandableStringEnum { + /** + * The label operation completed successfully. + */ + public static final Status SUCCEEDED = fromString("Succeeded"); + + /** + * The label operation failed. + */ + public static final Status FAILED = fromString("Failed"); + + /** + * The label operation is starting. + */ + public static final Status STARTING = fromString("Starting"); + + /** + * Creates a new instance of Status value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Status() { + } + + /** + * Creates or finds a Status from its string representation. + * + * @param name a name to look for. + * @return the corresponding Status. + */ + public static Status fromString(String name) { + return fromString(name, Status.class); + } + + /** + * Gets known Status values. + * + * @return known Status values. + */ + public static Collection values() { + return values(Status.class); + } +} 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 8986844d2c11..87ddc32a65ef 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,22 +12,22 @@ */ public final class StorageType extends ExpandableStringEnum { /** - * Static value AzureFile for StorageType. + * AzureFile. */ public static final StorageType AZURE_FILE = fromString("AzureFile"); /** - * Static value EmptyDir for StorageType. + * EmptyDir. */ public static final StorageType EMPTY_DIR = fromString("EmptyDir"); /** - * Static value Secret for StorageType. + * Secret. */ public static final StorageType SECRET = fromString("Secret"); /** - * Static value NfsAzureFile for StorageType. + * NfsAzureFile. */ public static final StorageType NFS_AZURE_FILE = fromString("NfsAzureFile"); 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 721410594a0f..6963494aa341 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -102,17 +102,6 @@ public TcpScaleRule withIdentity(String identity) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (auth() != null) { - auth().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Template.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Template.java index bbdc4873cf84..4c861108b129 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Template.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Template.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -209,29 +209,6 @@ public Template withServiceBinds(List serviceBinds) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (initContainers() != null) { - initContainers().forEach(e -> e.validate()); - } - if (containers() != null) { - containers().forEach(e -> e.validate()); - } - if (scale() != null) { - scale().validate(); - } - if (volumes() != null) { - volumes().forEach(e -> e.validate()); - } - if (serviceBinds() != null) { - serviceBinds().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TokenStore.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TokenStore.java index 71d70782e2fc..74c28d572b68 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TokenStore.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TokenStore.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -110,17 +110,6 @@ public TokenStore withAzureBlobStorage(BlobStorageTokenStore azureBlobStorage) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (azureBlobStorage() != null) { - azureBlobStorage().validate(); - } - } - /** * {@inheritDoc} */ 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 000000000000..d6ca37f4aaa8 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TracesConfiguration.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + } + + /** + * {@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/TrafficWeight.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TrafficWeight.java index 32f692c0f4d4..59b37affa3d6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TrafficWeight.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TrafficWeight.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -122,14 +122,6 @@ public TrafficWeight withLabel(String label) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TriggerType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TriggerType.java index 1054e919cb45..805902ee9fc2 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TriggerType.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TriggerType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,17 +12,17 @@ */ public final class TriggerType extends ExpandableStringEnum { /** - * Static value Schedule for TriggerType. + * Schedule. */ public static final TriggerType SCHEDULE = fromString("Schedule"); /** - * Static value Event for TriggerType. + * Event. */ public static final TriggerType EVENT = fromString("Event"); /** - * Static value Manual for TriggerType. + * Manual. */ public static final TriggerType MANUAL = fromString("Manual"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Twitter.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Twitter.java index 82685350e3e8..7fd50ac44ef8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Twitter.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Twitter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -75,17 +75,6 @@ public Twitter withRegistration(TwitterRegistration registration) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (registration() != null) { - registration().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TwitterRegistration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TwitterRegistration.java index 7a2bf9b52e26..e2d63454fb7f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TwitterRegistration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TwitterRegistration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -83,14 +83,6 @@ public TwitterRegistration withConsumerSecretSettingName(String consumerSecretSe return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Type.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Type.java index 5e8d8127dc1a..0e8a090c6d59 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Type.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Type.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,17 +12,17 @@ */ public final class Type extends ExpandableStringEnum { /** - * Static value Liveness for Type. + * Liveness. */ public static final Type LIVENESS = fromString("Liveness"); /** - * Static value Readiness for Type. + * Readiness. */ public static final Type READINESS = fromString("Readiness"); /** - * Static value Startup for Type. + * Startup. */ public static final Type STARTUP = fromString("Startup"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/UnauthenticatedClientActionV2.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/UnauthenticatedClientActionV2.java index ab126cc9c4d0..60970d2c80c5 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/UnauthenticatedClientActionV2.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/UnauthenticatedClientActionV2.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -9,22 +9,22 @@ */ public enum UnauthenticatedClientActionV2 { /** - * Enum value RedirectToLoginPage. + * RedirectToLoginPage. */ REDIRECT_TO_LOGIN_PAGE("RedirectToLoginPage"), /** - * Enum value AllowAnonymous. + * AllowAnonymous. */ ALLOW_ANONYMOUS("AllowAnonymous"), /** - * Enum value Return401. + * Return401. */ RETURN401("Return401"), /** - * Enum value Return403. + * Return403. */ RETURN403("Return403"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Usage.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Usage.java index a47794e3061b..ff3cf7976f79 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Usage.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Usage.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/UsageName.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/UsageName.java index 2f769a0cb724..ebe09b75decc 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/UsageName.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/UsageName.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The Usage Names. */ -@Fluent +@Immutable public final class UsageName implements JsonSerializable { /* * The name of the resource. @@ -29,7 +29,7 @@ public final class UsageName implements JsonSerializable { /** * Creates an instance of UsageName class. */ - public UsageName() { + private UsageName() { } /** @@ -41,17 +41,6 @@ public String value() { return this.value; } - /** - * Set the value property: The name of the resource. - * - * @param value the value value to set. - * @return the UsageName object itself. - */ - public UsageName withValue(String value) { - this.value = value; - return this; - } - /** * Get the localizedValue property: The localized name of the resource. * @@ -61,25 +50,6 @@ public String localizedValue() { return this.localizedValue; } - /** - * Set the localizedValue property: The localized name of the resource. - * - * @param localizedValue the localizedValue value to set. - * @return the UsageName object itself. - */ - public UsageName withLocalizedValue(String localizedValue) { - this.localizedValue = localizedValue; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Usages.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Usages.java index 8121f34a3248..aef587c3c250 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Usages.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Usages.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -20,7 +20,7 @@ public interface Usages { * @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 paginated response with {@link PagedIterable}. + * @return paged collection of Usage items as paginated response with {@link PagedIterable}. */ PagedIterable list(String location); @@ -34,7 +34,7 @@ public interface Usages { * @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 paginated response with {@link PagedIterable}. + * @return paged collection of Usage items as paginated response with {@link PagedIterable}. */ PagedIterable list(String location, Context context); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/UserAssignedIdentity.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/UserAssignedIdentity.java index 6100dcdc7b8a..fac5edf29434 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/UserAssignedIdentity.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/UserAssignedIdentity.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -10,7 +10,6 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; -import java.util.UUID; /** * User assigned identity properties. @@ -20,12 +19,12 @@ public final class UserAssignedIdentity implements JsonSerializable UUID.fromString(nonNullReader.getString())); + deserializedUserAssignedIdentity.principalId = reader.getString(); } else if ("clientId".equals(fieldName)) { - deserializedUserAssignedIdentity.clientId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedUserAssignedIdentity.clientId = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VnetConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VnetConfiguration.java index bb5c96530ad7..b6696d4cbf5e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VnetConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VnetConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -163,14 +163,6 @@ public VnetConfiguration withPlatformReservedDnsIp(String platformReservedDnsIp) return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VnetConnection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VnetConnection.java new file mode 100644 index 000000000000..4bd6ef4e5684 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VnetConnection.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.VnetConnectionInner; + +/** + * An immutable client-side representation of VnetConnection. + */ +public interface VnetConnection { + /** + * 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. + */ + VnetConnectionProperties 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.VnetConnectionInner object. + * + * @return the inner object. + */ + VnetConnectionInner innerModel(); + + /** + * The entirety of the VnetConnection definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The VnetConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the VnetConnection definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the VnetConnection definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, sandboxGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @return the next definition stage. + */ + WithCreate withExistingSandboxGroup(String resourceGroupName, String sandboxGroupName); + } + + /** + * The stage of the VnetConnection 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. + */ + VnetConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VnetConnection create(Context context); + } + + /** + * The stage of the VnetConnection 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(VnetConnectionProperties properties); + } + } + + /** + * Begins update for the VnetConnection resource. + * + * @return the stage of resource update. + */ + VnetConnection.Update update(); + + /** + * The template for VnetConnection update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VnetConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VnetConnection apply(Context context); + } + + /** + * The VnetConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the VnetConnection 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(VnetConnectionProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VnetConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VnetConnection refresh(Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VnetConnectionProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VnetConnectionProperties.java new file mode 100644 index 000000000000..389763978228 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VnetConnectionProperties.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +/** + * VnetConnection resource specific properties. + */ +@Fluent +public final class VnetConnectionProperties implements JsonSerializable { + /* + * The provisioningState property. + */ + private VnetConnectionProvisioningState provisioningState; + + /* + * Resource ID of the subnet that sandboxes in the parent SandboxGroup will be connected to. + */ + private String subnetId; + + /** + * Creates an instance of VnetConnectionProperties class. + */ + public VnetConnectionProperties() { + } + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public VnetConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the subnetId property: Resource ID of the subnet that sandboxes in the parent SandboxGroup will be connected + * to. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: Resource ID of the subnet that sandboxes in the parent SandboxGroup will be connected + * to. + * + * @param subnetId the subnetId value to set. + * @return the VnetConnectionProperties object itself. + */ + public VnetConnectionProperties withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subnetId", this.subnetId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VnetConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VnetConnectionProperties 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 VnetConnectionProperties. + */ + public static VnetConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VnetConnectionProperties deserializedVnetConnectionProperties = new VnetConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedVnetConnectionProperties.provisioningState + = VnetConnectionProvisioningState.fromString(reader.getString()); + } else if ("subnetId".equals(fieldName)) { + deserializedVnetConnectionProperties.subnetId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVnetConnectionProperties; + }); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VnetConnectionProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VnetConnectionProvisioningState.java new file mode 100644 index 000000000000..76dfa3841b06 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VnetConnectionProvisioningState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of the VnetConnection. + */ +public final class VnetConnectionProvisioningState extends ExpandableStringEnum { + /** + * Resource has been created. + */ + public static final VnetConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Resource creation failed. + */ + public static final VnetConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Resource creation was canceled. + */ + public static final VnetConnectionProvisioningState CANCELED = fromString("Canceled"); + + /** + * The resource is being provisioned. + */ + public static final VnetConnectionProvisioningState IN_PROGRESS = fromString("InProgress"); + + /** + * The resource is being updated. + */ + public static final VnetConnectionProvisioningState UPDATING = fromString("Updating"); + + /** + * The resource is being deleted. + */ + public static final VnetConnectionProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of VnetConnectionProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VnetConnectionProvisioningState() { + } + + /** + * Creates or finds a VnetConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding VnetConnectionProvisioningState. + */ + public static VnetConnectionProvisioningState fromString(String name) { + return fromString(name, VnetConnectionProvisioningState.class); + } + + /** + * Gets known VnetConnectionProvisioningState values. + * + * @return known VnetConnectionProvisioningState values. + */ + public static Collection values() { + return values(VnetConnectionProvisioningState.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VnetConnections.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VnetConnections.java new file mode 100644 index 000000000000..7330796796ef --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VnetConnections.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 VnetConnections. + */ +public interface VnetConnections { + /** + * Get the properties of a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @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 properties of a VnetConnection along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String sandboxGroupName, + String vnetConnectionName, Context context); + + /** + * Get the properties of a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @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 properties of a VnetConnection. + */ + VnetConnection get(String resourceGroupName, String sandboxGroupName, String vnetConnectionName); + + /** + * Delete a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @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 sandboxGroupName, String vnetConnectionName); + + /** + * Delete a VnetConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @param vnetConnectionName The name of the VnetConnection. + * @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 sandboxGroupName, String vnetConnectionName, Context context); + + /** + * List all VnetConnections in the specified SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @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 VnetConnection list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listBySandboxGroup(String resourceGroupName, String sandboxGroupName); + + /** + * List all VnetConnections in the specified SandboxGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sandboxGroupName The name of the SandboxGroup. + * @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 VnetConnection list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listBySandboxGroup(String resourceGroupName, String sandboxGroupName, + Context context); + + /** + * Get the properties of a VnetConnection. + * + * @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 the properties of a VnetConnection along with {@link Response}. + */ + VnetConnection getById(String id); + + /** + * Get the properties of a VnetConnection. + * + * @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 the properties of a VnetConnection along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a VnetConnection. + * + * @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 VnetConnection. + * + * @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 VnetConnection resource. + * + * @param name resource name. + * @return the first stage of the new VnetConnection definition. + */ + VnetConnection.DefinitionStages.Blank define(String name); +} 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 ca6bb42b124f..8f51f2e7ebc7 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -153,17 +153,6 @@ public Volume withMountOptions(String mountOptions) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (secrets() != null) { - secrets().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VolumeMount.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VolumeMount.java index a4e01a6e7506..f7adf73f988d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VolumeMount.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VolumeMount.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -99,14 +99,6 @@ public VolumeMount withSubPath(String subPath) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WeekDay.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WeekDay.java index a67b20df80e5..b97fb345b14a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WeekDay.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WeekDay.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -9,37 +9,37 @@ */ public enum WeekDay { /** - * Enum value Monday. + * Monday. */ MONDAY("Monday"), /** - * Enum value Tuesday. + * Tuesday. */ TUESDAY("Tuesday"), /** - * Enum value Wednesday. + * Wednesday. */ WEDNESDAY("Wednesday"), /** - * Enum value Thursday. + * Thursday. */ THURSDAY("Thursday"), /** - * Enum value Friday. + * Friday. */ FRIDAY("Friday"), /** - * Enum value Saturday. + * Saturday. */ SATURDAY("Saturday"), /** - * Enum value Sunday. + * Sunday. */ SUNDAY("Sunday"); 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 index 2a513074a564..b66d323d410b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -33,18 +33,18 @@ public interface WorkflowEnvelope { String type(); /** - * Gets the kind property: Gets the logic app hybrid workflow kind. + * Gets the properties property: Additional workflow properties. * - * @return the kind value. + * @return the properties value. */ - WorkflowKind kind(); + WorkflowEnvelopeProperties properties(); /** - * Gets the properties property: Additional workflow properties. + * Gets the kind property: Gets the logic app hybrid workflow kind. * - * @return the properties value. + * @return the kind value. */ - WorkflowEnvelopeProperties properties(); + WorkflowKind kind(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. 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 index ba7f7a9246ef..190abcc44437 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Additional workflow properties. */ -@Fluent +@Immutable public final class WorkflowEnvelopeProperties implements JsonSerializable { /* * Gets or sets the files. @@ -34,7 +34,7 @@ public final class WorkflowEnvelopeProperties implements JsonSerializable { /* * Gets or sets the workflow health state. @@ -30,7 +29,7 @@ public final class WorkflowHealth implements JsonSerializable { /** * Creates an instance of WorkflowHealth class. */ - public WorkflowHealth() { + private WorkflowHealth() { } /** @@ -42,17 +41,6 @@ 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. * @@ -62,34 +50,6 @@ 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} */ 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 index ef6bef9d0752..c64958251d34 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -9,22 +9,22 @@ */ public enum WorkflowHealthState { /** - * Enum value NotSpecified. + * NotSpecified. */ NOT_SPECIFIED("NotSpecified"), /** - * Enum value Healthy. + * Healthy. */ HEALTHY("Healthy"), /** - * Enum value Unhealthy. + * Unhealthy. */ UNHEALTHY("Unhealthy"), /** - * Enum value Unknown. + * Unknown. */ UNKNOWN("Unknown"); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowKind.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowKind.java index a89ab4d0467a..be53f7456edb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowKind.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkflowKind.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,17 +12,17 @@ */ public final class WorkflowKind extends ExpandableStringEnum { /** - * Static value Stateful for WorkflowKind. + * Stateful. */ public static final WorkflowKind STATEFUL = fromString("Stateful"); /** - * Static value Stateless for WorkflowKind. + * Stateless. */ public static final WorkflowKind STATELESS = fromString("Stateless"); /** - * Static value Agentic for WorkflowKind. + * Agentic. */ public static final WorkflowKind AGENTIC = fromString("Agentic"); 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 index 9a6ebb3f9680..9ec01ba890c4 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; @@ -12,32 +12,32 @@ */ public final class WorkflowState extends ExpandableStringEnum { /** - * Static value NotSpecified for WorkflowState. + * NotSpecified. */ public static final WorkflowState NOT_SPECIFIED = fromString("NotSpecified"); /** - * Static value Completed for WorkflowState. + * Completed. */ public static final WorkflowState COMPLETED = fromString("Completed"); /** - * Static value Enabled for WorkflowState. + * Enabled. */ public static final WorkflowState ENABLED = fromString("Enabled"); /** - * Static value Disabled for WorkflowState. + * Disabled. */ public static final WorkflowState DISABLED = fromString("Disabled"); /** - * Static value Deleted for WorkflowState. + * Deleted. */ public static final WorkflowState DELETED = fromString("Deleted"); /** - * Static value Suspended for WorkflowState. + * Suspended. */ public static final WorkflowState SUSPENDED = fromString("Suspended"); 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 78d195bd398b..3360382c94f3 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; @@ -123,25 +122,6 @@ public WorkloadProfile withMaximumCount(Integer maximumCount) { 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 WorkloadProfile")); - } - if (workloadProfileType() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property workloadProfileType in model WorkloadProfile")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(WorkloadProfile.class); - /** * {@inheritDoc} */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkloadProfileStates.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkloadProfileStates.java index 68703405f012..9c448f0cefd0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkloadProfileStates.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkloadProfileStates.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkloadProfileStatesProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkloadProfileStatesProperties.java index c21d804ed74e..f25211a49761 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkloadProfileStatesProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkloadProfileStatesProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Workload Profile resource specific properties. */ -@Fluent +@Immutable public final class WorkloadProfileStatesProperties implements JsonSerializable { /* * Minimum count of instances. @@ -34,7 +34,7 @@ public final class WorkloadProfileStatesProperties implements JsonSerializable 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/UsagesListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/UsagesListSamples.java index 563da345853c..53553f894925 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -9,8 +9,7 @@ */ public final class UsagesListSamples { /* - * x-ms-original-file: - * specification/app/resource-manager/Microsoft.App/ContainerApps/stable/2025-07-01/examples/Usages_List.json + * x-ms-original-file: 2026-07-01/Usages_List.json */ /** * Sample code: List usages. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..189746ef6faa --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionsCreateOrUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.VnetConnectionProperties; + +/** + * Samples for VnetConnections CreateOrUpdate. + */ +public final class VnetConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-07-01/VnetConnections_CreateOrUpdate.json + */ + /** + * Sample code: Create or update a VnetConnection. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + createOrUpdateAVnetConnection(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.vnetConnections() + .define("myVnetConnection") + .withExistingSandboxGroup("myRg", "testgroup") + .withProperties(new VnetConnectionProperties().withSubnetId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet")) + .create(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionsDeleteSamples.java new file mode 100644 index 000000000000..8321c0a7a4ac --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for VnetConnections Delete. + */ +public final class VnetConnectionsDeleteSamples { + /* + * x-ms-original-file: 2026-07-01/VnetConnections_Delete.json + */ + /** + * Sample code: Delete a VnetConnection. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteAVnetConnection(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.vnetConnections().delete("myRg", "testgroup", "myVnetConnection", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionsGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionsGetSamples.java new file mode 100644 index 000000000000..402ca592fc88 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for VnetConnections Get. + */ +public final class VnetConnectionsGetSamples { + /* + * x-ms-original-file: 2026-07-01/VnetConnections_Get.json + */ + /** + * Sample code: Get a VnetConnection. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getAVnetConnection(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.vnetConnections() + .getWithResponse("myRg", "testgroup", "myVnetConnection", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionsListBySandboxGroupSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionsListBySandboxGroupSamples.java new file mode 100644 index 000000000000..f42963ab9d4c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionsListBySandboxGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** + * Samples for VnetConnections ListBySandboxGroup. + */ +public final class VnetConnectionsListBySandboxGroupSamples { + /* + * x-ms-original-file: 2026-07-01/VnetConnections_ListBySandboxGroup.json + */ + /** + * Sample code: List VnetConnections by SandboxGroup. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void + listVnetConnectionsBySandboxGroup(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.vnetConnections().listBySandboxGroup("myRg", "testgroup", com.azure.core.util.Context.NONE); + } +} 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 index 7ffd9a706ccb..7196f48afca1 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,17 +12,16 @@ 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)); + AllowedAudiencesValidation model = BinaryData.fromString("{\"allowedAudiences\":[\"phojeevyhy\",\"sgzfczbg\"]}") + .toObject(AllowedAudiencesValidation.class); + Assertions.assertEquals("phojeevyhy", 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")); + AllowedAudiencesValidation model + = new AllowedAudiencesValidation().withAllowedAudiences(Arrays.asList("phojeevyhy", "sgzfczbg")); model = BinaryData.fromObject(model).toObject(AllowedAudiencesValidation.class); - Assertions.assertEquals("zqqedq", model.allowedAudiences().get(0)); + Assertions.assertEquals("phojeevyhy", 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 index 6ee3a901abf2..445e70494c3e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,20 +12,20 @@ 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\"]}") + AllowedPrincipals model = BinaryData + .fromString( + "{\"groups\":[\"cxkjibnxmysuxswq\"],\"identities\":[\"vl\",\"ijpstte\",\"oqq\",\"wcyyufmhruncu\"]}") .toObject(AllowedPrincipals.class); - Assertions.assertEquals("cqvkocrcjdkwtn", model.groups().get(0)); - Assertions.assertEquals("nqpjwnzlljfmpp", model.identities().get(0)); + Assertions.assertEquals("cxkjibnxmysuxswq", model.groups().get(0)); + Assertions.assertEquals("vl", 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")); + AllowedPrincipals model = new AllowedPrincipals().withGroups(Arrays.asList("cxkjibnxmysuxswq")) + .withIdentities(Arrays.asList("vl", "ijpstte", "oqq", "wcyyufmhruncu")); model = BinaryData.fromObject(model).toObject(AllowedPrincipals.class); - Assertions.assertEquals("cqvkocrcjdkwtn", model.groups().get(0)); - Assertions.assertEquals("nqpjwnzlljfmpp", model.identities().get(0)); + Assertions.assertEquals("cxkjibnxmysuxswq", model.groups().get(0)); + Assertions.assertEquals("vl", model.identities().get(0)); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AppInsightsConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AppInsightsConfigurationTests.java new file mode 100644 index 000000000000..5549f5615403 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AppInsightsConfigurationTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.AppInsightsConfiguration; +import org.junit.jupiter.api.Assertions; + +public final class AppInsightsConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AppInsightsConfiguration model + = BinaryData.fromString("{\"connectionString\":\"e\"}").toObject(AppInsightsConfiguration.class); + Assertions.assertEquals("e", model.connectionString()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AppInsightsConfiguration model = new AppInsightsConfiguration().withConnectionString("e"); + model = BinaryData.fromObject(model).toObject(AppInsightsConfiguration.class); + Assertions.assertEquals("e", model.connectionString()); + } +} 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 index 600e8f91e553..f25c3bb7477a 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,17 +11,17 @@ 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); + AuthPlatform model = BinaryData.fromString("{\"enabled\":true,\"runtimeVersion\":\"kjpdnjzhajo\"}") + .toObject(AuthPlatform.class); Assertions.assertTrue(model.enabled()); - Assertions.assertEquals("bpzvgn", model.runtimeVersion()); + Assertions.assertEquals("kjpdnjzhajo", model.runtimeVersion()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AuthPlatform model = new AuthPlatform().withEnabled(true).withRuntimeVersion("bpzvgn"); + AuthPlatform model = new AuthPlatform().withEnabled(true).withRuntimeVersion("kjpdnjzhajo"); model = BinaryData.fromObject(model).toObject(AuthPlatform.class); Assertions.assertTrue(model.enabled()); - Assertions.assertEquals("bpzvgn", model.runtimeVersion()); + Assertions.assertEquals("kjpdnjzhajo", model.runtimeVersion()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableEnvironmentModeInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableEnvironmentModeInnerTests.java new file mode 100644 index 000000000000..ef376708e087 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableEnvironmentModeInnerTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.fluent.models.AvailableEnvironmentModeInner; +import org.junit.jupiter.api.Assertions; + +public final class AvailableEnvironmentModeInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AvailableEnvironmentModeInner model = BinaryData.fromString( + "{\"location\":\"ch\",\"properties\":{\"displayName\":\"nkf\",\"description\":\"lv\"},\"id\":\"oakizvoai\",\"name\":\"naqln\",\"type\":\"wiguyxlyk\"}") + .toObject(AvailableEnvironmentModeInner.class); + Assertions.assertEquals("ch", model.location()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableEnvironmentModePropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableEnvironmentModePropertiesTests.java new file mode 100644 index 000000000000..c7cab3e8db2f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableEnvironmentModePropertiesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.AvailableEnvironmentModeProperties; + +public final class AvailableEnvironmentModePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AvailableEnvironmentModeProperties model + = BinaryData.fromString("{\"displayName\":\"hvxzcwxhmp\",\"description\":\"tl\"}") + .toObject(AvailableEnvironmentModeProperties.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableEnvironmentModesCollectionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableEnvironmentModesCollectionTests.java new file mode 100644 index 000000000000..a5a2d9d9d5da --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableEnvironmentModesCollectionTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.implementation.models.AvailableEnvironmentModesCollection; +import org.junit.jupiter.api.Assertions; + +public final class AvailableEnvironmentModesCollectionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AvailableEnvironmentModesCollection model = BinaryData.fromString( + "{\"value\":[{\"location\":\"bztensvkzykjtj\",\"properties\":{\"displayName\":\"xfwush\",\"description\":\"pkupnq\"},\"id\":\"gjfbpkuwxeoi\",\"name\":\"jfizfavkjzwfbc\",\"type\":\"aykmmf\"},{\"location\":\"bfw\",\"properties\":{\"displayName\":\"xmdewsrsxkrplbj\",\"description\":\"ejwwviyoyps\"},\"id\":\"brnnhjxsqw\",\"name\":\"hqkb\",\"type\":\"wetp\"},{\"location\":\"ycyqiqyhgfsetzl\",\"properties\":{\"displayName\":\"sfledyn\",\"description\":\"pziuwfbzkkdtnh\"},\"id\":\"ycljselpkpbaf\",\"name\":\"afhlbyl\",\"type\":\"cbevxrhyzdfw\"},{\"location\":\"ofpltdbm\",\"properties\":{\"displayName\":\"rhvhfnracwnpqigt\",\"description\":\"jwouhda\"},\"id\":\"igrb\",\"name\":\"bxsjybvitvqkj\",\"type\":\"az\"}],\"nextLink\":\"mtggmu\"}") + .toObject(AvailableEnvironmentModesCollection.class); + Assertions.assertEquals("bztensvkzykjtj", model.value().get(0).location()); + Assertions.assertEquals("mtggmu", model.nextLink()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableEnvironmentModesListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableEnvironmentModesListMockTests.java new file mode 100644 index 000000000000..43554b94f19d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableEnvironmentModesListMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.AvailableEnvironmentMode; +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 AvailableEnvironmentModesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"location\":\"klajvcfocz\",\"properties\":{\"displayName\":\"ejov\",\"description\":\"wxn\"},\"id\":\"hhnoyrzaaoee\",\"name\":\"pmjen\",\"type\":\"jeatea\"}]}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.availableEnvironmentModes().list("ekfsrm", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("klajvcfocz", response.iterator().next().location()); + } +} 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 index 26f1614b564c..6df9b7207858 100644 --- 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 @@ -1,50 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.appcontainers.implementation.models.AvailableOperations; 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\":\"msjnygqdnfw\",\"isDataAction\":false,\"display\":{\"provider\":\"tilaxh\",\"resource\":\"hqlyvijo\",\"operation\":\"iv\",\"description\":\"oyzunbixxr\"},\"origin\":\"kvcpwpgclr\"}],\"nextLink\":\"vtsoxf\"}") + "{\"value\":[{\"name\":\"lnrosfqp\",\"isDataAction\":true,\"display\":{\"provider\":\"zvypyqrimzinp\",\"resource\":\"wjdk\",\"operation\":\"soodqxhcrmnoh\",\"description\":\"ckwhds\"},\"origin\":\"fiyipjxsqwpgrj\"},{\"name\":\"norcjxvsnbyxqab\",\"isDataAction\":false,\"display\":{\"provider\":\"cyshurzafbljjgp\",\"resource\":\"oq\",\"operation\":\"mkljavb\",\"description\":\"dtqajzyulpkudj\"},\"origin\":\"lkhbz\"},{\"name\":\"epgzgqexz\",\"isDataAction\":false,\"display\":{\"provider\":\"c\",\"resource\":\"ierhhbcsglummaj\",\"operation\":\"aodxo\",\"description\":\"bdxkqpxokaj\"},\"origin\":\"npime\"}],\"nextLink\":\"stxgc\"}") .toObject(AvailableOperations.class); - Assertions.assertEquals("msjnygqdnfw", model.value().get(0).name()); - Assertions.assertFalse(model.value().get(0).isDataAction()); - Assertions.assertEquals("tilaxh", model.value().get(0).display().provider()); - Assertions.assertEquals("hqlyvijo", model.value().get(0).display().resource()); - Assertions.assertEquals("iv", model.value().get(0).display().operation()); - Assertions.assertEquals("oyzunbixxr", model.value().get(0).display().description()); - Assertions.assertEquals("kvcpwpgclr", model.value().get(0).origin()); - Assertions.assertEquals("vtsoxf", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailableOperations model - = new AvailableOperations().withValue(Arrays.asList(new OperationDetailInner().withName("msjnygqdnfw") - .withIsDataAction(false) - .withDisplay(new OperationDisplay().withProvider("tilaxh") - .withResource("hqlyvijo") - .withOperation("iv") - .withDescription("oyzunbixxr")) - .withOrigin("kvcpwpgclr"))).withNextLink("vtsoxf"); - model = BinaryData.fromObject(model).toObject(AvailableOperations.class); - Assertions.assertEquals("msjnygqdnfw", model.value().get(0).name()); - Assertions.assertFalse(model.value().get(0).isDataAction()); - Assertions.assertEquals("tilaxh", model.value().get(0).display().provider()); - Assertions.assertEquals("hqlyvijo", model.value().get(0).display().resource()); - Assertions.assertEquals("iv", model.value().get(0).display().operation()); - Assertions.assertEquals("oyzunbixxr", model.value().get(0).display().description()); - Assertions.assertEquals("kvcpwpgclr", model.value().get(0).origin()); - Assertions.assertEquals("vtsoxf", model.nextLink()); + Assertions.assertEquals("lnrosfqp", model.value().get(0).name()); + Assertions.assertTrue(model.value().get(0).isDataAction()); + Assertions.assertEquals("zvypyqrimzinp", model.value().get(0).display().provider()); + Assertions.assertEquals("wjdk", model.value().get(0).display().resource()); + Assertions.assertEquals("soodqxhcrmnoh", model.value().get(0).display().operation()); + Assertions.assertEquals("ckwhds", model.value().get(0).display().description()); + Assertions.assertEquals("fiyipjxsqwpgrj", model.value().get(0).origin()); + Assertions.assertEquals("stxgc", 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 index c2139c0d8a04..662c87fdde2c 100644 --- 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 @@ -1,46 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"}") + "{\"location\":\"vjsaqwotm\",\"properties\":{\"category\":\"lcol\",\"applicability\":\"LocationDefault\",\"cores\":1031241635,\"memoryGiB\":1257989778,\"gpus\":212381893,\"displayName\":\"excgjokjljnhvl\"},\"id\":\"bekpeeksnbksdqhj\",\"name\":\"yklxe\",\"type\":\"lkhhu\"}") .toObject(AvailableWorkloadProfileInner.class); - Assertions.assertEquals("aoqvuh", model.location()); - Assertions.assertEquals("f", model.properties().category()); + Assertions.assertEquals("vjsaqwotm", model.location()); + Assertions.assertEquals("lcol", 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()); + Assertions.assertEquals(1031241635, model.properties().cores()); + Assertions.assertEquals(1257989778, model.properties().memoryGiB()); + Assertions.assertEquals(212381893, model.properties().gpus()); + Assertions.assertEquals("excgjokjljnhvl", 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 index 68c35f030b8b..4ba21c0fc885 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -13,30 +13,13 @@ 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\"}") + "{\"category\":\"cpoq\",\"applicability\":\"LocationDefault\",\"cores\":1853837051,\"memoryGiB\":988988397,\"gpus\":136366405,\"displayName\":\"knlejjjkxybwfd\"}") .toObject(AvailableWorkloadProfileProperties.class); - Assertions.assertEquals("hm", model.category()); + Assertions.assertEquals("cpoq", 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()); + Assertions.assertEquals(1853837051, model.cores()); + Assertions.assertEquals(988988397, model.memoryGiB()); + Assertions.assertEquals(136366405, model.gpus()); + Assertions.assertEquals("knlejjjkxybwfd", 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 index 5797523a5cf6..d42f482c51fc 100644 --- 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 @@ -1,63 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.implementation.models.AvailableWorkloadProfilesCollection; 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\"}") + "{\"value\":[{\"location\":\"vvruxwi\",\"properties\":{\"category\":\"ei\",\"applicability\":\"LocationDefault\",\"cores\":1701791608,\"memoryGiB\":819971614,\"gpus\":217572668,\"displayName\":\"gdgkki\"},\"id\":\"plkcsm\",\"name\":\"nhwtbbaedorvv\",\"type\":\"qfloygbdgwum\"}],\"nextLink\":\"dgdhpabgdexj\"}") .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()); + Assertions.assertEquals("vvruxwi", model.value().get(0).location()); + Assertions.assertEquals("ei", model.value().get(0).properties().category()); + Assertions.assertEquals(Applicability.LOCATION_DEFAULT, model.value().get(0).properties().applicability()); + Assertions.assertEquals(1701791608, model.value().get(0).properties().cores()); + Assertions.assertEquals(819971614, model.value().get(0).properties().memoryGiB()); + Assertions.assertEquals(217572668, model.value().get(0).properties().gpus()); + Assertions.assertEquals("gdgkki", model.value().get(0).properties().displayName()); + Assertions.assertEquals("dgdhpabgdexj", model.nextLink()); } } 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 index 386507ddae5a..2810f86b847e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -23,7 +23,7 @@ public final class AvailableWorkloadProfilesGetMockTests { @Test public void testGet() throws Exception { String responseStr - = "{\"value\":[{\"location\":\"aoyankcoeqswa\",\"properties\":{\"category\":\"t\",\"applicability\":\"Custom\",\"cores\":1561277343,\"memoryGiB\":986610623,\"gpus\":1515443122,\"displayName\":\"hdrlktg\"},\"id\":\"sggux\",\"name\":\"eml\",\"type\":\"ywaeeczgf\"}]}"; + = "{\"value\":[{\"location\":\"glhpse\",\"properties\":{\"category\":\"gamqiydvxcgdhy\",\"applicability\":\"LocationDefault\",\"cores\":519952400,\"memoryGiB\":1077522484,\"gpus\":144654844,\"displayName\":\"xyjrcbqpb\"},\"id\":\"pglqjo\",\"name\":\"tdahneaoovtyjzti\",\"type\":\"fwjlof\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,14 +33,15 @@ public void testGet() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.availableWorkloadProfiles().get("hn", com.azure.core.util.Context.NONE); + = manager.availableWorkloadProfiles().get("wglgwzpvx", com.azure.core.util.Context.NONE); - Assertions.assertEquals("aoyankcoeqswa", response.iterator().next().location()); - Assertions.assertEquals("t", response.iterator().next().properties().category()); - Assertions.assertEquals(Applicability.CUSTOM, response.iterator().next().properties().applicability()); - Assertions.assertEquals(1561277343, response.iterator().next().properties().cores()); - Assertions.assertEquals(986610623, response.iterator().next().properties().memoryGiB()); - Assertions.assertEquals(1515443122, response.iterator().next().properties().gpus()); - Assertions.assertEquals("hdrlktg", response.iterator().next().properties().displayName()); + Assertions.assertEquals("glhpse", response.iterator().next().location()); + Assertions.assertEquals("gamqiydvxcgdhy", response.iterator().next().properties().category()); + Assertions.assertEquals(Applicability.LOCATION_DEFAULT, + response.iterator().next().properties().applicability()); + Assertions.assertEquals(519952400, response.iterator().next().properties().cores()); + Assertions.assertEquals(1077522484, response.iterator().next().properties().memoryGiB()); + Assertions.assertEquals(144654844, response.iterator().next().properties().gpus()); + Assertions.assertEquals("xyjrcbqpb", 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 index 54a5854eae89..1e430f5c3ea0 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,20 +12,21 @@ 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}") + AzureActiveDirectoryLogin model = BinaryData + .fromString( + "{\"loginParameters\":[\"mudqmeq\",\"igpibud\",\"wyxebeybpmzz\"],\"disableWWWAuthenticate\":false}") .toObject(AzureActiveDirectoryLogin.class); - Assertions.assertEquals("yejhk", model.loginParameters().get(0)); - Assertions.assertTrue(model.disableWwwAuthenticate()); + Assertions.assertEquals("mudqmeq", model.loginParameters().get(0)); + Assertions.assertFalse(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); + AzureActiveDirectoryLogin model + = new AzureActiveDirectoryLogin().withLoginParameters(Arrays.asList("mudqmeq", "igpibud", "wyxebeybpmzz")) + .withDisableWwwAuthenticate(false); model = BinaryData.fromObject(model).toObject(AzureActiveDirectoryLogin.class); - Assertions.assertEquals("yejhk", model.loginParameters().get(0)); - Assertions.assertTrue(model.disableWwwAuthenticate()); + Assertions.assertEquals("mudqmeq", model.loginParameters().get(0)); + Assertions.assertFalse(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 index d4c22d34bb45..4468c273b7fa 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,15 +11,15 @@ 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()); + AzureStaticWebAppsRegistration model + = BinaryData.fromString("{\"clientId\":\"eyl\"}").toObject(AzureStaticWebAppsRegistration.class); + Assertions.assertEquals("eyl", model.clientId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AzureStaticWebAppsRegistration model = new AzureStaticWebAppsRegistration().withClientId("gzjaoyfhrtxilne"); + AzureStaticWebAppsRegistration model = new AzureStaticWebAppsRegistration().withClientId("eyl"); model = BinaryData.fromObject(model).toObject(AzureStaticWebAppsRegistration.class); - Assertions.assertEquals("gzjaoyfhrtxilne", model.clientId()); + Assertions.assertEquals("eyl", 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 index 87d1fc1d0464..d4b5aec28fbb 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -13,18 +13,18 @@ public final class AzureStaticWebAppsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AzureStaticWebApps model - = BinaryData.fromString("{\"enabled\":false,\"registration\":{\"clientId\":\"gbquxigj\"}}") + = BinaryData.fromString("{\"enabled\":false,\"registration\":{\"clientId\":\"afgaoqlt\"}}") .toObject(AzureStaticWebApps.class); Assertions.assertFalse(model.enabled()); - Assertions.assertEquals("gbquxigj", model.registration().clientId()); + Assertions.assertEquals("afgaoqlt", model.registration().clientId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { AzureStaticWebApps model = new AzureStaticWebApps().withEnabled(false) - .withRegistration(new AzureStaticWebAppsRegistration().withClientId("gbquxigj")); + .withRegistration(new AzureStaticWebAppsRegistration().withClientId("afgaoqlt")); model = BinaryData.fromObject(model).toObject(AzureStaticWebApps.class); Assertions.assertFalse(model.enabled()); - Assertions.assertEquals("gbquxigj", model.registration().clientId()); + Assertions.assertEquals("afgaoqlt", 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 index c844e41491e1..e2689f79980c 100644 --- 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 @@ -1,46 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"}]}") + "{\"value\":[{\"location\":\"aonwivkcqhrxh\",\"properties\":{\"category\":\"lccrmmkyupi\",\"meterType\":\"byqjfkakfqfrkem\",\"displayName\":\"ldudxjascowv\"},\"id\":\"jkpdxphlkksnm\",\"name\":\"zvyfijdkzuqnwsi\",\"type\":\"huqol\"},{\"location\":\"hluqwquls\",\"properties\":{\"category\":\"jb\",\"meterType\":\"ykfhyqezvqqugdrf\",\"displayName\":\"cvexreuqu\"},\"id\":\"tljvfwhreagkhyx\",\"name\":\"rqtvbczsulmdgglm\",\"type\":\"pjpfseykgs\"},{\"location\":\"gpszngafpg\",\"properties\":{\"category\":\"vecjujcn\",\"meterType\":\"adyedmzrgjfok\",\"displayName\":\"bnoit\"},\"id\":\"pz\",\"name\":\"rgdg\",\"type\":\"vcoqraswugyxpqi\"}]}") .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()); + Assertions.assertEquals("aonwivkcqhrxh", model.value().get(0).location()); + Assertions.assertEquals("lccrmmkyupi", model.value().get(0).properties().category()); + Assertions.assertEquals("byqjfkakfqfrkem", model.value().get(0).properties().meterType()); + Assertions.assertEquals("ldudxjascowv", 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 index d6db5d248904..7a3e7176208f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -13,21 +13,10 @@ public final class BillingMeterPropertiesTests { public void testDeserialize() throws Exception { BillingMeterProperties model = BinaryData .fromString( - "{\"category\":\"dslfhotwmcy\",\"meterType\":\"wlbjnpgacftade\",\"displayName\":\"nltyfsoppusuesnz\"}") + "{\"category\":\"jfel\",\"meterType\":\"rpptcbgqnzmnhiil\",\"displayName\":\"lwcjgckbbcccgzpr\"}") .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()); + Assertions.assertEquals("jfel", model.category()); + Assertions.assertEquals("rpptcbgqnzmnhiil", model.meterType()); + Assertions.assertEquals("lwcjgckbbcccgzpr", 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 index 9792f4c8f9b4..d92c615f4da8 100644 --- 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 @@ -1,36 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"}") + "{\"location\":\"eialwvskb\",\"properties\":{\"category\":\"acaqtyltcoqcu\",\"meterType\":\"dsxzakuejkmvb\",\"displayName\":\"tjo\"},\"id\":\"cvovjufyc\",\"name\":\"jmlbemyejiriux\",\"type\":\"gthortudaw\"}") .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()); + Assertions.assertEquals("eialwvskb", model.location()); + Assertions.assertEquals("acaqtyltcoqcu", model.properties().category()); + Assertions.assertEquals("dsxzakuejkmvb", model.properties().meterType()); + Assertions.assertEquals("tjo", 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 index fd7284ce3167..85177d6815c0 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -21,7 +21,7 @@ public final class BillingMetersGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"value\":[{\"location\":\"ycsxzu\",\"properties\":{\"category\":\"rlsmdesqplpvmjc\",\"meterType\":\"ewbidyvteowxv\",\"displayName\":\"iudeu\"},\"id\":\"sxze\",\"name\":\"paxwkufyk\",\"type\":\"vuhx\"},{\"location\":\"mrutznabaobnsluj\",\"properties\":{\"category\":\"tymkmvguihywart\",\"meterType\":\"phkixkykxdssjpe\",\"displayName\":\"ucfx\"},\"id\":\"kkflrmymyincqlhr\",\"name\":\"s\",\"type\":\"sl\"},{\"location\":\"iiovgqcgxu\",\"properties\":{\"category\":\"kctotiowlxteq\",\"meterType\":\"tjgwdtguk\",\"displayName\":\"nblwphqlkcc\"},\"id\":\"gygqwah\",\"name\":\"iul\",\"type\":\"gniiprglvaw\"}]}"; + = "{\"value\":[{\"location\":\"xdjxldn\",\"properties\":{\"category\":\"yi\",\"meterType\":\"kd\",\"displayName\":\"rndwdbvxvzaled\"},\"id\":\"qxlun\",\"name\":\"fthmcxqqxmy\",\"type\":\"klaoa\"},{\"location\":\"ohrvmz\",\"properties\":{\"category\":\"azad\",\"meterType\":\"znllaslk\",\"displayName\":\"hjqjpv\"},\"id\":\"ihxjtgzgtai\",\"name\":\"wbqgroigbsfsgsa\",\"type\":\"nwldfmhljq\"},{\"location\":\"spmrjct\",\"properties\":{\"category\":\"dsxebuhsxrz\",\"meterType\":\"gsdaluyckh\",\"displayName\":\"rbhseuerbgpxebjl\"},\"id\":\"caytujraxdtpryj\",\"name\":\"gtnse\",\"type\":\"ouxly\"},{\"location\":\"vvyljurkepose\",\"properties\":{\"category\":\"ylmpctwjwdsd\",\"meterType\":\"mkxerxxxoteeh\",\"displayName\":\"owgomvvhxowp\"},\"id\":\"apnpxraqawbmp\",\"name\":\"p\",\"type\":\"eylqlocvvujexayg\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,11 +31,11 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); BillingMeterCollection response - = manager.billingMeters().getWithResponse("ukklelss", com.azure.core.util.Context.NONE).getValue(); + = manager.billingMeters().getWithResponse("xc", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("ycsxzu", response.value().get(0).location()); - Assertions.assertEquals("rlsmdesqplpvmjc", response.value().get(0).properties().category()); - Assertions.assertEquals("ewbidyvteowxv", response.value().get(0).properties().meterType()); - Assertions.assertEquals("iudeu", response.value().get(0).properties().displayName()); + Assertions.assertEquals("xdjxldn", response.value().get(0).location()); + Assertions.assertEquals("yi", response.value().get(0).properties().category()); + Assertions.assertEquals("kd", response.value().get(0).properties().meterType()); + Assertions.assertEquals("rndwdbvxvzaled", 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 index 671289aaaeaa..bf75be9bdbcb 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,15 +11,25 @@ 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()); + BlobStorageTokenStore model = BinaryData.fromString( + "{\"sasUrlSettingName\":\"opv\",\"blobContainerUri\":\"dbzqgqqihed\",\"clientId\":\"qwthmky\",\"managedIdentityResourceId\":\"cysihs\"}") + .toObject(BlobStorageTokenStore.class); + Assertions.assertEquals("opv", model.sasUrlSettingName()); + Assertions.assertEquals("dbzqgqqihed", model.blobContainerUri()); + Assertions.assertEquals("qwthmky", model.clientId()); + Assertions.assertEquals("cysihs", model.managedIdentityResourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - BlobStorageTokenStore model = new BlobStorageTokenStore().withSasUrlSettingName("mijcmmxdcufufs"); + BlobStorageTokenStore model = new BlobStorageTokenStore().withSasUrlSettingName("opv") + .withBlobContainerUri("dbzqgqqihed") + .withClientId("qwthmky") + .withManagedIdentityResourceId("cysihs"); model = BinaryData.fromObject(model).toObject(BlobStorageTokenStore.class); - Assertions.assertEquals("mijcmmxdcufufs", model.sasUrlSettingName()); + Assertions.assertEquals("opv", model.sasUrlSettingName()); + Assertions.assertEquals("dbzqgqqihed", model.blobContainerUri()); + Assertions.assertEquals("qwthmky", model.clientId()); + Assertions.assertEquals("cysihs", model.managedIdentityResourceId()); } } 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 index 3d3ff54f2b88..3e0e06b71f20 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -13,18 +13,16 @@ public final class CertificatePatchTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CertificatePatch model = BinaryData.fromString( - "{\"tags\":{\"agalpbuxwgipwhon\":\"eamdp\",\"kix\":\"wkgshwa\",\"eputtmrywnuzoqf\":\"bin\",\"qvyxlwhzlsicoho\":\"iyqzrnk\"}}") - .toObject(CertificatePatch.class); - Assertions.assertEquals("eamdp", model.tags().get("agalpbuxwgipwhon")); + CertificatePatch model + = BinaryData.fromString("{\"tags\":{\"qihebw\":\"kdi\"}}").toObject(CertificatePatch.class); + Assertions.assertEquals("kdi", model.tags().get("qihebw")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CertificatePatch model = new CertificatePatch().withTags(mapOf("agalpbuxwgipwhon", "eamdp", "kix", "wkgshwa", - "eputtmrywnuzoqf", "bin", "qvyxlwhzlsicoho", "iyqzrnk")); + CertificatePatch model = new CertificatePatch().withTags(mapOf("qihebw", "kdi")); model = BinaryData.fromObject(model).toObject(CertificatePatch.class); - Assertions.assertEquals("eamdp", model.tags().get("agalpbuxwgipwhon")); + Assertions.assertEquals("kdi", model.tags().get("qihebw")); } // Use "Map.of" if available 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 index 376ea0f1b6b6..99366bd99b9f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -27,8 +27,7 @@ public void testDeleteWithResponse() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.certificates() - .deleteWithResponse("whlpuzjpceezn", "angp", "bfaxyxzlbc", com.azure.core.util.Context.NONE); + manager.certificates().deleteWithResponse("k", "xjxjoe", "lqxr", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CheckMigrationEligibilityRequestTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CheckMigrationEligibilityRequestTests.java new file mode 100644 index 000000000000..97e7698315c3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CheckMigrationEligibilityRequestTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.CheckMigrationEligibilityRequest; +import org.junit.jupiter.api.Assertions; + +public final class CheckMigrationEligibilityRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CheckMigrationEligibilityRequest model + = BinaryData.fromString("{\"targetMode\":\"bglbyvict\"}").toObject(CheckMigrationEligibilityRequest.class); + Assertions.assertEquals("bglbyvict", model.targetMode()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CheckMigrationEligibilityRequest model = new CheckMigrationEligibilityRequest().withTargetMode("bglbyvict"); + model = BinaryData.fromObject(model).toObject(CheckMigrationEligibilityRequest.class); + Assertions.assertEquals("bglbyvict", model.targetMode()); + } +} 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 index b54cfb4dbe5e..c7aec1a8c9a7 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,18 +11,19 @@ public final class CheckNameAvailabilityRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CheckNameAvailabilityRequest model = BinaryData.fromString("{\"name\":\"burvjxxjnspy\",\"type\":\"tko\"}") - .toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("burvjxxjnspy", model.name()); - Assertions.assertEquals("tko", model.type()); + CheckNameAvailabilityRequest model + = BinaryData.fromString("{\"name\":\"jhlnymzotqyryu\",\"type\":\"bmqqvxmvw\"}") + .toObject(CheckNameAvailabilityRequest.class); + Assertions.assertEquals("jhlnymzotqyryu", model.name()); + Assertions.assertEquals("bmqqvxmvw", model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { CheckNameAvailabilityRequest model - = new CheckNameAvailabilityRequest().withName("burvjxxjnspy").withType("tko"); + = new CheckNameAvailabilityRequest().withName("jhlnymzotqyryu").withType("bmqqvxmvw"); model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("burvjxxjnspy", model.name()); - Assertions.assertEquals("tko", model.type()); + Assertions.assertEquals("jhlnymzotqyryu", model.name()); + Assertions.assertEquals("bmqqvxmvw", 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 index b3e15c0d869f..b0953ac74e54 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -13,21 +13,10 @@ public final class CheckNameAvailabilityResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CheckNameAvailabilityResponseInner model - = BinaryData.fromString("{\"nameAvailable\":true,\"reason\":\"AlreadyExists\",\"message\":\"nvudwtiukb\"}") + = BinaryData.fromString("{\"nameAvailable\":false,\"reason\":\"Invalid\",\"message\":\"onsupeujlz\"}") .toObject(CheckNameAvailabilityResponseInner.class); - Assertions.assertTrue(model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("nvudwtiukb", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityResponseInner model = new CheckNameAvailabilityResponseInner().withNameAvailable(true) - .withReason(CheckNameAvailabilityReason.ALREADY_EXISTS) - .withMessage("nvudwtiukb"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityResponseInner.class); - Assertions.assertTrue(model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("nvudwtiukb", model.message()); + Assertions.assertFalse(model.nameAvailable()); + Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, model.reason()); + Assertions.assertEquals("onsupeujlz", model.message()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentPatchResourceTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentPatchResourceTests.java index 3a25bbfe90fe..797aff52330f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentPatchResourceTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentPatchResourceTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -13,19 +13,17 @@ public final class ConnectedEnvironmentPatchResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ConnectedEnvironmentPatchResource model = BinaryData - .fromString( - "{\"tags\":{\"ajiwkuo\":\"kcciwwzjuqkhr\",\"sauuimj\":\"oskg\",\"rfbyaosvexcso\":\"vxieduugidyj\"}}") + ConnectedEnvironmentPatchResource model = BinaryData.fromString("{\"tags\":{\"ieixynllxe\":\"xlhslnel\"}}") .toObject(ConnectedEnvironmentPatchResource.class); - Assertions.assertEquals("kcciwwzjuqkhr", model.tags().get("ajiwkuo")); + Assertions.assertEquals("xlhslnel", model.tags().get("ieixynllxe")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ConnectedEnvironmentPatchResource model = new ConnectedEnvironmentPatchResource() - .withTags(mapOf("ajiwkuo", "kcciwwzjuqkhr", "sauuimj", "oskg", "rfbyaosvexcso", "vxieduugidyj")); + ConnectedEnvironmentPatchResource model + = new ConnectedEnvironmentPatchResource().withTags(mapOf("ieixynllxe", "xlhslnel")); model = BinaryData.fromObject(model).toObject(ConnectedEnvironmentPatchResource.class); - Assertions.assertEquals("kcciwwzjuqkhr", model.tags().get("ajiwkuo")); + Assertions.assertEquals("xlhslnel", model.tags().get("ieixynllxe")); } // Use "Map.of" if available 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 index 1ba80a96b445..5268c6763523 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -22,7 +22,7 @@ public final class ConnectedEnvironmentsCheckNameAvailabilityWithResponseMockTests { @Test public void testCheckNameAvailabilityWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":true,\"reason\":\"AlreadyExists\",\"message\":\"dogypxrxvbfi\"}"; + String responseStr = "{\"nameAvailable\":true,\"reason\":\"AlreadyExists\",\"message\":\"erzztrkn\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,13 +32,13 @@ public void testCheckNameAvailabilityWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CheckNameAvailabilityResponse response = manager.connectedEnvironments() - .checkNameAvailabilityWithResponse("dmxzjijpv", "aurkihcirlde", - new CheckNameAvailabilityRequest().withName("rdcoxnbkkj").withType("urnnqbnqbpiz"), + .checkNameAvailabilityWithResponse("yudivbxnhsqeaeo", "qelwgdhuruzytza", + new CheckNameAvailabilityRequest().withName("gatmoljiy").withType("pinm"), com.azure.core.util.Context.NONE) .getValue(); Assertions.assertTrue(response.nameAvailable()); Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, response.reason()); - Assertions.assertEquals("dogypxrxvbfi", response.message()); + Assertions.assertEquals("erzztrkn", response.message()); } } 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 index 967b03d1dda6..f7c48e79582e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -20,7 +20,7 @@ public final class ConnectedEnvironmentsDaprComponentsListSecretsWithResponseMoc @Test public void testListSecretsWithResponse() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"brlc\",\"value\":\"duczkgof\"},{\"name\":\"fsrucv\",\"value\":\"rpcjttbstvjeaqnr\"}]}"; + = "{\"value\":[{\"name\":\"mzczfkicee\",\"value\":\"a\"},{\"name\":\"wspcaxikhfjqebg\",\"value\":\"xkxgzzrom\"},{\"name\":\"g\",\"value\":\"emtm\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -30,7 +30,7 @@ public void testListSecretsWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); DaprSecretsCollection response = manager.connectedEnvironmentsDaprComponents() - .listSecretsWithResponse("fulopmjnlexwhcb", "pibkephuu", "erctatoyin", com.azure.core.util.Context.NONE) + .listSecretsWithResponse("rdnyeita", "eq", "dynzjahwr", 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 index 81deb427d9f0..6d72c594311f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -27,7 +27,7 @@ public void testDelete() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.connectedEnvironments().delete("xuifmcsypobkdqz", "dzsylollgtrczz", com.azure.core.util.Context.NONE); + manager.connectedEnvironments().delete("jj", "h", 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 index 93d0dba6932b..4de24d3c78ac 100644 --- 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 @@ -1,80 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\":\"slzojh\",\"id\":\"tfnmdx\",\"type\":\"ngfdgugeyzihgrky\",\"properties\":{\"status\":\"Degraded\",\"startTime\":\"2021-09-22T02:11:13Z\",\"endTime\":\"2021-04-27T02:27:57Z\",\"template\":{\"containers\":[{},{},{}],\"initContainers\":[{},{}]}}},{\"name\":\"eevy\",\"id\":\"hsgz\",\"type\":\"zbgomfgbeg\",\"properties\":{\"status\":\"Stopped\",\"startTime\":\"2021-04-25T04:23:56Z\",\"endTime\":\"2021-09-02T21:08:17Z\",\"template\":{\"containers\":[{},{},{}],\"initContainers\":[{}]}}},{\"name\":\"ankrrfxee\",\"id\":\"tijv\",\"type\":\"vbmqzbqq\",\"properties\":{\"status\":\"Degraded\",\"startTime\":\"2021-09-18T21:24:35Z\",\"endTime\":\"2021-05-22T08:03Z\",\"template\":{\"containers\":[{},{},{}],\"initContainers\":[{},{}]}}},{\"name\":\"jkuyxoafgaoq\",\"id\":\"faey\",\"type\":\"nm\",\"properties\":{\"status\":\"Degraded\",\"startTime\":\"2021-11-02T13:56:44Z\",\"endTime\":\"2021-01-21T07:08:35Z\",\"template\":{\"containers\":[{},{},{},{}],\"initContainers\":[{},{},{}]}}}],\"nextLink\":\"q\"}") + "{\"value\":[{\"properties\":{\"status\":\"Stopped\",\"startTime\":\"2021-01-11T07:54:11Z\",\"endTime\":\"2021-11-03T13:17:32Z\",\"template\":{\"containers\":[{},{}],\"initContainers\":[{},{},{}]},\"detailedStatus\":{\"replicas\":[{},{},{},{}]},\"reason\":\"hvthlaiwdcxsm\",\"message\":\"zhzdtxetlgydlhqv\"},\"id\":\"npxybafiq\",\"name\":\"eaarbgjekglklbyu\",\"type\":\"idwcwvmzegjon\"}],\"nextLink\":\"jirwgdnqzbrfk\"}") .toObject(ContainerAppJobExecutionsInner.class); - Assertions.assertEquals("slzojh", model.value().get(0).name()); - Assertions.assertEquals("tfnmdx", model.value().get(0).id()); - Assertions.assertEquals("ngfdgugeyzihgrky", model.value().get(0).type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-22T02:11:13Z"), model.value().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-27T02:27:57Z"), 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("slzojh") - .withId("tfnmdx") - .withType("ngfdgugeyzihgrky") - .withStartTime(OffsetDateTime.parse("2021-09-22T02:11:13Z")) - .withEndTime(OffsetDateTime.parse("2021-04-27T02:27:57Z")) - .withTemplate(new JobExecutionTemplate() - .withContainers(Arrays.asList(new JobExecutionContainer(), new JobExecutionContainer(), - new JobExecutionContainer())) - .withInitContainers( - Arrays.asList(new JobExecutionContainer(), new JobExecutionContainer()))), - new JobExecutionInner().withName("eevy") - .withId("hsgz") - .withType("zbgomfgbeg") - .withStartTime(OffsetDateTime.parse("2021-04-25T04:23:56Z")) - .withEndTime(OffsetDateTime.parse("2021-09-02T21:08:17Z")) - .withTemplate(new JobExecutionTemplate() - .withContainers(Arrays.asList(new JobExecutionContainer(), new JobExecutionContainer(), - new JobExecutionContainer())) - .withInitContainers(Arrays.asList(new JobExecutionContainer()))), - new JobExecutionInner().withName("ankrrfxee") - .withId("tijv") - .withType("vbmqzbqq") - .withStartTime(OffsetDateTime.parse("2021-09-18T21:24:35Z")) - .withEndTime(OffsetDateTime.parse("2021-05-22T08:03Z")) - .withTemplate(new JobExecutionTemplate() - .withContainers(Arrays.asList(new JobExecutionContainer(), new JobExecutionContainer(), - new JobExecutionContainer())) - .withInitContainers( - Arrays.asList(new JobExecutionContainer(), new JobExecutionContainer()))), - new JobExecutionInner().withName("jkuyxoafgaoq") - .withId("faey") - .withType("nm") - .withStartTime(OffsetDateTime.parse("2021-11-02T13:56:44Z")) - .withEndTime(OffsetDateTime.parse("2021-01-21T07:08:35Z")) - .withTemplate(new JobExecutionTemplate() - .withContainers(Arrays.asList(new JobExecutionContainer(), new JobExecutionContainer(), - new JobExecutionContainer(), new JobExecutionContainer())) - .withInitContainers(Arrays.asList(new JobExecutionContainer(), new JobExecutionContainer(), - new JobExecutionContainer()))))); - model = BinaryData.fromObject(model).toObject(ContainerAppJobExecutionsInner.class); - Assertions.assertEquals("slzojh", model.value().get(0).name()); - Assertions.assertEquals("tfnmdx", model.value().get(0).id()); - Assertions.assertEquals("ngfdgugeyzihgrky", model.value().get(0).type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-22T02:11:13Z"), model.value().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-27T02:27:57Z"), model.value().get(0).endTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T07:54:11Z"), model.value().get(0).startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-03T13:17:32Z"), model.value().get(0).endTime()); + Assertions.assertEquals("jirwgdnqzbrfk", model.nextLink()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppNetworkingConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppNetworkingConfigurationTests.java new file mode 100644 index 000000000000..b2a324308fc2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppNetworkingConfigurationTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.ContainerAppNetworkingConfiguration; +import org.junit.jupiter.api.Assertions; + +public final class ContainerAppNetworkingConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ContainerAppNetworkingConfiguration model + = BinaryData.fromString("{\"outboundVnetSubnetId\":\"hzceuojgjrwjue\"}") + .toObject(ContainerAppNetworkingConfiguration.class); + Assertions.assertEquals("hzceuojgjrwjue", model.outboundVnetSubnetId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ContainerAppNetworkingConfiguration model + = new ContainerAppNetworkingConfiguration().withOutboundVnetSubnetId("hzceuojgjrwjue"); + model = BinaryData.fromObject(model).toObject(ContainerAppNetworkingConfiguration.class); + Assertions.assertEquals("hzceuojgjrwjue", model.outboundVnetSubnetId()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppPrivateEndpointConnectionsCreateOrUpdateMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppPrivateEndpointConnectionsCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..545ece092cf5 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppPrivateEndpointConnectionsCreateOrUpdateMockTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +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.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.appcontainers.models.PrivateLinkServiceConnectionState; +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 ContainerAppPrivateEndpointConnectionsCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"groupIds\":[\"ioshjgczetybn\",\"gztlcgc\",\"j\"],\"privateEndpoint\":{\"id\":\"j\"},\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"j\",\"actionsRequired\":\"becuvlbefvwcl\"},\"provisioningState\":\"Succeeded\"},\"id\":\"ylrwoxzg\",\"name\":\"psyxjije\",\"type\":\"pdvrbkerdkdkga\"}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateEndpointConnection response = manager.containerAppPrivateEndpointConnections() + .createOrUpdate("wgxql", "ekotjgxi", "qfkyfhiwvjaqu", + new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.DISCONNECTED) + .withDescription("ilg") + .withActionsRequired("rqre")), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.DISCONNECTED, + response.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("j", response.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("becuvlbefvwcl", response.privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppPrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppPrivateEndpointConnectionsGetWithResponseMockTests.java new file mode 100644 index 000000000000..ec9fd603444a --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppPrivateEndpointConnectionsGetWithResponseMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointConnection; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointServiceConnectionStatus; +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 ContainerAppPrivateEndpointConnectionsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"groupIds\":[\"eexuy\"],\"privateEndpoint\":{\"id\":\"r\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"kyksyimycc\",\"actionsRequired\":\"vkcxzznn\"},\"provisioningState\":\"Waiting\"},\"id\":\"rsejegprkj\",\"name\":\"uw\",\"type\":\"jmwvvbtuqkxxi\"}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateEndpointConnection response = manager.containerAppPrivateEndpointConnections() + .getWithResponse("hfvhuwzbxpcqz", "ihotjecohmxv", "lrrskap", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + response.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("kyksyimycc", response.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("vkcxzznn", response.privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppPrivateEndpointConnectionsListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppPrivateEndpointConnectionsListMockTests.java new file mode 100644 index 000000000000..868ee0db3e3f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppPrivateEndpointConnectionsListMockTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointConnection; +import com.azure.resourcemanager.appcontainers.models.PrivateEndpointServiceConnectionStatus; +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 ContainerAppPrivateEndpointConnectionsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"groupIds\":[\"q\"],\"privateEndpoint\":{\"id\":\"isf\"},\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"bdjnxume\",\"actionsRequired\":\"qontwhymxymulw\"},\"provisioningState\":\"Failed\"},\"id\":\"o\",\"name\":\"lhl\",\"type\":\"ycoybajasqubf\"}]}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.containerAppPrivateEndpointConnections() + .list("qwjxi", "dfkcef", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.DISCONNECTED, + response.iterator().next().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("bdjnxume", + response.iterator().next().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("qontwhymxymulw", + response.iterator().next().privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppPrivateLinkResourcesGetWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppPrivateLinkResourcesGetWithResponseMockTests.java new file mode 100644 index 000000000000..c44363ad6ad6 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppPrivateLinkResourcesGetWithResponseMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.PrivateLinkResource; +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 ContainerAppPrivateLinkResourcesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"groupId\":\"zyjfuc\",\"requiredMembers\":[\"djnosdkvibf\",\"sgm\"],\"requiredZoneNames\":[\"nzpducdaaktu\",\"ktz\",\"oimyfpqd\"]},\"id\":\"kpp\",\"name\":\"wyytfvpctf\",\"type\":\"ikff\"}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateLinkResource response = manager.containerAppPrivateLinkResources() + .getWithResponse("pwgoljt", "xnmxsdobygoogxqa", "j", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("nzpducdaaktu", response.requiredZoneNames().get(0)); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppPrivateLinkResourcesListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppPrivateLinkResourcesListMockTests.java new file mode 100644 index 000000000000..71207c222e41 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppPrivateLinkResourcesListMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.PrivateLinkResource; +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 ContainerAppPrivateLinkResourcesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"groupId\":\"fxcpupukiym\",\"requiredMembers\":[\"wdlvwtiwsmosaon\",\"qnamppultassa\"],\"requiredZoneNames\":[\"wnaze\",\"jb\",\"aj\",\"cyizy\"]},\"id\":\"cvxodkrvfsxxby\",\"name\":\"e\",\"type\":\"qlvge\"}]}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.containerAppPrivateLinkResources().list("j", "ywhjqwmchq", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("wnaze", response.iterator().next().requiredZoneNames().get(0)); + } +} 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 index e7f0051011f2..19bb71f4c244 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,18 +11,18 @@ public final class ContainerAppProbeHttpGetHttpHeadersItemTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ContainerAppProbeHttpGetHttpHeadersItem model = BinaryData.fromString("{\"name\":\"qiy\",\"value\":\"torzih\"}") + ContainerAppProbeHttpGetHttpHeadersItem model = BinaryData.fromString("{\"name\":\"pumnz\",\"value\":\"mwzn\"}") .toObject(ContainerAppProbeHttpGetHttpHeadersItem.class); - Assertions.assertEquals("qiy", model.name()); - Assertions.assertEquals("torzih", model.value()); + Assertions.assertEquals("pumnz", model.name()); + Assertions.assertEquals("mwzn", model.value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ContainerAppProbeHttpGetHttpHeadersItem model - = new ContainerAppProbeHttpGetHttpHeadersItem().withName("qiy").withValue("torzih"); + = new ContainerAppProbeHttpGetHttpHeadersItem().withName("pumnz").withValue("mwzn"); model = BinaryData.fromObject(model).toObject(ContainerAppProbeHttpGetHttpHeadersItem.class); - Assertions.assertEquals("qiy", model.name()); - Assertions.assertEquals("torzih", model.value()); + Assertions.assertEquals("pumnz", model.name()); + Assertions.assertEquals("mwzn", 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 index feee2b6f3a52..acaba36c203f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -15,31 +15,33 @@ public final class ContainerAppProbeHttpGetTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ContainerAppProbeHttpGet model = BinaryData.fromString( - "{\"host\":\"lquuijfqkacewii\",\"httpHeaders\":[{\"name\":\"ubjibww\",\"value\":\"f\"},{\"name\":\"ohqkvpuvksgpls\",\"value\":\"kn\"}],\"path\":\"fsynljphuop\",\"port\":415163187,\"scheme\":\"HTTPS\"}") + "{\"host\":\"ohqkvpuvksgpls\",\"httpHeaders\":[{\"name\":\"ynfs\",\"value\":\"n\"},{\"name\":\"jphuopxodlqi\",\"value\":\"ntorzihleosjswsr\"},{\"name\":\"slyzrpzbchckqq\",\"value\":\"qioxi\"},{\"name\":\"suiizynkedyat\",\"value\":\"wyhqmibzyhwits\"}],\"path\":\"pyy\",\"port\":1903484882,\"scheme\":\"HTTPS\"}") .toObject(ContainerAppProbeHttpGet.class); - Assertions.assertEquals("lquuijfqkacewii", model.host()); - Assertions.assertEquals("ubjibww", model.httpHeaders().get(0).name()); - Assertions.assertEquals("f", model.httpHeaders().get(0).value()); - Assertions.assertEquals("fsynljphuop", model.path()); - Assertions.assertEquals(415163187, model.port()); + Assertions.assertEquals("ohqkvpuvksgpls", model.host()); + Assertions.assertEquals("ynfs", model.httpHeaders().get(0).name()); + Assertions.assertEquals("n", model.httpHeaders().get(0).value()); + Assertions.assertEquals("pyy", model.path()); + Assertions.assertEquals(1903484882, model.port()); Assertions.assertEquals(Scheme.HTTPS, model.scheme()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ContainerAppProbeHttpGet model = new ContainerAppProbeHttpGet().withHost("lquuijfqkacewii") - .withHttpHeaders( - Arrays.asList(new ContainerAppProbeHttpGetHttpHeadersItem().withName("ubjibww").withValue("f"), - new ContainerAppProbeHttpGetHttpHeadersItem().withName("ohqkvpuvksgpls").withValue("kn"))) - .withPath("fsynljphuop") - .withPort(415163187) + ContainerAppProbeHttpGet model = new ContainerAppProbeHttpGet().withHost("ohqkvpuvksgpls") + .withHttpHeaders(Arrays.asList( + new ContainerAppProbeHttpGetHttpHeadersItem().withName("ynfs").withValue("n"), + new ContainerAppProbeHttpGetHttpHeadersItem().withName("jphuopxodlqi").withValue("ntorzihleosjswsr"), + new ContainerAppProbeHttpGetHttpHeadersItem().withName("slyzrpzbchckqq").withValue("qioxi"), + new ContainerAppProbeHttpGetHttpHeadersItem().withName("suiizynkedyat").withValue("wyhqmibzyhwits"))) + .withPath("pyy") + .withPort(1903484882) .withScheme(Scheme.HTTPS); model = BinaryData.fromObject(model).toObject(ContainerAppProbeHttpGet.class); - Assertions.assertEquals("lquuijfqkacewii", model.host()); - Assertions.assertEquals("ubjibww", model.httpHeaders().get(0).name()); - Assertions.assertEquals("f", model.httpHeaders().get(0).value()); - Assertions.assertEquals("fsynljphuop", model.path()); - Assertions.assertEquals(415163187, model.port()); + Assertions.assertEquals("ohqkvpuvksgpls", model.host()); + Assertions.assertEquals("ynfs", model.httpHeaders().get(0).name()); + Assertions.assertEquals("n", model.httpHeaders().get(0).value()); + Assertions.assertEquals("pyy", model.path()); + Assertions.assertEquals(1903484882, 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 index b0f81337ff28..782be695831d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,17 +11,18 @@ public final class ContainerAppProbeTcpSocketTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ContainerAppProbeTcpSocket model = BinaryData.fromString("{\"host\":\"osjswsr\",\"port\":1407927145}") + ContainerAppProbeTcpSocket model = BinaryData.fromString("{\"host\":\"biknsorgjhxbld\",\"port\":1166597262}") .toObject(ContainerAppProbeTcpSocket.class); - Assertions.assertEquals("osjswsr", model.host()); - Assertions.assertEquals(1407927145, model.port()); + Assertions.assertEquals("biknsorgjhxbld", model.host()); + Assertions.assertEquals(1166597262, model.port()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ContainerAppProbeTcpSocket model = new ContainerAppProbeTcpSocket().withHost("osjswsr").withPort(1407927145); + ContainerAppProbeTcpSocket model + = new ContainerAppProbeTcpSocket().withHost("biknsorgjhxbld").withPort(1166597262); model = BinaryData.fromObject(model).toObject(ContainerAppProbeTcpSocket.class); - Assertions.assertEquals("osjswsr", model.host()); - Assertions.assertEquals(1407927145, model.port()); + Assertions.assertEquals("biknsorgjhxbld", model.host()); + Assertions.assertEquals(1166597262, 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 index b92b18cdd3a0..509c970fc40b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -18,59 +18,59 @@ public final class ContainerAppProbeTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ContainerAppProbe model = BinaryData.fromString( - "{\"failureThreshold\":1285990077,\"httpGet\":{\"host\":\"uqgbdbutauvfbt\",\"httpHeaders\":[{\"name\":\"hhmhykojoxa\",\"value\":\"nn\"},{\"name\":\"lpichk\",\"value\":\"ymkcdyhb\"},{\"name\":\"kkpwdreqnovvq\",\"value\":\"ovljxywsu\"}],\"path\":\"yrs\",\"port\":371488938,\"scheme\":\"HTTPS\"},\"initialDelaySeconds\":38368134,\"periodSeconds\":749326216,\"successThreshold\":181693605,\"tcpSocket\":{\"host\":\"ea\",\"port\":884783389},\"terminationGracePeriodSeconds\":8790170709983104417,\"timeoutSeconds\":1893939111,\"type\":\"Liveness\"}") + "{\"failureThreshold\":588625153,\"httpGet\":{\"host\":\"rpqlp\",\"httpHeaders\":[{\"name\":\"ciuqgbdb\",\"value\":\"t\"},{\"name\":\"uvfbtkuwh\",\"value\":\"mhykojoxafnndl\"},{\"name\":\"ichkoymkcdyhb\",\"value\":\"kkpwdreqnovvq\"},{\"name\":\"ovljxywsu\",\"value\":\"syrsndsytgadgvra\"}],\"path\":\"en\",\"port\":2046621104,\"scheme\":\"HTTP\"},\"initialDelaySeconds\":1726613749,\"periodSeconds\":1182920658,\"successThreshold\":262159322,\"tcpSocket\":{\"host\":\"ijfqkacewiipfp\",\"port\":995419481},\"terminationGracePeriodSeconds\":4401878821743951844,\"timeoutSeconds\":1113434704,\"type\":\"Startup\"}") .toObject(ContainerAppProbe.class); - Assertions.assertEquals(1285990077, model.failureThreshold()); - Assertions.assertEquals("uqgbdbutauvfbt", model.httpGet().host()); - Assertions.assertEquals("hhmhykojoxa", model.httpGet().httpHeaders().get(0).name()); - Assertions.assertEquals("nn", model.httpGet().httpHeaders().get(0).value()); - Assertions.assertEquals("yrs", model.httpGet().path()); - Assertions.assertEquals(371488938, model.httpGet().port()); - Assertions.assertEquals(Scheme.HTTPS, model.httpGet().scheme()); - Assertions.assertEquals(38368134, model.initialDelaySeconds()); - Assertions.assertEquals(749326216, model.periodSeconds()); - Assertions.assertEquals(181693605, model.successThreshold()); - Assertions.assertEquals("ea", model.tcpSocket().host()); - Assertions.assertEquals(884783389, model.tcpSocket().port()); - Assertions.assertEquals(8790170709983104417L, model.terminationGracePeriodSeconds()); - Assertions.assertEquals(1893939111, model.timeoutSeconds()); - Assertions.assertEquals(Type.LIVENESS, model.type()); + Assertions.assertEquals(588625153, model.failureThreshold()); + Assertions.assertEquals("rpqlp", model.httpGet().host()); + Assertions.assertEquals("ciuqgbdb", model.httpGet().httpHeaders().get(0).name()); + Assertions.assertEquals("t", model.httpGet().httpHeaders().get(0).value()); + Assertions.assertEquals("en", model.httpGet().path()); + Assertions.assertEquals(2046621104, model.httpGet().port()); + Assertions.assertEquals(Scheme.HTTP, model.httpGet().scheme()); + Assertions.assertEquals(1726613749, model.initialDelaySeconds()); + Assertions.assertEquals(1182920658, model.periodSeconds()); + Assertions.assertEquals(262159322, model.successThreshold()); + Assertions.assertEquals("ijfqkacewiipfp", model.tcpSocket().host()); + Assertions.assertEquals(995419481, model.tcpSocket().port()); + Assertions.assertEquals(4401878821743951844L, model.terminationGracePeriodSeconds()); + Assertions.assertEquals(1113434704, model.timeoutSeconds()); + Assertions.assertEquals(Type.STARTUP, model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ContainerAppProbe model - = new ContainerAppProbe().withFailureThreshold(1285990077) - .withHttpGet(new ContainerAppProbeHttpGet().withHost("uqgbdbutauvfbt") - .withHttpHeaders(Arrays.asList( - new ContainerAppProbeHttpGetHttpHeadersItem().withName("hhmhykojoxa").withValue("nn"), - new ContainerAppProbeHttpGetHttpHeadersItem().withName("lpichk").withValue("ymkcdyhb"), - new ContainerAppProbeHttpGetHttpHeadersItem().withName("kkpwdreqnovvq").withValue("ovljxywsu"))) - .withPath("yrs") - .withPort(371488938) - .withScheme(Scheme.HTTPS)) - .withInitialDelaySeconds(38368134) - .withPeriodSeconds(749326216) - .withSuccessThreshold(181693605) - .withTcpSocket(new ContainerAppProbeTcpSocket().withHost("ea").withPort(884783389)) - .withTerminationGracePeriodSeconds(8790170709983104417L) - .withTimeoutSeconds(1893939111) - .withType(Type.LIVENESS); + ContainerAppProbe model = new ContainerAppProbe().withFailureThreshold(588625153) + .withHttpGet(new ContainerAppProbeHttpGet().withHost("rpqlp") + .withHttpHeaders(Arrays.asList( + new ContainerAppProbeHttpGetHttpHeadersItem().withName("ciuqgbdb").withValue("t"), + new ContainerAppProbeHttpGetHttpHeadersItem().withName("uvfbtkuwh").withValue("mhykojoxafnndl"), + new ContainerAppProbeHttpGetHttpHeadersItem().withName("ichkoymkcdyhb").withValue("kkpwdreqnovvq"), + new ContainerAppProbeHttpGetHttpHeadersItem().withName("ovljxywsu").withValue("syrsndsytgadgvra"))) + .withPath("en") + .withPort(2046621104) + .withScheme(Scheme.HTTP)) + .withInitialDelaySeconds(1726613749) + .withPeriodSeconds(1182920658) + .withSuccessThreshold(262159322) + .withTcpSocket(new ContainerAppProbeTcpSocket().withHost("ijfqkacewiipfp").withPort(995419481)) + .withTerminationGracePeriodSeconds(4401878821743951844L) + .withTimeoutSeconds(1113434704) + .withType(Type.STARTUP); model = BinaryData.fromObject(model).toObject(ContainerAppProbe.class); - Assertions.assertEquals(1285990077, model.failureThreshold()); - Assertions.assertEquals("uqgbdbutauvfbt", model.httpGet().host()); - Assertions.assertEquals("hhmhykojoxa", model.httpGet().httpHeaders().get(0).name()); - Assertions.assertEquals("nn", model.httpGet().httpHeaders().get(0).value()); - Assertions.assertEquals("yrs", model.httpGet().path()); - Assertions.assertEquals(371488938, model.httpGet().port()); - Assertions.assertEquals(Scheme.HTTPS, model.httpGet().scheme()); - Assertions.assertEquals(38368134, model.initialDelaySeconds()); - Assertions.assertEquals(749326216, model.periodSeconds()); - Assertions.assertEquals(181693605, model.successThreshold()); - Assertions.assertEquals("ea", model.tcpSocket().host()); - Assertions.assertEquals(884783389, model.tcpSocket().port()); - Assertions.assertEquals(8790170709983104417L, model.terminationGracePeriodSeconds()); - Assertions.assertEquals(1893939111, model.timeoutSeconds()); - Assertions.assertEquals(Type.LIVENESS, model.type()); + Assertions.assertEquals(588625153, model.failureThreshold()); + Assertions.assertEquals("rpqlp", model.httpGet().host()); + Assertions.assertEquals("ciuqgbdb", model.httpGet().httpHeaders().get(0).name()); + Assertions.assertEquals("t", model.httpGet().httpHeaders().get(0).value()); + Assertions.assertEquals("en", model.httpGet().path()); + Assertions.assertEquals(2046621104, model.httpGet().port()); + Assertions.assertEquals(Scheme.HTTP, model.httpGet().scheme()); + Assertions.assertEquals(1726613749, model.initialDelaySeconds()); + Assertions.assertEquals(1182920658, model.periodSeconds()); + Assertions.assertEquals(262159322, model.successThreshold()); + Assertions.assertEquals("ijfqkacewiipfp", model.tcpSocket().host()); + Assertions.assertEquals(995419481, model.tcpSocket().port()); + Assertions.assertEquals(4401878821743951844L, model.terminationGracePeriodSeconds()); + Assertions.assertEquals(1113434704, model.timeoutSeconds()); + Assertions.assertEquals(Type.STARTUP, 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 index 922d614874d8..454430cca889 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -28,7 +28,7 @@ public void testDeleteWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.containerAppsAuthConfigs() - .deleteWithResponse("kfrexcrseqwjks", "hud", "zhxogjggsvo", com.azure.core.util.Context.NONE); + .deleteWithResponse("vjnn", "tagfyvrtpqp", "mhzcgkrepdqh", 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 index bc8fabd77a57..1813e0c25648 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -27,7 +27,7 @@ public void testDelete() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.containerApps().delete("ralcxpjbyypsj", "qcjenkyhf", com.azure.core.util.Context.NONE); + manager.containerApps().delete("fq", "puby", 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 index 62982b998554..33fe5daf769c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -21,7 +21,7 @@ public final class ContainerAppsDiagnosticsGetDetectorWithResponseMockTests { @Test public void testGetDetectorWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"metadata\":{\"id\":\"euzanhs\",\"name\":\"hse\",\"description\":\"phpzfngqjcl\",\"author\":\"ftujwjjufw\",\"category\":\"qrkuor\",\"supportTopicList\":[{\"id\":\"ruqnm\",\"pesId\":\"hazcvjytiqswbqer\"},{\"id\":\"xiytxtdgukvl\",\"pesId\":\"ktg\"},{\"id\":\"tyouambewreswmow\",\"pesId\":\"mmuteyxeyguq\"},{\"id\":\"ijiitns\",\"pesId\":\"lz\"}],\"analysisTypes\":[\"ygr\",\"jwaiuf\"],\"type\":\"raybfueqfr\",\"score\":55.036324},\"dataset\":[{\"table\":{\"tableName\":\"h\",\"columns\":[{}],\"rows\":[\"dataywezskiecafyg\",\"datam\",\"dataieqvds\"]},\"renderingProperties\":{\"type\":1744360457,\"title\":\"xq\",\"description\":\"hyhxa\",\"isVisible\":false}},{\"table\":{\"tableName\":\"woijpodtbl\",\"columns\":[{},{},{}],\"rows\":[\"dataj\",\"datajodqhykincn\",\"dataemehllizh\"]},\"renderingProperties\":{\"type\":1625550461,\"title\":\"qodkadppyibngql\",\"description\":\"ywrxw\",\"isVisible\":true}},{\"table\":{\"tableName\":\"uvvadswzsnu\",\"columns\":[{},{},{}],\"rows\":[\"datawuowhlxlnwy\",\"datamouvbl\"]},\"renderingProperties\":{\"type\":318100229,\"title\":\"kltrfow\",\"description\":\"vrfmvlihcvjd\",\"isVisible\":true}},{\"table\":{\"tableName\":\"idhftu\",\"columns\":[{},{}],\"rows\":[\"datalwyojbfqzdkfnj\",\"dataixh\"]},\"renderingProperties\":{\"type\":1500801234,\"title\":\"qxmbjroumzzn\",\"description\":\"l\",\"isVisible\":true}}],\"status\":{\"message\":\"zgfxonjtpusl\",\"statusId\":1552463925},\"dataProviderMetadata\":{\"providerName\":\"tiotzb\",\"propertyBag\":[{\"name\":\"llgryfqiuasigr\",\"value\":\"socnequygdjboq\"},{\"name\":\"mtqjkqevadrmm\",\"value\":\"uawvcmjzk\"},{\"name\":\"idisczskosw\",\"value\":\"iqazugamxzkr\"},{\"name\":\"oiisbamnppcce\",\"value\":\"ztdsbeza\"}]}},\"id\":\"f\",\"name\":\"kzxuiz\",\"type\":\"y\"}"; + = "{\"properties\":{\"metadata\":{\"id\":\"ncgagdvc\",\"name\":\"hftzbpyfao\",\"description\":\"f\",\"author\":\"tncwmhjobzrfpr\",\"category\":\"dc\",\"supportTopicList\":[{\"id\":\"tcvbzwgwhgk\",\"pesId\":\"o\"},{\"id\":\"oorssatfy\",\"pesId\":\"pufdmxuqbdqn\"},{\"id\":\"ttuxvzfqayopbt\",\"pesId\":\"xhgvbhxmndztgsq\"}],\"analysisTypes\":[\"qm\",\"rxneibpgbrhbj\",\"q\"],\"type\":\"hqnmotpuwnno\",\"score\":63.130028},\"dataset\":[{\"table\":{\"tableName\":\"c\",\"columns\":[{},{},{},{}],\"rows\":[\"\\\"datapwyiulayno\\\"\",\"\\\"dataugkfhaxttpfsm\\\"\",\"\\\"datagsgh\\\"\"]},\"renderingProperties\":{\"type\":1140455764,\"title\":\"lddauqmllfe\",\"description\":\"hxuarig\",\"isVisible\":false}},{\"table\":{\"tableName\":\"lkqhvkrbzkua\",\"columns\":[{},{},{}],\"rows\":[\"\\\"datalpruulh\\\"\",\"\\\"datal\\\"\",\"\\\"dataoizwxvs\\\"\"]},\"renderingProperties\":{\"type\":1134538169,\"title\":\"yyskyekgafxczv\",\"description\":\"ckwrtw\",\"isVisible\":true}},{\"table\":{\"tableName\":\"eszr\",\"columns\":[{},{},{},{}],\"rows\":[\"\\\"datahwynct\\\"\",\"\\\"datac\\\"\",\"\\\"datac\\\"\"]},\"renderingProperties\":{\"type\":1585341326,\"title\":\"b\",\"description\":\"vjxitzovnkrt\",\"isVisible\":true}},{\"table\":{\"tableName\":\"n\",\"columns\":[{},{},{},{}],\"rows\":[\"\\\"dataoqksyiibhyxwbgbu\\\"\"]},\"renderingProperties\":{\"type\":588076467,\"title\":\"orbccqcdhth\",\"description\":\"vlirknuc\",\"isVisible\":false}}],\"status\":{\"message\":\"dtnagzlgpyaix\",\"statusId\":1112397483},\"dataProviderMetadata\":{\"providerName\":\"jtsmuydqf\",\"propertyBag\":[{\"name\":\"cybdueurgm\",\"value\":\"cp\"},{\"name\":\"hlo\",\"value\":\"rmhzicsbf\"},{\"name\":\"hyaaknyukibxiglh\",\"value\":\"zwxqtejpii\"},{\"name\":\"vtozya\",\"value\":\"jnxkbylhyyxgffk\"}]}},\"id\":\"q\",\"name\":\"rwtrdgscnvqeonsg\",\"type\":\"wxlwme\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,21 +31,19 @@ public void testGetDetectorWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Diagnostics response = manager.containerAppsDiagnostics() - .getDetectorWithResponse("hkhufm", "qumq", "jgydzul", com.azure.core.util.Context.NONE) + .getDetectorWithResponse("gabdxfkuzbwjeco", "yvht", "qbpel", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("ygr", response.properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("h", response.properties().dataset().get(0).table().tableName()); - Assertions.assertEquals(1744360457, response.properties().dataset().get(0).renderingProperties().type()); - Assertions.assertEquals("xq", response.properties().dataset().get(0).renderingProperties().title()); - Assertions.assertEquals("hyhxa", response.properties().dataset().get(0).renderingProperties().description()); + Assertions.assertEquals("qm", response.properties().metadata().analysisTypes().get(0)); + Assertions.assertEquals("c", response.properties().dataset().get(0).table().tableName()); + Assertions.assertEquals(1140455764, response.properties().dataset().get(0).renderingProperties().type()); + Assertions.assertEquals("lddauqmllfe", response.properties().dataset().get(0).renderingProperties().title()); + Assertions.assertEquals("hxuarig", response.properties().dataset().get(0).renderingProperties().description()); Assertions.assertFalse(response.properties().dataset().get(0).renderingProperties().isVisible()); - Assertions.assertEquals("zgfxonjtpusl", response.properties().status().message()); - Assertions.assertEquals(1552463925, response.properties().status().statusId()); - Assertions.assertEquals("tiotzb", response.properties().dataProviderMetadata().providerName()); - Assertions.assertEquals("llgryfqiuasigr", - response.properties().dataProviderMetadata().propertyBag().get(0).name()); - Assertions.assertEquals("socnequygdjboq", - response.properties().dataProviderMetadata().propertyBag().get(0).value()); + Assertions.assertEquals("dtnagzlgpyaix", response.properties().status().message()); + Assertions.assertEquals(1112397483, response.properties().status().statusId()); + Assertions.assertEquals("jtsmuydqf", response.properties().dataProviderMetadata().providerName()); + Assertions.assertEquals("cybdueurgm", response.properties().dataProviderMetadata().propertyBag().get(0).name()); + Assertions.assertEquals("cp", 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 index 95ff438d563a..9a2c4858c6d6 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -22,7 +22,7 @@ public final class ContainerAppsDiagnosticsListDetectorsMockTests { @Test public void testListDetectors() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"metadata\":{\"id\":\"toi\",\"name\":\"gygvfltgvdiho\",\"description\":\"krxwet\",\"author\":\"drcyrucpcun\",\"category\":\"zdqumoe\",\"supportTopicList\":[{\"id\":\"aienhqhsknd\",\"pesId\":\"lqkaadlknwf\"},{\"id\":\"nniyopetxi\",\"pesId\":\"nrlyxnuc\"},{\"id\":\"p\",\"pesId\":\"lkwq\"},{\"id\":\"tv\",\"pesId\":\"sdtcjbctvivuzqym\"}],\"analysisTypes\":[\"wogtgitsq\"],\"type\":\"vbrzcdb\",\"score\":84.15396},\"dataset\":[{\"table\":{\"tableName\":\"cxmxeatkdb\",\"columns\":[{}],\"rows\":[\"datajyibqbna\",\"datamhjrm\",\"datau\",\"datamaxljalfihcj\"]},\"renderingProperties\":{\"type\":1106408371,\"title\":\"nc\",\"description\":\"xxqcwgaxf\",\"isVisible\":true}},{\"table\":{\"tableName\":\"okzwjjzrlt\",\"columns\":[{}],\"rows\":[\"datayyfytpqsixymm\",\"dataujivyqlkjuvsm\"]},\"renderingProperties\":{\"type\":921930501,\"title\":\"oyovwz\",\"description\":\"pqvyb\",\"isVisible\":false}},{\"table\":{\"tableName\":\"x\",\"columns\":[{},{}],\"rows\":[\"datat\",\"dataubseskvcuartr\",\"dataunlpirykycndz\"]},\"renderingProperties\":{\"type\":1017219676,\"title\":\"reuykbbmnwagl\",\"description\":\"xoe\",\"isVisible\":true}}],\"status\":{\"message\":\"nfwmyymvqdbpb\",\"statusId\":1400688599},\"dataProviderMetadata\":{\"providerName\":\"vezcrcssbzhdd\",\"propertyBag\":[{\"name\":\"qfblhkalehpa\",\"value\":\"wugiqjti\"},{\"name\":\"qgdm\",\"value\":\"i\"}]}},\"id\":\"teajohiyg\",\"name\":\"pnbonhpcz\",\"type\":\"kmktpvwxqcseh\"}]}"; + = "{\"value\":[{\"properties\":{\"metadata\":{\"id\":\"cwybszfncnpatpft\",\"name\":\"ebwf\",\"description\":\"xorpwal\",\"author\":\"wugexojfccyl\",\"category\":\"rh\",\"supportTopicList\":[{\"id\":\"zjpwexcdrzprob\",\"pesId\":\"xezm\"},{\"id\":\"kjgpjeuxsphlokfp\",\"pesId\":\"jpdvzvfbhwbdquf\"},{\"id\":\"gnrglaqrwyamb\",\"pesId\":\"afebzxfkjq\"}],\"analysisTypes\":[\"bhlenntrvrkpsab\",\"u\",\"vzm\"],\"type\":\"hnysvlpyeu\",\"score\":0.47174692},\"dataset\":[{\"table\":{\"tableName\":\"qb\",\"columns\":[{},{}],\"rows\":[\"\\\"datahyqqegatxgr\\\"\"]},\"renderingProperties\":{\"type\":540272069,\"title\":\"nmtsdixc\",\"description\":\"kibmgjymn\",\"isVisible\":false}},{\"table\":{\"tableName\":\"airwcqzoofj\",\"columns\":[{},{},{},{}],\"rows\":[\"\\\"dataepfbhtleberpylje\\\"\"]},\"renderingProperties\":{\"type\":1510380414,\"title\":\"wjjqxowkdnjrx\",\"description\":\"rhw\",\"isVisible\":true}}],\"status\":{\"message\":\"pnowawonoehrguql\",\"statusId\":1968078590},\"dataProviderMetadata\":{\"providerName\":\"bjzm\",\"propertyBag\":[{\"name\":\"uyfazbkoc\",\"value\":\"gvthrmxkbcjww\"},{\"name\":\"omraw\",\"value\":\"keboo\"}]}},\"id\":\"l\",\"name\":\"acagae\",\"type\":\"aoiqclmgdt\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,26 +32,25 @@ public void testListDetectors() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.containerAppsDiagnostics() - .listDetectors("dfaifyzyzeyuube", "ds", com.azure.core.util.Context.NONE); + .listDetectors("oxrezsvavlrxik", "moywlu", com.azure.core.util.Context.NONE); - Assertions.assertEquals("wogtgitsq", response.iterator().next().properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("cxmxeatkdb", - response.iterator().next().properties().dataset().get(0).table().tableName()); - Assertions.assertEquals(1106408371, + Assertions.assertEquals("bhlenntrvrkpsab", + response.iterator().next().properties().metadata().analysisTypes().get(0)); + Assertions.assertEquals("qb", response.iterator().next().properties().dataset().get(0).table().tableName()); + Assertions.assertEquals(540272069, response.iterator().next().properties().dataset().get(0).renderingProperties().type()); - Assertions.assertEquals("nc", + Assertions.assertEquals("nmtsdixc", response.iterator().next().properties().dataset().get(0).renderingProperties().title()); - Assertions.assertEquals("xxqcwgaxf", + Assertions.assertEquals("kibmgjymn", response.iterator().next().properties().dataset().get(0).renderingProperties().description()); Assertions - .assertTrue(response.iterator().next().properties().dataset().get(0).renderingProperties().isVisible()); - Assertions.assertEquals("nfwmyymvqdbpb", response.iterator().next().properties().status().message()); - Assertions.assertEquals(1400688599, response.iterator().next().properties().status().statusId()); - Assertions.assertEquals("vezcrcssbzhdd", - response.iterator().next().properties().dataProviderMetadata().providerName()); - Assertions.assertEquals("qfblhkalehpa", + .assertFalse(response.iterator().next().properties().dataset().get(0).renderingProperties().isVisible()); + Assertions.assertEquals("pnowawonoehrguql", response.iterator().next().properties().status().message()); + Assertions.assertEquals(1968078590, response.iterator().next().properties().status().statusId()); + Assertions.assertEquals("bjzm", response.iterator().next().properties().dataProviderMetadata().providerName()); + Assertions.assertEquals("uyfazbkoc", response.iterator().next().properties().dataProviderMetadata().propertyBag().get(0).name()); - Assertions.assertEquals("wugiqjti", + Assertions.assertEquals("gvthrmxkbcjww", 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/ContainerAppsFunctionCollectionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsFunctionCollectionTests.java new file mode 100644 index 000000000000..842d89dfaaef --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsFunctionCollectionTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.implementation.models.ContainerAppsFunctionCollection; +import org.junit.jupiter.api.Assertions; + +public final class ContainerAppsFunctionCollectionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ContainerAppsFunctionCollection model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"invokeUrlTemplate\":\"kzclewyh\",\"triggerType\":\"wp\",\"language\":\"tzpofncckwyfzq\",\"isDisabled\":false,\"state\":\"Enabled\"},\"id\":\"yq\",\"name\":\"xzfe\",\"type\":\"ztppriolxorjalto\"},{\"properties\":{\"invokeUrlTemplate\":\"cwsobqwcs\",\"triggerType\":\"nwdcfhu\",\"language\":\"dpfuvg\",\"isDisabled\":false,\"state\":\"Disabled\"},\"id\":\"anvx\",\"name\":\"vtvudutncormr\",\"type\":\"xqtvcofu\"},{\"properties\":{\"invokeUrlTemplate\":\"vkg\",\"triggerType\":\"bgdknnqv\",\"language\":\"znqntoru\",\"isDisabled\":true,\"state\":\"Enabled\"},\"id\":\"mkycgra\",\"name\":\"wjue\",\"type\":\"aeburuvdmo\"},{\"properties\":{\"invokeUrlTemplate\":\"zlxwabmqoefkifr\",\"triggerType\":\"puqujmqlgkfbtn\",\"language\":\"aongbj\",\"isDisabled\":true,\"state\":\"Disabled\"},\"id\":\"tcje\",\"name\":\"ftwwaezkojvdc\",\"type\":\"zfoqouicybxar\"}],\"nextLink\":\"szufoxciqopidoa\"}") + .toObject(ContainerAppsFunctionCollection.class); + Assertions.assertEquals("szufoxciqopidoa", model.nextLink()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsFunctionInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsFunctionInnerTests.java new file mode 100644 index 000000000000..e709339ebdaf --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsFunctionInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsFunctionInner; + +public final class ContainerAppsFunctionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ContainerAppsFunctionInner model = BinaryData.fromString( + "{\"properties\":{\"invokeUrlTemplate\":\"hemms\",\"triggerType\":\"dkcrodt\",\"language\":\"nfwjlfltkacjvefk\",\"isDisabled\":false,\"state\":\"Disabled\"},\"id\":\"ggkfpagaowpul\",\"name\":\"qblylsyxkqj\",\"type\":\"sjervti\"}") + .toObject(ContainerAppsFunctionInner.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsFunctionPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsFunctionPropertiesTests.java new file mode 100644 index 000000000000..22dbd36b9297 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsFunctionPropertiesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsFunctionProperties; + +public final class ContainerAppsFunctionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ContainerAppsFunctionProperties model = BinaryData.fromString( + "{\"invokeUrlTemplate\":\"xsdszuempsb\",\"triggerType\":\"f\",\"language\":\"eyvpnqicvinvkj\",\"isDisabled\":true,\"state\":\"Disabled\"}") + .toObject(ContainerAppsFunctionProperties.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsFunctionsGetWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsFunctionsGetWithResponseMockTests.java new file mode 100644 index 000000000000..00ea5aeb749d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsFunctionsGetWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsFunction; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ContainerAppsFunctionsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"invokeUrlTemplate\":\"vslxlh\",\"triggerType\":\"vkrmukmyjmkx\",\"language\":\"tcsloj\",\"isDisabled\":false,\"state\":\"Disabled\"},\"id\":\"qtoqxjhqxcsq\",\"name\":\"tkbtnqlrngl\",\"type\":\"mbiipsnawwlqk\"}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ContainerAppsFunction response = manager.containerAppsFunctions() + .getWithResponse("nmwynefxexl", "ciatxtjrrl", "mdskjhhxdlajfoxc", com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsFunctionsListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsFunctionsListMockTests.java new file mode 100644 index 000000000000..cf5e078722f0 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsFunctionsListMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsFunction; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ContainerAppsFunctionsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"invokeUrlTemplate\":\"xeiyglesr\",\"triggerType\":\"aexhdctrceqnk\",\"language\":\"upobehdmljz\",\"isDisabled\":false,\"state\":\"Enabled\"},\"id\":\"pjpbibnzpp\",\"name\":\"epifexleqirccjc\",\"type\":\"ykcgxvrpjlvcz\"}]}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.containerAppsFunctions().list("nxhhl", "xricctkwmuqq", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsLabelHistoriesDeleteLabelHistoryWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsLabelHistoriesDeleteLabelHistoryWithResponseMockTests.java new file mode 100644 index 000000000000..6b087ce97537 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsLabelHistoriesDeleteLabelHistoryWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +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 ContainerAppsLabelHistoriesDeleteLabelHistoryWithResponseMockTests { + @Test + public void testDeleteLabelHistoryWithResponse() 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.containerAppsLabelHistories() + .deleteLabelHistoryWithResponse("fj", "rwq", "xet", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsLabelHistoriesGetLabelHistoryWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsLabelHistoriesGetLabelHistoryWithResponseMockTests.java new file mode 100644 index 000000000000..86d17a8ae5ba --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsLabelHistoriesGetLabelHistoryWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.LabelHistory; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ContainerAppsLabelHistoriesGetLabelHistoryWithResponseMockTests { + @Test + public void testGetLabelHistoryWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"records\":[{\"revision\":\"hlr\",\"start\":\"2021-03-02T18:49:45Z\",\"stop\":\"2021-04-19T20:50:14Z\",\"status\":\"Failed\"}]},\"id\":\"dseacdhz\",\"name\":\"xkbrfg\",\"type\":\"rwjiyew\"}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + LabelHistory response = manager.containerAppsLabelHistories() + .getLabelHistoryWithResponse("qrhm", "gqbedygi", "rzwnyk", com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsLabelHistoriesListLabelHistoryMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsLabelHistoriesListLabelHistoryMockTests.java new file mode 100644 index 000000000000..ae833a834c0e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsLabelHistoriesListLabelHistoryMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.LabelHistory; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ContainerAppsLabelHistoriesListLabelHistoryMockTests { + @Test + public void testListLabelHistory() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"records\":[{\"revision\":\"twloesqr\",\"start\":\"2021-04-22T13:34:52Z\",\"stop\":\"2021-03-30T21:09:09Z\",\"status\":\"Starting\"},{\"revision\":\"ukoila\",\"start\":\"2021-06-22T21:32:12Z\",\"stop\":\"2021-02-01T06:51:52Z\",\"status\":\"Starting\"},{\"revision\":\"ipjlhwyxpzruz\",\"start\":\"2021-11-02T20:00:35Z\",\"stop\":\"2021-02-24T23:49:38Z\",\"status\":\"Failed\"},{\"revision\":\"bg\",\"start\":\"2021-05-17T15:38:01Z\",\"stop\":\"2021-11-01T20:36:11Z\",\"status\":\"Failed\"}]},\"id\":\"nxdmnitmujdtv\",\"name\":\"clyymffhmjpddn\",\"type\":\"xfzuvrzmzqmzj\"}]}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.containerAppsLabelHistories() + .listLabelHistory("gcwvrrmdqntycna", "thvmaxgnuyeamcmh", "dfjeceho", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionFunctionsGetWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionFunctionsGetWithResponseMockTests.java new file mode 100644 index 000000000000..1e74f7d12de3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionFunctionsGetWithResponseMockTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsFunction; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ContainerAppsRevisionFunctionsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"invokeUrlTemplate\":\"bg\",\"triggerType\":\"isqsqkpdmioy\",\"language\":\"nmlvi\",\"isDisabled\":true,\"state\":\"Enabled\"},\"id\":\"m\",\"name\":\"vqdvrdmvxyrxdhg\",\"type\":\"qojbxao\"}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ContainerAppsFunction response = manager.containerAppsRevisionFunctions() + .getWithResponse("ggcjfwblqhx", "asmcolmugpyvaos", "kluwz", "eygzvtyevjhu", + com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionFunctionsListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionFunctionsListMockTests.java new file mode 100644 index 000000000000..463d0e4c5085 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionFunctionsListMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.ContainerAppsFunction; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ContainerAppsRevisionFunctionsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"invokeUrlTemplate\":\"yidoxznvg\",\"triggerType\":\"tmuuvdawsx\",\"language\":\"szbknimxl\",\"isDisabled\":true,\"state\":\"Enabled\"},\"id\":\"zutylcu\",\"name\":\"za\",\"type\":\"mnb\"}]}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.containerAppsRevisionFunctions().list("cgbzxm", "t", "lef", com.azure.core.util.Context.NONE); + + } +} 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 index c79414812a5b..dfe561cc7fa0 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -21,7 +21,7 @@ public final class ContainerAppsRevisionReplicasGetReplicaWithResponseMockTests @Test public void testGetReplicaWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"createdTime\":\"2021-03-26T19:13:55Z\",\"runningState\":\"Running\",\"runningStateDetails\":\"vhcs\",\"containers\":[{\"name\":\"wxaeaovure\",\"containerId\":\"ndsbdw\",\"ready\":true,\"started\":false,\"restartCount\":1679853059,\"runningState\":\"Waiting\",\"runningStateDetails\":\"opagttmvmmag\",\"logStreamEndpoint\":\"qylkjztjiu\",\"execEndpoint\":\"jcg\"},{\"name\":\"itpfinzcpdl\",\"containerId\":\"rlgjm\",\"ready\":true,\"started\":true,\"restartCount\":731731941,\"runningState\":\"Running\",\"runningStateDetails\":\"fzhompheq\",\"logStreamEndpoint\":\"relyujlfyoum\",\"execEndpoint\":\"kyeclcdigpta\"},{\"name\":\"rzmq\",\"containerId\":\"cycijoclxiut\",\"ready\":true,\"started\":false,\"restartCount\":776756497,\"runningState\":\"Running\",\"runningStateDetails\":\"r\",\"logStreamEndpoint\":\"btxjeaoqaqbzg\",\"execEndpoint\":\"fwwvuatbwbqam\"}],\"initContainers\":[{\"name\":\"iyslpkcvmwfaux\",\"containerId\":\"pmywbormcq\",\"ready\":true,\"started\":true,\"restartCount\":1772197279,\"runningState\":\"Running\",\"runningStateDetails\":\"fbojxjmcsmyqwix\",\"logStreamEndpoint\":\"pwnkwywzwo\",\"execEndpoint\":\"lickduoi\"},{\"name\":\"amt\",\"containerId\":\"sknxrwzawnvsbcf\",\"ready\":true,\"started\":false,\"restartCount\":2116581743,\"runningState\":\"Running\",\"runningStateDetails\":\"vdimwrzregzgy\",\"logStreamEndpoint\":\"utrwpweryekz\",\"execEndpoint\":\"hmeott\"},{\"name\":\"jyosxwwh\",\"containerId\":\"jtfvpndpmiljpn\",\"ready\":false,\"started\":true,\"restartCount\":1775688336,\"runningState\":\"Terminated\",\"runningStateDetails\":\"auzpjlx\",\"logStreamEndpoint\":\"huxiqhzlraymez\",\"execEndpoint\":\"skihmxrfd\"}]},\"id\":\"jrednwyysh\",\"name\":\"uwg\",\"type\":\"evuafpwzyifrk\"}"; + = "{\"properties\":{\"createdTime\":\"2021-11-17T11:32:18Z\",\"runningState\":\"NotRunning\",\"runningStateDetails\":\"qjilaywkdcwmqsyr\",\"containers\":[{\"name\":\"xdqaolfylnkkb\",\"containerId\":\"jvlywl\",\"ready\":false,\"started\":true,\"restartCount\":1853304262,\"runningState\":\"Running\",\"runningStateDetails\":\"lwyjfnqzocrdz\",\"logStreamEndpoint\":\"zeunt\",\"execEndpoint\":\"dnc\",\"debugEndpoint\":\"ttie\"},{\"name\":\"i\",\"containerId\":\"vnyttzgi\",\"ready\":false,\"started\":false,\"restartCount\":1526520594,\"runningState\":\"Running\",\"runningStateDetails\":\"behlqtxnr\",\"logStreamEndpoint\":\"kndrndpgfjo\",\"execEndpoint\":\"daqotwfh\",\"debugEndpoint\":\"xwgsa\"},{\"name\":\"c\",\"containerId\":\"owzafczu\",\"ready\":true,\"started\":true,\"restartCount\":1002831352,\"runningState\":\"Running\",\"runningStateDetails\":\"fycd\",\"logStreamEndpoint\":\"ititjnsxza\",\"execEndpoint\":\"nsjhwjuyxxb\",\"debugEndpoint\":\"vmv\"}],\"initContainers\":[{\"name\":\"uadx\",\"containerId\":\"eqbw\",\"ready\":true,\"started\":false,\"restartCount\":1536767308,\"runningState\":\"Waiting\",\"runningStateDetails\":\"cdrnxsl\",\"logStreamEndpoint\":\"lzladltxkpbqh\",\"execEndpoint\":\"dqqjwkrhwzdano\",\"debugEndpoint\":\"sgglmv\"},{\"name\":\"atuztjct\",\"containerId\":\"pvbkaehxsmzyg\",\"ready\":true,\"started\":true,\"restartCount\":1142682393,\"runningState\":\"Waiting\",\"runningStateDetails\":\"makxhys\",\"logStreamEndpoint\":\"ljuxl\",\"execEndpoint\":\"ect\",\"debugEndpoint\":\"fjmskdchmaiu\"},{\"name\":\"vlzw\",\"containerId\":\"gmfalkzazmgoked\",\"ready\":true,\"started\":false,\"restartCount\":514671581,\"runningState\":\"Running\",\"runningStateDetails\":\"kz\",\"logStreamEndpoint\":\"hqet\",\"execEndpoint\":\"qrtvaoznqni\",\"debugEndpoint\":\"ezeagmceituuge\"},{\"name\":\"fpjstlzmb\",\"containerId\":\"yjdeolctaebfs\",\"ready\":true,\"started\":true,\"restartCount\":947088602,\"runningState\":\"Waiting\",\"runningStateDetails\":\"bvt\",\"logStreamEndpoint\":\"gdxzvsgeafgfoseh\",\"execEndpoint\":\"zsxezppkkwaae\",\"debugEndpoint\":\"yfjlpzeqto\"}]},\"id\":\"plixlajmllpqu\",\"name\":\"vh\",\"type\":\"mfowgwbtmkek\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,18 +31,18 @@ public void testGetReplicaWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Replica response = manager.containerAppsRevisionReplicas() - .getReplicaWithResponse("yl", "ui", "vxva", "vcrk", com.azure.core.util.Context.NONE) + .getReplicaWithResponse("rb", "pv", "mdyfoebojtj", "pglaoh", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("wxaeaovure", response.containers().get(0).name()); - Assertions.assertEquals("ndsbdw", response.containers().get(0).containerId()); - Assertions.assertTrue(response.containers().get(0).ready()); - Assertions.assertFalse(response.containers().get(0).started()); - Assertions.assertEquals(1679853059, response.containers().get(0).restartCount()); - Assertions.assertEquals("iyslpkcvmwfaux", response.initContainers().get(0).name()); - Assertions.assertEquals("pmywbormcq", response.initContainers().get(0).containerId()); + Assertions.assertEquals("xdqaolfylnkkb", response.containers().get(0).name()); + Assertions.assertEquals("jvlywl", response.containers().get(0).containerId()); + Assertions.assertFalse(response.containers().get(0).ready()); + Assertions.assertTrue(response.containers().get(0).started()); + Assertions.assertEquals(1853304262, response.containers().get(0).restartCount()); + Assertions.assertEquals("uadx", response.initContainers().get(0).name()); + Assertions.assertEquals("eqbw", response.initContainers().get(0).containerId()); Assertions.assertTrue(response.initContainers().get(0).ready()); - Assertions.assertTrue(response.initContainers().get(0).started()); - Assertions.assertEquals(1772197279, response.initContainers().get(0).restartCount()); + Assertions.assertFalse(response.initContainers().get(0).started()); + Assertions.assertEquals(1536767308, 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 index c6c924044fb9..f931d6f19484 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -20,7 +20,7 @@ public final class ContainerAppsRevisionReplicasListReplicasWithResponseMockTest @Test public void testListReplicasWithResponse() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"createdTime\":\"2021-08-29T14:21:44Z\",\"runningState\":\"NotRunning\",\"runningStateDetails\":\"kvwjtqpkevmy\",\"containers\":[{},{},{},{}],\"initContainers\":[{},{}]},\"id\":\"pxklurccl\",\"name\":\"gxannnoytzposewx\",\"type\":\"gpxvkqmaupxvpi\"}]}"; + = "{\"value\":[{\"properties\":{\"createdTime\":\"2021-03-31T11:26:02Z\",\"runningState\":\"Running\",\"runningStateDetails\":\"jg\",\"containers\":[{},{},{},{}],\"initContainers\":[{},{},{}]},\"id\":\"yihpqadagrh\",\"name\":\"dicxdw\",\"type\":\"jfowxwy\"},{\"properties\":{\"createdTime\":\"2021-08-25T11:50:02Z\",\"runningState\":\"Unknown\",\"runningStateDetails\":\"bi\",\"containers\":[{},{},{},{}],\"initContainers\":[{},{},{},{}]},\"id\":\"eksbuhoduchvls\",\"name\":\"rdpibfd\",\"type\":\"jdusspyszekb\"},{\"properties\":{\"createdTime\":\"2021-03-19T06:20:11Z\",\"runningState\":\"NotRunning\",\"runningStateDetails\":\"gkrehbf\",\"containers\":[{},{},{}],\"initContainers\":[{},{},{},{}]},\"id\":\"fljfiimreoagsqt\",\"name\":\"adusrexxf\",\"type\":\"vsqw\"},{\"properties\":{\"createdTime\":\"2021-07-14T05:59:32Z\",\"runningState\":\"Unknown\",\"runningStateDetails\":\"fmnlikpsims\",\"containers\":[{},{},{},{}],\"initContainers\":[{},{}]},\"id\":\"qpmbhyqg\",\"name\":\"drmmttjxoph\",\"type\":\"erhsmvgohtw\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -30,8 +30,7 @@ public void testListReplicasWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ReplicaCollection response = manager.containerAppsRevisionReplicas() - .listReplicasWithResponse("wltxeqipxgzdyims", "ayorprav", "jogeslabnsmjkwyn", - com.azure.core.util.Context.NONE) + .listReplicasWithResponse("pkzwa", "xofqovchi", "bplvfidu", 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 index 0869f124f68e..35df2b18179a 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -28,7 +28,7 @@ public void testActivateRevisionWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.containerAppsRevisions() - .activateRevisionWithResponse("pptcbgqnzmnhii", "ialwc", "gckbb", com.azure.core.util.Context.NONE); + .activateRevisionWithResponse("wjcciklhsy", "krdre", "xolriy", 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 index 1077ef432642..5562e739623c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -28,7 +28,7 @@ public void testDeactivateRevisionWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.containerAppsRevisions() - .deactivateRevisionWithResponse("ccgzpraoxnyu", "fa", "sgftipwc", com.azure.core.util.Context.NONE); + .deactivateRevisionWithResponse("h", "beivdlhydwbdbfg", "lpu", 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 index 99700f303590..fdb1edf62198 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -28,7 +28,8 @@ public void testRestartRevisionWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.containerAppsRevisions() - .restartRevisionWithResponse("byubhiqdxyurnpn", "hza", "ccnuhiig", com.azure.core.util.Context.NONE); + .restartRevisionWithResponse("ytjlkesmmpath", "btahdeanii", "llbvgwzsfftedous", + 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 index 6175f8599ff1..27f6f927d18b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -27,7 +27,8 @@ public void testDelete() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.containerAppsSourceControls().delete("yrnskb", "hquhczygxvhajp", "e", com.azure.core.util.Context.NONE); + manager.containerAppsSourceControls() + .delete("dcduwjoedxn", "ucaifpaurwwgilf", "qqa", 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 index d268f28f0247..68962427d6c9 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,17 +12,18 @@ public final class ContainerResourcesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ContainerResources model = BinaryData - .fromString("{\"cpu\":55.672485242934656,\"memory\":\"kwobdagxtibq\",\"ephemeralStorage\":\"bxwakbog\"}") + .fromString( + "{\"cpu\":56.51085140416407,\"memory\":\"dfvzwdzuhty\",\"ephemeralStorage\":\"isdkfthwxmnteiw\"}") .toObject(ContainerResources.class); - Assertions.assertEquals(55.672485242934656D, model.cpu()); - Assertions.assertEquals("kwobdagxtibq", model.memory()); + Assertions.assertEquals(56.51085140416407D, model.cpu()); + Assertions.assertEquals("dfvzwdzuhty", model.memory()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ContainerResources model = new ContainerResources().withCpu(55.672485242934656D).withMemory("kwobdagxtibq"); + ContainerResources model = new ContainerResources().withCpu(56.51085140416407D).withMemory("dfvzwdzuhty"); model = BinaryData.fromObject(model).toObject(ContainerResources.class); - Assertions.assertEquals(55.672485242934656D, model.cpu()); - Assertions.assertEquals("kwobdagxtibq", model.memory()); + Assertions.assertEquals(56.51085140416407D, model.cpu()); + Assertions.assertEquals("dfvzwdzuhty", 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 index 930ea0a0ad23..66609a84fe3f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -13,18 +13,18 @@ public final class CookieExpirationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CookieExpiration model - = BinaryData.fromString("{\"convention\":\"FixedTime\",\"timeToExpiration\":\"zidnsezcxtbzsgfy\"}") + = BinaryData.fromString("{\"convention\":\"FixedTime\",\"timeToExpiration\":\"dhohsdtmcdzsuf\"}") .toObject(CookieExpiration.class); Assertions.assertEquals(CookieExpirationConvention.FIXED_TIME, model.convention()); - Assertions.assertEquals("zidnsezcxtbzsgfy", model.timeToExpiration()); + Assertions.assertEquals("dhohsdtmcdzsuf", model.timeToExpiration()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { CookieExpiration model = new CookieExpiration().withConvention(CookieExpirationConvention.FIXED_TIME) - .withTimeToExpiration("zidnsezcxtbzsgfy"); + .withTimeToExpiration("dhohsdtmcdzsuf"); model = BinaryData.fromObject(model).toObject(CookieExpiration.class); Assertions.assertEquals(CookieExpirationConvention.FIXED_TIME, model.convention()); - Assertions.assertEquals("zidnsezcxtbzsgfy", model.timeToExpiration()); + Assertions.assertEquals("dhohsdtmcdzsuf", 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 index 5317ae117f3f..dfbf4c93ae35 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -13,21 +13,22 @@ public final class CustomDomainTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CustomDomain model = BinaryData - .fromString("{\"name\":\"joya\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"yjpkiidzyexz\"}") + .fromString( + "{\"name\":\"rhhuaopppcqeqx\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"ahzxctobgbk\"}") .toObject(CustomDomain.class); - Assertions.assertEquals("joya", model.name()); + Assertions.assertEquals("rhhuaopppcqeqx", model.name()); Assertions.assertEquals(BindingType.SNI_ENABLED, model.bindingType()); - Assertions.assertEquals("yjpkiidzyexz", model.certificateId()); + Assertions.assertEquals("ahzxctobgbk", model.certificateId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CustomDomain model = new CustomDomain().withName("joya") + CustomDomain model = new CustomDomain().withName("rhhuaopppcqeqx") .withBindingType(BindingType.SNI_ENABLED) - .withCertificateId("yjpkiidzyexz"); + .withCertificateId("ahzxctobgbk"); model = BinaryData.fromObject(model).toObject(CustomDomain.class); - Assertions.assertEquals("joya", model.name()); + Assertions.assertEquals("rhhuaopppcqeqx", model.name()); Assertions.assertEquals(BindingType.SNI_ENABLED, model.bindingType()); - Assertions.assertEquals("yjpkiidzyexz", model.certificateId()); + Assertions.assertEquals("ahzxctobgbk", model.certificateId()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprAppHealthTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprAppHealthTests.java index 266432fb2551..22ccc7bbe232 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprAppHealthTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprAppHealthTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,27 +12,27 @@ public final class DaprAppHealthTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DaprAppHealth model = BinaryData.fromString( - "{\"enabled\":false,\"path\":\"t\",\"probeIntervalSeconds\":393815457,\"probeTimeoutMilliseconds\":730619532,\"threshold\":1493412527}") + "{\"enabled\":true,\"path\":\"wgdrjervnaenqp\",\"probeIntervalSeconds\":1479768723,\"probeTimeoutMilliseconds\":681452902,\"threshold\":895776000}") .toObject(DaprAppHealth.class); - Assertions.assertFalse(model.enabled()); - Assertions.assertEquals("t", model.path()); - Assertions.assertEquals(393815457, model.probeIntervalSeconds()); - Assertions.assertEquals(730619532, model.probeTimeoutMilliseconds()); - Assertions.assertEquals(1493412527, model.threshold()); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals("wgdrjervnaenqp", model.path()); + Assertions.assertEquals(1479768723, model.probeIntervalSeconds()); + Assertions.assertEquals(681452902, model.probeTimeoutMilliseconds()); + Assertions.assertEquals(895776000, model.threshold()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DaprAppHealth model = new DaprAppHealth().withEnabled(false) - .withPath("t") - .withProbeIntervalSeconds(393815457) - .withProbeTimeoutMilliseconds(730619532) - .withThreshold(1493412527); + DaprAppHealth model = new DaprAppHealth().withEnabled(true) + .withPath("wgdrjervnaenqp") + .withProbeIntervalSeconds(1479768723) + .withProbeTimeoutMilliseconds(681452902) + .withThreshold(895776000); model = BinaryData.fromObject(model).toObject(DaprAppHealth.class); - Assertions.assertFalse(model.enabled()); - Assertions.assertEquals("t", model.path()); - Assertions.assertEquals(393815457, model.probeIntervalSeconds()); - Assertions.assertEquals(730619532, model.probeTimeoutMilliseconds()); - Assertions.assertEquals(1493412527, model.threshold()); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals("wgdrjervnaenqp", model.path()); + Assertions.assertEquals(1479768723, model.probeIntervalSeconds()); + Assertions.assertEquals(681452902, model.probeTimeoutMilliseconds()); + Assertions.assertEquals(895776000, model.threshold()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesCollectionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesCollectionTests.java new file mode 100644 index 000000000000..7d8df9f6d5fe --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesCollectionTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.implementation.models.DaprComponentResiliencyPoliciesCollection; +import org.junit.jupiter.api.Assertions; + +public final class DaprComponentResiliencyPoliciesCollectionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DaprComponentResiliencyPoliciesCollection model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"inboundPolicy\":{\"httpRetryPolicy\":{\"maxRetries\":1881080572,\"retryBackOff\":{}},\"timeoutPolicy\":{\"responseTimeoutInSeconds\":932174899},\"circuitBreakerPolicy\":{\"consecutiveErrors\":1465661889,\"timeoutInSeconds\":935843013,\"intervalInSeconds\":652543826}},\"outboundPolicy\":{\"httpRetryPolicy\":{\"maxRetries\":516078825,\"retryBackOff\":{}},\"timeoutPolicy\":{\"responseTimeoutInSeconds\":685959660},\"circuitBreakerPolicy\":{\"consecutiveErrors\":2066244136,\"timeoutInSeconds\":637790167,\"intervalInSeconds\":446308153}}},\"id\":\"ogkhnmgbr\",\"name\":\"uxddbhfh\",\"type\":\"fpazjzoywjxhpd\"},{\"properties\":{\"inboundPolicy\":{\"httpRetryPolicy\":{\"maxRetries\":796854695,\"retryBackOff\":{}},\"timeoutPolicy\":{\"responseTimeoutInSeconds\":508668322},\"circuitBreakerPolicy\":{\"consecutiveErrors\":68476839,\"timeoutInSeconds\":1565487990,\"intervalInSeconds\":899609401}},\"outboundPolicy\":{\"httpRetryPolicy\":{\"maxRetries\":1521650875,\"retryBackOff\":{}},\"timeoutPolicy\":{\"responseTimeoutInSeconds\":1515781565},\"circuitBreakerPolicy\":{\"consecutiveErrors\":1059023797,\"timeoutInSeconds\":1537036510,\"intervalInSeconds\":529591375}}},\"id\":\"uug\",\"name\":\"bsre\",\"type\":\"rfqkfuar\"}],\"nextLink\":\"lvhhtklnvn\"}") + .toObject(DaprComponentResiliencyPoliciesCollection.class); + Assertions.assertEquals(1881080572, model.value().get(0).inboundPolicy().httpRetryPolicy().maxRetries()); + Assertions.assertEquals(932174899, + model.value().get(0).inboundPolicy().timeoutPolicy().responseTimeoutInSeconds()); + Assertions.assertEquals(1465661889, + model.value().get(0).inboundPolicy().circuitBreakerPolicy().consecutiveErrors()); + Assertions.assertEquals(935843013, + model.value().get(0).inboundPolicy().circuitBreakerPolicy().timeoutInSeconds()); + Assertions.assertEquals(652543826, + model.value().get(0).inboundPolicy().circuitBreakerPolicy().intervalInSeconds()); + Assertions.assertEquals(516078825, model.value().get(0).outboundPolicy().httpRetryPolicy().maxRetries()); + Assertions.assertEquals(685959660, + model.value().get(0).outboundPolicy().timeoutPolicy().responseTimeoutInSeconds()); + Assertions.assertEquals(2066244136, + model.value().get(0).outboundPolicy().circuitBreakerPolicy().consecutiveErrors()); + Assertions.assertEquals(637790167, + model.value().get(0).outboundPolicy().circuitBreakerPolicy().timeoutInSeconds()); + Assertions.assertEquals(446308153, + model.value().get(0).outboundPolicy().circuitBreakerPolicy().intervalInSeconds()); + Assertions.assertEquals("lvhhtklnvn", model.nextLink()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesCreateOrUpdateWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..1dd119353d40 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicy; +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; +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 DaprComponentResiliencyPoliciesCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"inboundPolicy\":{\"httpRetryPolicy\":{\"maxRetries\":2145155757,\"retryBackOff\":{\"initialDelayInMilliseconds\":1583062365,\"maxIntervalInMilliseconds\":928036957}},\"timeoutPolicy\":{\"responseTimeoutInSeconds\":2106551413},\"circuitBreakerPolicy\":{\"consecutiveErrors\":2080508866,\"timeoutInSeconds\":832276472,\"intervalInSeconds\":1685067411}},\"outboundPolicy\":{\"httpRetryPolicy\":{\"maxRetries\":828515793,\"retryBackOff\":{\"initialDelayInMilliseconds\":1626783727,\"maxIntervalInMilliseconds\":1624234015}},\"timeoutPolicy\":{\"responseTimeoutInSeconds\":1904401513},\"circuitBreakerPolicy\":{\"consecutiveErrors\":148726664,\"timeoutInSeconds\":1378709851,\"intervalInSeconds\":510338620}}},\"id\":\"yozdsfzjuegrhrht\",\"name\":\"l\",\"type\":\"jtv\"}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + DaprComponentResiliencyPolicy response = manager.daprComponentResiliencyPolicies() + .define("cqrq") + .withExistingDaprComponent("itbfjtdy", "tnp", "facqo") + .withInboundPolicy(new DaprComponentResiliencyPolicyConfiguration() + .withHttpRetryPolicy( + new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration().withMaxRetries(999476991) + .withRetryBackOff(new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() + .withInitialDelayInMilliseconds(1374912562) + .withMaxIntervalInMilliseconds(2070411553))) + .withTimeoutPolicy(new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration() + .withResponseTimeoutInSeconds(2138196355)) + .withCircuitBreakerPolicy(new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration() + .withConsecutiveErrors(1073421759) + .withTimeoutInSeconds(528824343) + .withIntervalInSeconds(536559795))) + .withOutboundPolicy(new DaprComponentResiliencyPolicyConfiguration() + .withHttpRetryPolicy( + new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration().withMaxRetries(1009595631) + .withRetryBackOff(new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() + .withInitialDelayInMilliseconds(307363105) + .withMaxIntervalInMilliseconds(1331362871))) + .withTimeoutPolicy(new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration() + .withResponseTimeoutInSeconds(1384162220)) + .withCircuitBreakerPolicy(new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration() + .withConsecutiveErrors(1745411663) + .withTimeoutInSeconds(186241568) + .withIntervalInSeconds(1067818020))) + .create(); + + Assertions.assertEquals(2145155757, response.inboundPolicy().httpRetryPolicy().maxRetries()); + Assertions.assertEquals(1583062365, + response.inboundPolicy().httpRetryPolicy().retryBackOff().initialDelayInMilliseconds()); + Assertions.assertEquals(928036957, + response.inboundPolicy().httpRetryPolicy().retryBackOff().maxIntervalInMilliseconds()); + Assertions.assertEquals(2106551413, response.inboundPolicy().timeoutPolicy().responseTimeoutInSeconds()); + Assertions.assertEquals(2080508866, response.inboundPolicy().circuitBreakerPolicy().consecutiveErrors()); + Assertions.assertEquals(832276472, response.inboundPolicy().circuitBreakerPolicy().timeoutInSeconds()); + Assertions.assertEquals(1685067411, response.inboundPolicy().circuitBreakerPolicy().intervalInSeconds()); + Assertions.assertEquals(828515793, response.outboundPolicy().httpRetryPolicy().maxRetries()); + Assertions.assertEquals(1626783727, + response.outboundPolicy().httpRetryPolicy().retryBackOff().initialDelayInMilliseconds()); + Assertions.assertEquals(1624234015, + response.outboundPolicy().httpRetryPolicy().retryBackOff().maxIntervalInMilliseconds()); + Assertions.assertEquals(1904401513, response.outboundPolicy().timeoutPolicy().responseTimeoutInSeconds()); + Assertions.assertEquals(148726664, response.outboundPolicy().circuitBreakerPolicy().consecutiveErrors()); + Assertions.assertEquals(1378709851, response.outboundPolicy().circuitBreakerPolicy().timeoutInSeconds()); + Assertions.assertEquals(510338620, response.outboundPolicy().circuitBreakerPolicy().intervalInSeconds()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesDeleteWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..23eacf488bd5 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesDeleteWithResponseMockTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +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 DaprComponentResiliencyPoliciesDeleteWithResponseMockTests { + @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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.daprComponentResiliencyPolicies() + .deleteWithResponse("rfvqtvkhgvo", "gxkfnaoaqymhccto", "uowyrnskbyhqu", "czygxv", + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesGetWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesGetWithResponseMockTests.java new file mode 100644 index 000000000000..7e0a8431403c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesGetWithResponseMockTests.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicy; +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 DaprComponentResiliencyPoliciesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"inboundPolicy\":{\"httpRetryPolicy\":{\"maxRetries\":1644892529,\"retryBackOff\":{\"initialDelayInMilliseconds\":13045532,\"maxIntervalInMilliseconds\":1817719696}},\"timeoutPolicy\":{\"responseTimeoutInSeconds\":1796253106},\"circuitBreakerPolicy\":{\"consecutiveErrors\":1470192148,\"timeoutInSeconds\":704084155,\"intervalInSeconds\":1347263959}},\"outboundPolicy\":{\"httpRetryPolicy\":{\"maxRetries\":901679846,\"retryBackOff\":{\"initialDelayInMilliseconds\":1648575812,\"maxIntervalInMilliseconds\":1326448066}},\"timeoutPolicy\":{\"responseTimeoutInSeconds\":1268203688},\"circuitBreakerPolicy\":{\"consecutiveErrors\":528226837,\"timeoutInSeconds\":556938395,\"intervalInSeconds\":634776968}}},\"id\":\"okbczothymgob\",\"name\":\"lmsnwgwi\",\"type\":\"aaneakhtmhobcya\"}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + DaprComponentResiliencyPolicy response = manager.daprComponentResiliencyPolicies() + .getWithResponse("sjmrkkhm", "dmdlgyqixokw", "jawh", "ag", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(1644892529, response.inboundPolicy().httpRetryPolicy().maxRetries()); + Assertions.assertEquals(13045532, + response.inboundPolicy().httpRetryPolicy().retryBackOff().initialDelayInMilliseconds()); + Assertions.assertEquals(1817719696, + response.inboundPolicy().httpRetryPolicy().retryBackOff().maxIntervalInMilliseconds()); + Assertions.assertEquals(1796253106, response.inboundPolicy().timeoutPolicy().responseTimeoutInSeconds()); + Assertions.assertEquals(1470192148, response.inboundPolicy().circuitBreakerPolicy().consecutiveErrors()); + Assertions.assertEquals(704084155, response.inboundPolicy().circuitBreakerPolicy().timeoutInSeconds()); + Assertions.assertEquals(1347263959, response.inboundPolicy().circuitBreakerPolicy().intervalInSeconds()); + Assertions.assertEquals(901679846, response.outboundPolicy().httpRetryPolicy().maxRetries()); + Assertions.assertEquals(1648575812, + response.outboundPolicy().httpRetryPolicy().retryBackOff().initialDelayInMilliseconds()); + Assertions.assertEquals(1326448066, + response.outboundPolicy().httpRetryPolicy().retryBackOff().maxIntervalInMilliseconds()); + Assertions.assertEquals(1268203688, response.outboundPolicy().timeoutPolicy().responseTimeoutInSeconds()); + Assertions.assertEquals(528226837, response.outboundPolicy().circuitBreakerPolicy().consecutiveErrors()); + Assertions.assertEquals(556938395, response.outboundPolicy().circuitBreakerPolicy().timeoutInSeconds()); + Assertions.assertEquals(634776968, response.outboundPolicy().circuitBreakerPolicy().intervalInSeconds()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesListMockTests.java new file mode 100644 index 000000000000..4dac64602697 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPoliciesListMockTests.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicy; +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 DaprComponentResiliencyPoliciesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"inboundPolicy\":{\"httpRetryPolicy\":{\"maxRetries\":475439414,\"retryBackOff\":{\"initialDelayInMilliseconds\":931480297,\"maxIntervalInMilliseconds\":338982204}},\"timeoutPolicy\":{\"responseTimeoutInSeconds\":612216711},\"circuitBreakerPolicy\":{\"consecutiveErrors\":2069524060,\"timeoutInSeconds\":906046225,\"intervalInSeconds\":1915861676}},\"outboundPolicy\":{\"httpRetryPolicy\":{\"maxRetries\":52257926,\"retryBackOff\":{\"initialDelayInMilliseconds\":1868056089,\"maxIntervalInMilliseconds\":702156768}},\"timeoutPolicy\":{\"responseTimeoutInSeconds\":1020255281},\"circuitBreakerPolicy\":{\"consecutiveErrors\":1592793613,\"timeoutInSeconds\":712897356,\"intervalInSeconds\":1032764094}}},\"id\":\"ouwhldxwhie\",\"name\":\"roqksmfxm\",\"type\":\"vprstv\"}]}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.daprComponentResiliencyPolicies() + .list("ajpxecxqnwhscoza", "mvgxsmpknpwir", "ljfewxqo", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(475439414, response.iterator().next().inboundPolicy().httpRetryPolicy().maxRetries()); + Assertions.assertEquals(931480297, + response.iterator().next().inboundPolicy().httpRetryPolicy().retryBackOff().initialDelayInMilliseconds()); + Assertions.assertEquals(338982204, + response.iterator().next().inboundPolicy().httpRetryPolicy().retryBackOff().maxIntervalInMilliseconds()); + Assertions.assertEquals(612216711, + response.iterator().next().inboundPolicy().timeoutPolicy().responseTimeoutInSeconds()); + Assertions.assertEquals(2069524060, + response.iterator().next().inboundPolicy().circuitBreakerPolicy().consecutiveErrors()); + Assertions.assertEquals(906046225, + response.iterator().next().inboundPolicy().circuitBreakerPolicy().timeoutInSeconds()); + Assertions.assertEquals(1915861676, + response.iterator().next().inboundPolicy().circuitBreakerPolicy().intervalInSeconds()); + Assertions.assertEquals(52257926, response.iterator().next().outboundPolicy().httpRetryPolicy().maxRetries()); + Assertions.assertEquals(1868056089, + response.iterator().next().outboundPolicy().httpRetryPolicy().retryBackOff().initialDelayInMilliseconds()); + Assertions.assertEquals(702156768, + response.iterator().next().outboundPolicy().httpRetryPolicy().retryBackOff().maxIntervalInMilliseconds()); + Assertions.assertEquals(1020255281, + response.iterator().next().outboundPolicy().timeoutPolicy().responseTimeoutInSeconds()); + Assertions.assertEquals(1592793613, + response.iterator().next().outboundPolicy().circuitBreakerPolicy().consecutiveErrors()); + Assertions.assertEquals(712897356, + response.iterator().next().outboundPolicy().circuitBreakerPolicy().timeoutInSeconds()); + Assertions.assertEquals(1032764094, + response.iterator().next().outboundPolicy().circuitBreakerPolicy().intervalInSeconds()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPolicyCircuitBreakerPolicyConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPolicyCircuitBreakerPolicyConfigurationTests.java new file mode 100644 index 000000000000..2fb6673e2f97 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPolicyCircuitBreakerPolicyConfigurationTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration; +import org.junit.jupiter.api.Assertions; + +public final class DaprComponentResiliencyPolicyCircuitBreakerPolicyConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration model = BinaryData + .fromString( + "{\"consecutiveErrors\":504276200,\"timeoutInSeconds\":598830152,\"intervalInSeconds\":1413290916}") + .toObject(DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.class); + Assertions.assertEquals(504276200, model.consecutiveErrors()); + Assertions.assertEquals(598830152, model.timeoutInSeconds()); + Assertions.assertEquals(1413290916, model.intervalInSeconds()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration model + = new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration().withConsecutiveErrors(504276200) + .withTimeoutInSeconds(598830152) + .withIntervalInSeconds(1413290916); + model = BinaryData.fromObject(model) + .toObject(DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.class); + Assertions.assertEquals(504276200, model.consecutiveErrors()); + Assertions.assertEquals(598830152, model.timeoutInSeconds()); + Assertions.assertEquals(1413290916, model.intervalInSeconds()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPolicyConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPolicyConfigurationTests.java new file mode 100644 index 000000000000..27dea25ec63b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPolicyConfigurationTests.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +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; +import org.junit.jupiter.api.Assertions; + +public final class DaprComponentResiliencyPolicyConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DaprComponentResiliencyPolicyConfiguration model = BinaryData.fromString( + "{\"httpRetryPolicy\":{\"maxRetries\":1816761709,\"retryBackOff\":{\"initialDelayInMilliseconds\":26271321,\"maxIntervalInMilliseconds\":1931491413}},\"timeoutPolicy\":{\"responseTimeoutInSeconds\":853559772},\"circuitBreakerPolicy\":{\"consecutiveErrors\":1504624884,\"timeoutInSeconds\":584934024,\"intervalInSeconds\":1282256848}}") + .toObject(DaprComponentResiliencyPolicyConfiguration.class); + Assertions.assertEquals(1816761709, model.httpRetryPolicy().maxRetries()); + Assertions.assertEquals(26271321, model.httpRetryPolicy().retryBackOff().initialDelayInMilliseconds()); + Assertions.assertEquals(1931491413, model.httpRetryPolicy().retryBackOff().maxIntervalInMilliseconds()); + Assertions.assertEquals(853559772, model.timeoutPolicy().responseTimeoutInSeconds()); + Assertions.assertEquals(1504624884, model.circuitBreakerPolicy().consecutiveErrors()); + Assertions.assertEquals(584934024, model.circuitBreakerPolicy().timeoutInSeconds()); + Assertions.assertEquals(1282256848, model.circuitBreakerPolicy().intervalInSeconds()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DaprComponentResiliencyPolicyConfiguration model = new DaprComponentResiliencyPolicyConfiguration() + .withHttpRetryPolicy( + new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration().withMaxRetries(1816761709) + .withRetryBackOff(new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() + .withInitialDelayInMilliseconds(26271321) + .withMaxIntervalInMilliseconds(1931491413))) + .withTimeoutPolicy( + new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration().withResponseTimeoutInSeconds(853559772)) + .withCircuitBreakerPolicy( + new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration().withConsecutiveErrors(1504624884) + .withTimeoutInSeconds(584934024) + .withIntervalInSeconds(1282256848)); + model = BinaryData.fromObject(model).toObject(DaprComponentResiliencyPolicyConfiguration.class); + Assertions.assertEquals(1816761709, model.httpRetryPolicy().maxRetries()); + Assertions.assertEquals(26271321, model.httpRetryPolicy().retryBackOff().initialDelayInMilliseconds()); + Assertions.assertEquals(1931491413, model.httpRetryPolicy().retryBackOff().maxIntervalInMilliseconds()); + Assertions.assertEquals(853559772, model.timeoutPolicy().responseTimeoutInSeconds()); + Assertions.assertEquals(1504624884, model.circuitBreakerPolicy().consecutiveErrors()); + Assertions.assertEquals(584934024, model.circuitBreakerPolicy().timeoutInSeconds()); + Assertions.assertEquals(1282256848, model.circuitBreakerPolicy().intervalInSeconds()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPolicyHttpRetryBackOffConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPolicyHttpRetryBackOffConfigurationTests.java new file mode 100644 index 000000000000..0dec9ccac15f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPolicyHttpRetryBackOffConfigurationTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration; +import org.junit.jupiter.api.Assertions; + +public final class DaprComponentResiliencyPolicyHttpRetryBackOffConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration model = BinaryData + .fromString("{\"initialDelayInMilliseconds\":114942799,\"maxIntervalInMilliseconds\":377958143}") + .toObject(DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.class); + Assertions.assertEquals(114942799, model.initialDelayInMilliseconds()); + Assertions.assertEquals(377958143, model.maxIntervalInMilliseconds()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration model + = new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration().withInitialDelayInMilliseconds(114942799) + .withMaxIntervalInMilliseconds(377958143); + model = BinaryData.fromObject(model).toObject(DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.class); + Assertions.assertEquals(114942799, model.initialDelayInMilliseconds()); + Assertions.assertEquals(377958143, model.maxIntervalInMilliseconds()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPolicyHttpRetryPolicyConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPolicyHttpRetryPolicyConfigurationTests.java new file mode 100644 index 000000000000..17faa7f4dac4 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPolicyHttpRetryPolicyConfigurationTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration; +import org.junit.jupiter.api.Assertions; + +public final class DaprComponentResiliencyPolicyHttpRetryPolicyConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration model = BinaryData.fromString( + "{\"maxRetries\":2121182024,\"retryBackOff\":{\"initialDelayInMilliseconds\":239575108,\"maxIntervalInMilliseconds\":1950570969}}") + .toObject(DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.class); + Assertions.assertEquals(2121182024, model.maxRetries()); + Assertions.assertEquals(239575108, model.retryBackOff().initialDelayInMilliseconds()); + Assertions.assertEquals(1950570969, model.retryBackOff().maxIntervalInMilliseconds()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration model + = new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration().withMaxRetries(2121182024) + .withRetryBackOff(new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() + .withInitialDelayInMilliseconds(239575108) + .withMaxIntervalInMilliseconds(1950570969)); + model = BinaryData.fromObject(model).toObject(DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.class); + Assertions.assertEquals(2121182024, model.maxRetries()); + Assertions.assertEquals(239575108, model.retryBackOff().initialDelayInMilliseconds()); + Assertions.assertEquals(1950570969, model.retryBackOff().maxIntervalInMilliseconds()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPolicyInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPolicyInnerTests.java new file mode 100644 index 000000000000..d6642efc2930 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPolicyInnerTests.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentResiliencyPolicyInner; +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; +import org.junit.jupiter.api.Assertions; + +public final class DaprComponentResiliencyPolicyInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DaprComponentResiliencyPolicyInner model = BinaryData.fromString( + "{\"properties\":{\"inboundPolicy\":{\"httpRetryPolicy\":{\"maxRetries\":1152619521,\"retryBackOff\":{\"initialDelayInMilliseconds\":1479987429,\"maxIntervalInMilliseconds\":1856138552}},\"timeoutPolicy\":{\"responseTimeoutInSeconds\":875433562},\"circuitBreakerPolicy\":{\"consecutiveErrors\":1164479404,\"timeoutInSeconds\":47746370,\"intervalInSeconds\":619944622}},\"outboundPolicy\":{\"httpRetryPolicy\":{\"maxRetries\":166425776,\"retryBackOff\":{\"initialDelayInMilliseconds\":87413829,\"maxIntervalInMilliseconds\":2055251936}},\"timeoutPolicy\":{\"responseTimeoutInSeconds\":219541303},\"circuitBreakerPolicy\":{\"consecutiveErrors\":164318585,\"timeoutInSeconds\":91959581,\"intervalInSeconds\":1409089319}}},\"id\":\"r\",\"name\":\"zizoyuely\",\"type\":\"tn\"}") + .toObject(DaprComponentResiliencyPolicyInner.class); + Assertions.assertEquals(1152619521, model.inboundPolicy().httpRetryPolicy().maxRetries()); + Assertions.assertEquals(1479987429, + model.inboundPolicy().httpRetryPolicy().retryBackOff().initialDelayInMilliseconds()); + Assertions.assertEquals(1856138552, + model.inboundPolicy().httpRetryPolicy().retryBackOff().maxIntervalInMilliseconds()); + Assertions.assertEquals(875433562, model.inboundPolicy().timeoutPolicy().responseTimeoutInSeconds()); + Assertions.assertEquals(1164479404, model.inboundPolicy().circuitBreakerPolicy().consecutiveErrors()); + Assertions.assertEquals(47746370, model.inboundPolicy().circuitBreakerPolicy().timeoutInSeconds()); + Assertions.assertEquals(619944622, model.inboundPolicy().circuitBreakerPolicy().intervalInSeconds()); + Assertions.assertEquals(166425776, model.outboundPolicy().httpRetryPolicy().maxRetries()); + Assertions.assertEquals(87413829, + model.outboundPolicy().httpRetryPolicy().retryBackOff().initialDelayInMilliseconds()); + Assertions.assertEquals(2055251936, + model.outboundPolicy().httpRetryPolicy().retryBackOff().maxIntervalInMilliseconds()); + Assertions.assertEquals(219541303, model.outboundPolicy().timeoutPolicy().responseTimeoutInSeconds()); + Assertions.assertEquals(164318585, model.outboundPolicy().circuitBreakerPolicy().consecutiveErrors()); + Assertions.assertEquals(91959581, model.outboundPolicy().circuitBreakerPolicy().timeoutInSeconds()); + Assertions.assertEquals(1409089319, model.outboundPolicy().circuitBreakerPolicy().intervalInSeconds()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DaprComponentResiliencyPolicyInner model = new DaprComponentResiliencyPolicyInner() + .withInboundPolicy(new DaprComponentResiliencyPolicyConfiguration() + .withHttpRetryPolicy( + new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration().withMaxRetries(1152619521) + .withRetryBackOff(new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() + .withInitialDelayInMilliseconds(1479987429) + .withMaxIntervalInMilliseconds(1856138552))) + .withTimeoutPolicy(new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration() + .withResponseTimeoutInSeconds(875433562)) + .withCircuitBreakerPolicy(new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration() + .withConsecutiveErrors(1164479404) + .withTimeoutInSeconds(47746370) + .withIntervalInSeconds(619944622))) + .withOutboundPolicy(new DaprComponentResiliencyPolicyConfiguration() + .withHttpRetryPolicy( + new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration().withMaxRetries(166425776) + .withRetryBackOff(new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() + .withInitialDelayInMilliseconds(87413829) + .withMaxIntervalInMilliseconds(2055251936))) + .withTimeoutPolicy(new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration() + .withResponseTimeoutInSeconds(219541303)) + .withCircuitBreakerPolicy(new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration() + .withConsecutiveErrors(164318585) + .withTimeoutInSeconds(91959581) + .withIntervalInSeconds(1409089319))); + model = BinaryData.fromObject(model).toObject(DaprComponentResiliencyPolicyInner.class); + Assertions.assertEquals(1152619521, model.inboundPolicy().httpRetryPolicy().maxRetries()); + Assertions.assertEquals(1479987429, + model.inboundPolicy().httpRetryPolicy().retryBackOff().initialDelayInMilliseconds()); + Assertions.assertEquals(1856138552, + model.inboundPolicy().httpRetryPolicy().retryBackOff().maxIntervalInMilliseconds()); + Assertions.assertEquals(875433562, model.inboundPolicy().timeoutPolicy().responseTimeoutInSeconds()); + Assertions.assertEquals(1164479404, model.inboundPolicy().circuitBreakerPolicy().consecutiveErrors()); + Assertions.assertEquals(47746370, model.inboundPolicy().circuitBreakerPolicy().timeoutInSeconds()); + Assertions.assertEquals(619944622, model.inboundPolicy().circuitBreakerPolicy().intervalInSeconds()); + Assertions.assertEquals(166425776, model.outboundPolicy().httpRetryPolicy().maxRetries()); + Assertions.assertEquals(87413829, + model.outboundPolicy().httpRetryPolicy().retryBackOff().initialDelayInMilliseconds()); + Assertions.assertEquals(2055251936, + model.outboundPolicy().httpRetryPolicy().retryBackOff().maxIntervalInMilliseconds()); + Assertions.assertEquals(219541303, model.outboundPolicy().timeoutPolicy().responseTimeoutInSeconds()); + Assertions.assertEquals(164318585, model.outboundPolicy().circuitBreakerPolicy().consecutiveErrors()); + Assertions.assertEquals(91959581, model.outboundPolicy().circuitBreakerPolicy().timeoutInSeconds()); + Assertions.assertEquals(1409089319, model.outboundPolicy().circuitBreakerPolicy().intervalInSeconds()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPolicyPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPolicyPropertiesTests.java new file mode 100644 index 000000000000..d1c9b9830b70 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPolicyPropertiesTests.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentResiliencyPolicyProperties; +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; +import org.junit.jupiter.api.Assertions; + +public final class DaprComponentResiliencyPolicyPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DaprComponentResiliencyPolicyProperties model = BinaryData.fromString( + "{\"inboundPolicy\":{\"httpRetryPolicy\":{\"maxRetries\":1979503095,\"retryBackOff\":{\"initialDelayInMilliseconds\":1479609341,\"maxIntervalInMilliseconds\":28298400}},\"timeoutPolicy\":{\"responseTimeoutInSeconds\":1188607782},\"circuitBreakerPolicy\":{\"consecutiveErrors\":1468230412,\"timeoutInSeconds\":1408591251,\"intervalInSeconds\":505064528}},\"outboundPolicy\":{\"httpRetryPolicy\":{\"maxRetries\":456211358,\"retryBackOff\":{\"initialDelayInMilliseconds\":121519716,\"maxIntervalInMilliseconds\":1007319834}},\"timeoutPolicy\":{\"responseTimeoutInSeconds\":374281034},\"circuitBreakerPolicy\":{\"consecutiveErrors\":190540230,\"timeoutInSeconds\":95734174,\"intervalInSeconds\":1977196134}}}") + .toObject(DaprComponentResiliencyPolicyProperties.class); + Assertions.assertEquals(1979503095, model.inboundPolicy().httpRetryPolicy().maxRetries()); + Assertions.assertEquals(1479609341, + model.inboundPolicy().httpRetryPolicy().retryBackOff().initialDelayInMilliseconds()); + Assertions.assertEquals(28298400, + model.inboundPolicy().httpRetryPolicy().retryBackOff().maxIntervalInMilliseconds()); + Assertions.assertEquals(1188607782, model.inboundPolicy().timeoutPolicy().responseTimeoutInSeconds()); + Assertions.assertEquals(1468230412, model.inboundPolicy().circuitBreakerPolicy().consecutiveErrors()); + Assertions.assertEquals(1408591251, model.inboundPolicy().circuitBreakerPolicy().timeoutInSeconds()); + Assertions.assertEquals(505064528, model.inboundPolicy().circuitBreakerPolicy().intervalInSeconds()); + Assertions.assertEquals(456211358, model.outboundPolicy().httpRetryPolicy().maxRetries()); + Assertions.assertEquals(121519716, + model.outboundPolicy().httpRetryPolicy().retryBackOff().initialDelayInMilliseconds()); + Assertions.assertEquals(1007319834, + model.outboundPolicy().httpRetryPolicy().retryBackOff().maxIntervalInMilliseconds()); + Assertions.assertEquals(374281034, model.outboundPolicy().timeoutPolicy().responseTimeoutInSeconds()); + Assertions.assertEquals(190540230, model.outboundPolicy().circuitBreakerPolicy().consecutiveErrors()); + Assertions.assertEquals(95734174, model.outboundPolicy().circuitBreakerPolicy().timeoutInSeconds()); + Assertions.assertEquals(1977196134, model.outboundPolicy().circuitBreakerPolicy().intervalInSeconds()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DaprComponentResiliencyPolicyProperties model = new DaprComponentResiliencyPolicyProperties() + .withInboundPolicy(new DaprComponentResiliencyPolicyConfiguration() + .withHttpRetryPolicy( + new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration().withMaxRetries(1979503095) + .withRetryBackOff(new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() + .withInitialDelayInMilliseconds(1479609341) + .withMaxIntervalInMilliseconds(28298400))) + .withTimeoutPolicy(new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration() + .withResponseTimeoutInSeconds(1188607782)) + .withCircuitBreakerPolicy(new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration() + .withConsecutiveErrors(1468230412) + .withTimeoutInSeconds(1408591251) + .withIntervalInSeconds(505064528))) + .withOutboundPolicy(new DaprComponentResiliencyPolicyConfiguration() + .withHttpRetryPolicy( + new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration().withMaxRetries(456211358) + .withRetryBackOff(new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() + .withInitialDelayInMilliseconds(121519716) + .withMaxIntervalInMilliseconds(1007319834))) + .withTimeoutPolicy(new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration() + .withResponseTimeoutInSeconds(374281034)) + .withCircuitBreakerPolicy(new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration() + .withConsecutiveErrors(190540230) + .withTimeoutInSeconds(95734174) + .withIntervalInSeconds(1977196134))); + model = BinaryData.fromObject(model).toObject(DaprComponentResiliencyPolicyProperties.class); + Assertions.assertEquals(1979503095, model.inboundPolicy().httpRetryPolicy().maxRetries()); + Assertions.assertEquals(1479609341, + model.inboundPolicy().httpRetryPolicy().retryBackOff().initialDelayInMilliseconds()); + Assertions.assertEquals(28298400, + model.inboundPolicy().httpRetryPolicy().retryBackOff().maxIntervalInMilliseconds()); + Assertions.assertEquals(1188607782, model.inboundPolicy().timeoutPolicy().responseTimeoutInSeconds()); + Assertions.assertEquals(1468230412, model.inboundPolicy().circuitBreakerPolicy().consecutiveErrors()); + Assertions.assertEquals(1408591251, model.inboundPolicy().circuitBreakerPolicy().timeoutInSeconds()); + Assertions.assertEquals(505064528, model.inboundPolicy().circuitBreakerPolicy().intervalInSeconds()); + Assertions.assertEquals(456211358, model.outboundPolicy().httpRetryPolicy().maxRetries()); + Assertions.assertEquals(121519716, + model.outboundPolicy().httpRetryPolicy().retryBackOff().initialDelayInMilliseconds()); + Assertions.assertEquals(1007319834, + model.outboundPolicy().httpRetryPolicy().retryBackOff().maxIntervalInMilliseconds()); + Assertions.assertEquals(374281034, model.outboundPolicy().timeoutPolicy().responseTimeoutInSeconds()); + Assertions.assertEquals(190540230, model.outboundPolicy().circuitBreakerPolicy().consecutiveErrors()); + Assertions.assertEquals(95734174, model.outboundPolicy().circuitBreakerPolicy().timeoutInSeconds()); + Assertions.assertEquals(1977196134, model.outboundPolicy().circuitBreakerPolicy().intervalInSeconds()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPolicyTimeoutPolicyConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPolicyTimeoutPolicyConfigurationTests.java new file mode 100644 index 000000000000..c8135dbd909b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentResiliencyPolicyTimeoutPolicyConfigurationTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration; +import org.junit.jupiter.api.Assertions; + +public final class DaprComponentResiliencyPolicyTimeoutPolicyConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DaprComponentResiliencyPolicyTimeoutPolicyConfiguration model + = BinaryData.fromString("{\"responseTimeoutInSeconds\":772955822}") + .toObject(DaprComponentResiliencyPolicyTimeoutPolicyConfiguration.class); + Assertions.assertEquals(772955822, model.responseTimeoutInSeconds()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DaprComponentResiliencyPolicyTimeoutPolicyConfiguration model + = new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration().withResponseTimeoutInSeconds(772955822); + model = BinaryData.fromObject(model).toObject(DaprComponentResiliencyPolicyTimeoutPolicyConfiguration.class); + Assertions.assertEquals(772955822, model.responseTimeoutInSeconds()); + } +} 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 index 379764d1d08e..15e6474b78b7 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -28,7 +28,7 @@ public void testDeleteWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.daprComponents() - .deleteWithResponse("bkut", "umltwjflu", "ynbpvzlqywauy", com.azure.core.util.Context.NONE); + .deleteWithResponse("vzgjyp", "nhxmpdxxze", "wwzjwotnxlkfhglh", 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 index 68ae02c9a8d1..a3d89f6a326b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -19,7 +19,8 @@ public final class DaprComponentsListSecretsWithResponseMockTests { @Test public void testListSecretsWithResponse() throws Exception { - String responseStr = "{\"value\":[{\"name\":\"wvixq\",\"value\":\"gljkybsj\"}]}"; + String responseStr + = "{\"value\":[{\"name\":\"ezacfpztga\",\"value\":\"yqejga\"},{\"name\":\"kctgkp\",\"value\":\"kqzkcyzmff\"},{\"name\":\"dyfcix\",\"value\":\"lcqvhoejgoiutgw\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -29,7 +30,7 @@ public void testListSecretsWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); DaprSecretsCollection response = manager.daprComponents() - .listSecretsWithResponse("njc", "hmocgjshg", "u", com.azure.core.util.Context.NONE) + .listSecretsWithResponse("wzlpzbtz", "ykykip", "sdyepfno", 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 index c1e0e4b5b97a..d0ab8c710a77 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -10,8 +10,7 @@ public final class DaprConfigurationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DaprConfiguration model - = BinaryData.fromString("{\"version\":\"zldmozuxy\"}").toObject(DaprConfiguration.class); + DaprConfiguration model = BinaryData.fromString("{\"version\":\"mikzeb\"}").toObject(DaprConfiguration.class); } @org.junit.jupiter.api.Test 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 index cdebada8c7b2..45c2bdf96e4e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,12 +11,6 @@ public final class DaprSecretTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DaprSecret model - = BinaryData.fromString("{\"name\":\"k\",\"value\":\"henbtkcxywnytn\"}").toObject(DaprSecret.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DaprSecret model = new DaprSecret(); - model = BinaryData.fromObject(model).toObject(DaprSecret.class); + = BinaryData.fromString("{\"name\":\"ousxauzlwvsgmw\",\"value\":\"qf\"}").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 index 68e5ba3eb337..55561635ef5e 100644 --- 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 @@ -1,26 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\":\"tqagnbuynh\",\"value\":\"gg\"},{\"name\":\"bfs\",\"value\":\"rbu\"},{\"name\":\"cvpnazzmhjrunmpx\",\"value\":\"dbhrbnlankxm\"}]}") + "{\"value\":[{\"name\":\"swokm\",\"value\":\"hl\"},{\"name\":\"dhbemzqkzszu\",\"value\":\"wtglxx\"},{\"name\":\"jfpgpicrmn\",\"value\":\"rgmqgjs\"},{\"name\":\"pqcbfrmbodthsq\",\"value\":\"vriibakclacjfr\"}]}") .toObject(DaprSecretsCollectionInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DaprSecretsCollectionInner model = new DaprSecretsCollectionInner() - .withValue(Arrays.asList(new DaprSecret(), 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 index a66ea8eff08e..9697e7e07221 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -15,54 +15,54 @@ public final class DaprTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Dapr model = BinaryData.fromString( - "{\"enabled\":true,\"appId\":\"fqjhhkxbpvjymj\",\"appProtocol\":\"grpc\",\"appPort\":1905459835,\"httpReadBufferSize\":1602354627,\"httpMaxRequestSize\":1547170393,\"logLevel\":\"info\",\"enableApiLogging\":false,\"appHealth\":{\"enabled\":true,\"path\":\"xqzvszjfa\",\"probeIntervalSeconds\":34322019,\"probeTimeoutMilliseconds\":1315854655,\"threshold\":1757404890},\"maxConcurrency\":1144825464}") + "{\"enabled\":false,\"appId\":\"ssotftpv\",\"appProtocol\":\"grpc\",\"appPort\":1814798864,\"httpReadBufferSize\":151747977,\"httpMaxRequestSize\":1391757407,\"logLevel\":\"error\",\"enableApiLogging\":false,\"appHealth\":{\"enabled\":false,\"path\":\"mqtaruoujmkcjh\",\"probeIntervalSeconds\":1420775781,\"probeTimeoutMilliseconds\":1656357002,\"threshold\":734102755},\"maxConcurrency\":151199466}") .toObject(Dapr.class); - Assertions.assertTrue(model.enabled()); - Assertions.assertEquals("fqjhhkxbpvjymj", model.appId()); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("ssotftpv", model.appId()); Assertions.assertEquals(AppProtocol.GRPC, model.appProtocol()); - Assertions.assertEquals(1905459835, model.appPort()); - Assertions.assertEquals(1602354627, model.httpReadBufferSize()); - Assertions.assertEquals(1547170393, model.httpMaxRequestSize()); - Assertions.assertEquals(LogLevel.INFO, model.logLevel()); + Assertions.assertEquals(1814798864, model.appPort()); + Assertions.assertEquals(151747977, model.httpReadBufferSize()); + Assertions.assertEquals(1391757407, model.httpMaxRequestSize()); + Assertions.assertEquals(LogLevel.ERROR, model.logLevel()); Assertions.assertFalse(model.enableApiLogging()); - Assertions.assertTrue(model.appHealth().enabled()); - Assertions.assertEquals("xqzvszjfa", model.appHealth().path()); - Assertions.assertEquals(34322019, model.appHealth().probeIntervalSeconds()); - Assertions.assertEquals(1315854655, model.appHealth().probeTimeoutMilliseconds()); - Assertions.assertEquals(1757404890, model.appHealth().threshold()); - Assertions.assertEquals(1144825464, model.maxConcurrency()); + Assertions.assertFalse(model.appHealth().enabled()); + Assertions.assertEquals("mqtaruoujmkcjh", model.appHealth().path()); + Assertions.assertEquals(1420775781, model.appHealth().probeIntervalSeconds()); + Assertions.assertEquals(1656357002, model.appHealth().probeTimeoutMilliseconds()); + Assertions.assertEquals(734102755, model.appHealth().threshold()); + Assertions.assertEquals(151199466, model.maxConcurrency()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Dapr model = new Dapr().withEnabled(true) - .withAppId("fqjhhkxbpvjymj") + Dapr model = new Dapr().withEnabled(false) + .withAppId("ssotftpv") .withAppProtocol(AppProtocol.GRPC) - .withAppPort(1905459835) - .withHttpReadBufferSize(1602354627) - .withHttpMaxRequestSize(1547170393) - .withLogLevel(LogLevel.INFO) + .withAppPort(1814798864) + .withHttpReadBufferSize(151747977) + .withHttpMaxRequestSize(1391757407) + .withLogLevel(LogLevel.ERROR) .withEnableApiLogging(false) - .withAppHealth(new DaprAppHealth().withEnabled(true) - .withPath("xqzvszjfa") - .withProbeIntervalSeconds(34322019) - .withProbeTimeoutMilliseconds(1315854655) - .withThreshold(1757404890)) - .withMaxConcurrency(1144825464); + .withAppHealth(new DaprAppHealth().withEnabled(false) + .withPath("mqtaruoujmkcjh") + .withProbeIntervalSeconds(1420775781) + .withProbeTimeoutMilliseconds(1656357002) + .withThreshold(734102755)) + .withMaxConcurrency(151199466); model = BinaryData.fromObject(model).toObject(Dapr.class); - Assertions.assertTrue(model.enabled()); - Assertions.assertEquals("fqjhhkxbpvjymj", model.appId()); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("ssotftpv", model.appId()); Assertions.assertEquals(AppProtocol.GRPC, model.appProtocol()); - Assertions.assertEquals(1905459835, model.appPort()); - Assertions.assertEquals(1602354627, model.httpReadBufferSize()); - Assertions.assertEquals(1547170393, model.httpMaxRequestSize()); - Assertions.assertEquals(LogLevel.INFO, model.logLevel()); + Assertions.assertEquals(1814798864, model.appPort()); + Assertions.assertEquals(151747977, model.httpReadBufferSize()); + Assertions.assertEquals(1391757407, model.httpMaxRequestSize()); + Assertions.assertEquals(LogLevel.ERROR, model.logLevel()); Assertions.assertFalse(model.enableApiLogging()); - Assertions.assertTrue(model.appHealth().enabled()); - Assertions.assertEquals("xqzvszjfa", model.appHealth().path()); - Assertions.assertEquals(34322019, model.appHealth().probeIntervalSeconds()); - Assertions.assertEquals(1315854655, model.appHealth().probeTimeoutMilliseconds()); - Assertions.assertEquals(1757404890, model.appHealth().threshold()); - Assertions.assertEquals(1144825464, model.maxConcurrency()); + Assertions.assertFalse(model.appHealth().enabled()); + Assertions.assertEquals("mqtaruoujmkcjh", model.appHealth().path()); + Assertions.assertEquals(1420775781, model.appHealth().probeIntervalSeconds()); + Assertions.assertEquals(1656357002, model.appHealth().probeTimeoutMilliseconds()); + Assertions.assertEquals(734102755, model.appHealth().threshold()); + Assertions.assertEquals(151199466, model.maxConcurrency()); } } 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 index 91cd0845fc0b..724390273dd8 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -14,23 +14,23 @@ 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\"]}") + "{\"allowedPrincipals\":{\"groups\":[\"dchxgsrboldfor\",\"bwjl\",\"izbfhfovvacq\",\"btuodxeszabbel\"],\"identities\":[\"muaslzkw\",\"rwoycqucwyh\",\"hnomdrkywuh\",\"svfuurutlwexxwl\"]},\"allowedApplications\":[\"iexzsrzpge\",\"q\",\"yb\",\"wwpgdakchzyvlixq\"]}") .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)); + Assertions.assertEquals("dchxgsrboldfor", model.allowedPrincipals().groups().get(0)); + Assertions.assertEquals("muaslzkw", model.allowedPrincipals().identities().get(0)); + Assertions.assertEquals("iexzsrzpge", 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")); + .withAllowedPrincipals(new AllowedPrincipals() + .withGroups(Arrays.asList("dchxgsrboldfor", "bwjl", "izbfhfovvacq", "btuodxeszabbel")) + .withIdentities(Arrays.asList("muaslzkw", "rwoycqucwyh", "hnomdrkywuh", "svfuurutlwexxwl"))) + .withAllowedApplications(Arrays.asList("iexzsrzpge", "q", "yb", "wwpgdakchzyvlixq")); 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)); + Assertions.assertEquals("dchxgsrboldfor", model.allowedPrincipals().groups().get(0)); + Assertions.assertEquals("muaslzkw", model.allowedPrincipals().identities().get(0)); + Assertions.assertEquals("iexzsrzpge", 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 index 55b8aa2eba21..e61479b3ab04 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,18 +12,9 @@ public final class DiagnosticDataProviderMetadataPropertyBagItemTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DiagnosticDataProviderMetadataPropertyBagItem model - = BinaryData.fromString("{\"name\":\"fkqojpy\",\"value\":\"gtrd\"}") + = BinaryData.fromString("{\"name\":\"awz\",\"value\":\"brttuiacl\"}") .toObject(DiagnosticDataProviderMetadataPropertyBagItem.class); - Assertions.assertEquals("fkqojpy", model.name()); - Assertions.assertEquals("gtrd", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticDataProviderMetadataPropertyBagItem model - = new DiagnosticDataProviderMetadataPropertyBagItem().withName("fkqojpy").withValue("gtrd"); - model = BinaryData.fromObject(model).toObject(DiagnosticDataProviderMetadataPropertyBagItem.class); - Assertions.assertEquals("fkqojpy", model.name()); - Assertions.assertEquals("gtrd", model.value()); + Assertions.assertEquals("awz", model.name()); + Assertions.assertEquals("brttuiacl", 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 index 9f5c8d917a9d..3a7a0d343616 100644 --- 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 @@ -1,36 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\":\"fybvpoek\",\"propertyBag\":[{\"name\":\"gbdhuzqgnjdg\",\"value\":\"nscliqhzvhxnk\"},{\"name\":\"tkubotppn\",\"value\":\"xz\"},{\"name\":\"ihfrbbcevqa\",\"value\":\"ltd\"}]}") + "{\"providerName\":\"i\",\"propertyBag\":[{\"name\":\"wvqsgny\",\"value\":\"uzivensrpmeyyvp\"},{\"name\":\"atlb\",\"value\":\"pzgsk\"},{\"name\":\"fhfv\",\"value\":\"mknbnxwcdommpv\"}]}") .toObject(DiagnosticDataProviderMetadata.class); - Assertions.assertEquals("fybvpoek", model.providerName()); - Assertions.assertEquals("gbdhuzqgnjdg", model.propertyBag().get(0).name()); - Assertions.assertEquals("nscliqhzvhxnk", model.propertyBag().get(0).value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticDataProviderMetadata model = new DiagnosticDataProviderMetadata().withProviderName("fybvpoek") - .withPropertyBag(Arrays.asList( - new DiagnosticDataProviderMetadataPropertyBagItem().withName("gbdhuzqgnjdg").withValue("nscliqhzvhxnk"), - new DiagnosticDataProviderMetadataPropertyBagItem().withName("tkubotppn").withValue("xz"), - new DiagnosticDataProviderMetadataPropertyBagItem().withName("ihfrbbcevqa").withValue("ltd"))); - model = BinaryData.fromObject(model).toObject(DiagnosticDataProviderMetadata.class); - Assertions.assertEquals("fybvpoek", model.providerName()); - Assertions.assertEquals("gbdhuzqgnjdg", model.propertyBag().get(0).name()); - Assertions.assertEquals("nscliqhzvhxnk", model.propertyBag().get(0).value()); + Assertions.assertEquals("i", model.providerName()); + Assertions.assertEquals("wvqsgny", model.propertyBag().get(0).name()); + Assertions.assertEquals("uzivensrpmeyyvp", 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 index c5e0f1e6e5f2..c872955c7d2e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,22 +11,11 @@ public final class DiagnosticDataTableResponseColumnTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DiagnosticDataTableResponseColumn model = BinaryData - .fromString("{\"columnName\":\"mdy\",\"dataType\":\"dwdigumb\",\"columnType\":\"aauzzptjazysd\"}") - .toObject(DiagnosticDataTableResponseColumn.class); - Assertions.assertEquals("mdy", model.columnName()); - Assertions.assertEquals("dwdigumb", model.dataType()); - Assertions.assertEquals("aauzzptjazysd", model.columnType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticDataTableResponseColumn model = new DiagnosticDataTableResponseColumn().withColumnName("mdy") - .withDataType("dwdigumb") - .withColumnType("aauzzptjazysd"); - model = BinaryData.fromObject(model).toObject(DiagnosticDataTableResponseColumn.class); - Assertions.assertEquals("mdy", model.columnName()); - Assertions.assertEquals("dwdigumb", model.dataType()); - Assertions.assertEquals("aauzzptjazysd", model.columnType()); + DiagnosticDataTableResponseColumn model + = BinaryData.fromString("{\"columnName\":\"uczkgofxyfsruc\",\"dataType\":\"rrp\",\"columnType\":\"ttbst\"}") + .toObject(DiagnosticDataTableResponseColumn.class); + Assertions.assertEquals("uczkgofxyfsruc", model.columnName()); + Assertions.assertEquals("rrp", model.dataType()); + Assertions.assertEquals("ttbst", 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 index ecc83162bd50..380947c573b4 100644 --- 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 @@ -1,46 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\":\"uztcktyhjtqed\",\"columns\":[{\"columnName\":\"lwmmrqzzrrjv\",\"dataType\":\"lydzgk\",\"columnType\":\"qeevt\"},{\"columnName\":\"pryu\",\"dataType\":\"wytpzdmovz\",\"columnType\":\"va\"},{\"columnName\":\"zqadf\",\"dataType\":\"z\",\"columnType\":\"iglaecx\"},{\"columnName\":\"t\",\"dataType\":\"okpvzm\",\"columnType\":\"t\"}],\"rows\":[\"datagxobfirclnp\",\"dataciayzriykhya\",\"datafvjlboxqvkjlmx\"]}") + "{\"tableName\":\"py\",\"columns\":[{\"columnName\":\"meblyd\",\"dataType\":\"kfkmrocxnehvsmt\",\"columnType\":\"lfpya\"},{\"columnName\":\"cygvoavyunssx\",\"dataType\":\"hi\",\"columnType\":\"gjlgvvpase\"},{\"columnName\":\"gbuxantuygdh\",\"dataType\":\"qipir\",\"columnType\":\"wrq\"},{\"columnName\":\"ulopmjnlexwhcb\",\"dataType\":\"ibkeph\",\"columnType\":\"uerct\"}],\"rows\":[\"\\\"datayintqpbrlcy\\\"\"]}") .toObject(DiagnosticDataTableResponseObject.class); - Assertions.assertEquals("uztcktyhjtqed", model.tableName()); - Assertions.assertEquals("lwmmrqzzrrjv", model.columns().get(0).columnName()); - Assertions.assertEquals("lydzgk", model.columns().get(0).dataType()); - Assertions.assertEquals("qeevt", model.columns().get(0).columnType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticDataTableResponseObject model = new DiagnosticDataTableResponseObject().withTableName("uztcktyhjtqed") - .withColumns(Arrays.asList( - new DiagnosticDataTableResponseColumn().withColumnName("lwmmrqzzrrjv") - .withDataType("lydzgk") - .withColumnType("qeevt"), - new DiagnosticDataTableResponseColumn().withColumnName("pryu") - .withDataType("wytpzdmovz") - .withColumnType("va"), - new DiagnosticDataTableResponseColumn().withColumnName("zqadf") - .withDataType("z") - .withColumnType("iglaecx"), - new DiagnosticDataTableResponseColumn().withColumnName("t").withDataType("okpvzm").withColumnType("t"))) - .withRows(Arrays.asList("datagxobfirclnp", "dataciayzriykhya", "datafvjlboxqvkjlmx")); - model = BinaryData.fromObject(model).toObject(DiagnosticDataTableResponseObject.class); - Assertions.assertEquals("uztcktyhjtqed", model.tableName()); - Assertions.assertEquals("lwmmrqzzrrjv", model.columns().get(0).columnName()); - Assertions.assertEquals("lydzgk", model.columns().get(0).dataType()); - Assertions.assertEquals("qeevt", model.columns().get(0).columnType()); + Assertions.assertEquals("py", model.tableName()); + Assertions.assertEquals("meblyd", model.columns().get(0).columnName()); + Assertions.assertEquals("kfkmrocxnehvsmt", model.columns().get(0).dataType()); + Assertions.assertEquals("lfpya", 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 index aa32a7781cb1..1f6cc65da221 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -13,24 +13,11 @@ public final class DiagnosticRenderingTests { public void testDeserialize() throws Exception { DiagnosticRendering model = BinaryData .fromString( - "{\"type\":1077210175,\"title\":\"wwvaiqyuvvfonk\",\"description\":\"hqyikvy\",\"isVisible\":false}") + "{\"type\":1225696727,\"title\":\"qnrmvvfko\",\"description\":\"lghktuidvrm\",\"isVisible\":true}") .toObject(DiagnosticRendering.class); - Assertions.assertEquals(1077210175, model.type()); - Assertions.assertEquals("wwvaiqyuvvfonk", model.title()); - Assertions.assertEquals("hqyikvy", model.description()); - Assertions.assertFalse(model.isVisible()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticRendering model = new DiagnosticRendering().withType(1077210175) - .withTitle("wwvaiqyuvvfonk") - .withDescription("hqyikvy") - .withIsVisible(false); - model = BinaryData.fromObject(model).toObject(DiagnosticRendering.class); - Assertions.assertEquals(1077210175, model.type()); - Assertions.assertEquals("wwvaiqyuvvfonk", model.title()); - Assertions.assertEquals("hqyikvy", model.description()); - Assertions.assertFalse(model.isVisible()); + Assertions.assertEquals(1225696727, model.type()); + Assertions.assertEquals("qnrmvvfko", model.title()); + Assertions.assertEquals("lghktuidvrm", model.description()); + Assertions.assertTrue(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 index 93fd8d190cac..d7461299da31 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -10,13 +10,8 @@ public final class DiagnosticSupportTopicTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DiagnosticSupportTopic model = BinaryData.fromString("{\"id\":\"fuajly\",\"pesId\":\"lvofqzhvfcibyfmo\"}") - .toObject(DiagnosticSupportTopic.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticSupportTopic model = new DiagnosticSupportTopic(); - model = BinaryData.fromObject(model).toObject(DiagnosticSupportTopic.class); + DiagnosticSupportTopic model + = BinaryData.fromString("{\"id\":\"rttzrazisgykiu\",\"pesId\":\"vanbwzohmnrxxbs\"}") + .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 index e9f27d683c04..b470d5454dda 100644 --- 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 @@ -1,115 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.DiagnosticSupportTopic; -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 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\":\"sttp\",\"name\":\"w\",\"description\":\"bnujrywvtylbf\",\"author\":\"curdoiwiitht\",\"category\":\"ubxcbihw\",\"supportTopicList\":[{}],\"analysisTypes\":[\"ntwjch\",\"dgoihxumwctondzj\",\"uu\"],\"type\":\"dlwggytsbwtovv\",\"score\":50.2365},\"dataset\":[{\"table\":{},\"renderingProperties\":{}},{\"table\":{},\"renderingProperties\":{}},{\"table\":{},\"renderingProperties\":{}},{\"table\":{},\"renderingProperties\":{}}],\"status\":{\"message\":\"pirgnepttwq\",\"statusId\":880287317},\"dataProviderMetadata\":{\"providerName\":\"fcdmqnrojlpijn\",\"propertyBag\":[{},{}]}},\"id\":\"rddh\",\"name\":\"ratiz\",\"type\":\"ronasxift\"},{\"properties\":{\"metadata\":{\"id\":\"zh\",\"name\":\"wesgogczh\",\"description\":\"nxkrlgnyhmossxkk\",\"author\":\"h\",\"category\":\"gh\",\"supportTopicList\":[{},{},{}],\"analysisTypes\":[\"qxvcxgfrpdsofb\",\"hrnsvbu\",\"wdvzyy\",\"ycnunvjsrtk\"],\"type\":\"wnopqgikyzirtx\",\"score\":62.656082},\"dataset\":[{\"table\":{},\"renderingProperties\":{}},{\"table\":{},\"renderingProperties\":{}}],\"status\":{\"message\":\"ewgioilqukrydxt\",\"statusId\":2118513593},\"dataProviderMetadata\":{\"providerName\":\"xorgg\",\"propertyBag\":[{},{},{},{}]}},\"id\":\"aomtbghhavgrvkff\",\"name\":\"vjzhpjbib\",\"type\":\"jmfxumvf\"},{\"properties\":{\"metadata\":{\"id\":\"ovwxnbkfezzxsc\",\"name\":\"wzdgirujbzbo\",\"description\":\"zzbtdcqvpniyujvi\",\"author\":\"wdsh\",\"category\":\"snrbgyefrymsgao\",\"supportTopicList\":[{}],\"analysisTypes\":[\"cotmr\"],\"type\":\"irctymoxoftpipiw\",\"score\":20.498825},\"dataset\":[{\"table\":{},\"renderingProperties\":{}},{\"table\":{},\"renderingProperties\":{}},{\"table\":{},\"renderingProperties\":{}},{\"table\":{},\"renderingProperties\":{}}],\"status\":{\"message\":\"yuspskas\",\"statusId\":2119274239},\"dataProviderMetadata\":{\"providerName\":\"wdgzxulucv\",\"propertyBag\":[{},{},{},{}]}},\"id\":\"sreuzvxurisjnh\",\"name\":\"ytxifqjzgxmrh\",\"type\":\"blwpcesutrgj\"},{\"properties\":{\"metadata\":{\"id\":\"utpwoqhihejqgw\",\"name\":\"nfqn\",\"description\":\"ypsxjvfoim\",\"author\":\"slirciz\",\"category\":\"vydfceacvlhvygdy\",\"supportTopicList\":[{},{},{}],\"analysisTypes\":[\"twnawjslbiwkojgc\",\"ztsfmznbaeqp\",\"chqnrnrpxehuwry\"],\"type\":\"gaifmvik\",\"score\":15.228063},\"dataset\":[{\"table\":{},\"renderingProperties\":{}},{\"table\":{},\"renderingProperties\":{}},{\"table\":{},\"renderingProperties\":{}}],\"status\":{\"message\":\"xcv\",\"statusId\":929609340},\"dataProviderMetadata\":{\"providerName\":\"jivolvtnov\",\"propertyBag\":[{},{},{},{}]}},\"id\":\"emjdftul\",\"name\":\"ltducea\",\"type\":\"tmczuomejwcwwqi\"}],\"nextLink\":\"nssxmojmsvpk\"}") + "{\"value\":[{\"properties\":{\"metadata\":{\"id\":\"cxnmskwhqjjyslu\",\"name\":\"pshhkvpedwqslsr\",\"description\":\"pq\",\"author\":\"wskondcbrwimuvqe\",\"category\":\"so\",\"supportTopicList\":[{},{},{}],\"analysisTypes\":[\"eaesin\",\"qtljqobbpihehc\"],\"type\":\"ybmrqbrjbbmp\",\"score\":46.628986},\"dataset\":[{\"table\":{},\"renderingProperties\":{}}],\"status\":{\"message\":\"xcrseqwjksgh\",\"statusId\":1525561603},\"dataProviderMetadata\":{\"providerName\":\"xog\",\"propertyBag\":[{}]}},\"id\":\"voujkxibdafhrk\",\"name\":\"dyomkxfbv\",\"type\":\"bhdyir\"},{\"properties\":{\"metadata\":{\"id\":\"gddeimaw\",\"name\":\"vgkk\",\"description\":\"ui\",\"author\":\"cjc\",\"category\":\"tbw\",\"supportTopicList\":[{},{}],\"analysisTypes\":[\"wxwcomli\",\"ytwvczcswkacve\",\"yfdvlvhbwrnfxtgd\"],\"type\":\"qthe\",\"score\":29.474365},\"dataset\":[{\"table\":{},\"renderingProperties\":{}},{\"table\":{},\"renderingProperties\":{}},{\"table\":{},\"renderingProperties\":{}},{\"table\":{},\"renderingProperties\":{}}],\"status\":{\"message\":\"wankltytmhdroznn\",\"statusId\":673142894},\"dataProviderMetadata\":{\"providerName\":\"tgjcsgguxheml\",\"propertyBag\":[{},{},{}]}},\"id\":\"eeczgfbu\",\"name\":\"klelssxb\",\"type\":\"ycsxzu\"}],\"nextLink\":\"srlsmd\"}") .toObject(DiagnosticsCollectionInner.class); - Assertions.assertEquals("ntwjch", model.value().get(0).properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("pirgnepttwq", model.value().get(0).properties().status().message()); - Assertions.assertEquals(880287317, model.value().get(0).properties().status().statusId()); - Assertions.assertEquals("fcdmqnrojlpijn", - 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("ntwjch", "dgoihxumwctondzj", "uu"))) - .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("pirgnepttwq").withStatusId(880287317)) - .withDataProviderMetadata(new DiagnosticDataProviderMetadata().withProviderName("fcdmqnrojlpijn") - .withPropertyBag(Arrays.asList(new DiagnosticDataProviderMetadataPropertyBagItem(), - new DiagnosticDataProviderMetadataPropertyBagItem())))), - new DiagnosticsInner().withProperties(new DiagnosticsProperties() - .withMetadata(new DiagnosticsDefinition() - .withSupportTopicList(Arrays.asList(new DiagnosticSupportTopic(), new DiagnosticSupportTopic(), - new DiagnosticSupportTopic())) - .withAnalysisTypes(Arrays.asList("qxvcxgfrpdsofb", "hrnsvbu", "wdvzyy", "ycnunvjsrtk"))) - .withDataset(Arrays.asList( - new DiagnosticsDataApiResponse().withTable(new DiagnosticDataTableResponseObject()) - .withRenderingProperties(new DiagnosticRendering()), - new DiagnosticsDataApiResponse().withTable(new DiagnosticDataTableResponseObject()) - .withRenderingProperties(new DiagnosticRendering()))) - .withStatus(new DiagnosticsStatus().withMessage("ewgioilqukrydxt").withStatusId(2118513593)) - .withDataProviderMetadata(new DiagnosticDataProviderMetadata().withProviderName("xorgg") - .withPropertyBag(Arrays.asList(new DiagnosticDataProviderMetadataPropertyBagItem(), - new DiagnosticDataProviderMetadataPropertyBagItem(), - new DiagnosticDataProviderMetadataPropertyBagItem(), - new DiagnosticDataProviderMetadataPropertyBagItem())))), - new DiagnosticsInner().withProperties(new DiagnosticsProperties() - .withMetadata( - new DiagnosticsDefinition().withSupportTopicList(Arrays.asList(new DiagnosticSupportTopic())) - .withAnalysisTypes(Arrays.asList("cotmr"))) - .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("yuspskas").withStatusId(2119274239)) - .withDataProviderMetadata(new DiagnosticDataProviderMetadata().withProviderName("wdgzxulucv") - .withPropertyBag(Arrays.asList(new DiagnosticDataProviderMetadataPropertyBagItem(), - new DiagnosticDataProviderMetadataPropertyBagItem(), - new DiagnosticDataProviderMetadataPropertyBagItem(), - new DiagnosticDataProviderMetadataPropertyBagItem())))), - new DiagnosticsInner().withProperties(new DiagnosticsProperties() - .withMetadata(new DiagnosticsDefinition() - .withSupportTopicList(Arrays.asList(new DiagnosticSupportTopic(), new DiagnosticSupportTopic(), - new DiagnosticSupportTopic())) - .withAnalysisTypes(Arrays.asList("twnawjslbiwkojgc", "ztsfmznbaeqp", "chqnrnrpxehuwry"))) - .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()))) - .withStatus(new DiagnosticsStatus().withMessage("xcv").withStatusId(929609340)) - .withDataProviderMetadata(new DiagnosticDataProviderMetadata().withProviderName("jivolvtnov") - .withPropertyBag(Arrays.asList(new DiagnosticDataProviderMetadataPropertyBagItem(), - new DiagnosticDataProviderMetadataPropertyBagItem(), - new DiagnosticDataProviderMetadataPropertyBagItem(), - new DiagnosticDataProviderMetadataPropertyBagItem())))))); - model = BinaryData.fromObject(model).toObject(DiagnosticsCollectionInner.class); - Assertions.assertEquals("ntwjch", model.value().get(0).properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("pirgnepttwq", model.value().get(0).properties().status().message()); - Assertions.assertEquals(880287317, model.value().get(0).properties().status().statusId()); - Assertions.assertEquals("fcdmqnrojlpijn", - model.value().get(0).properties().dataProviderMetadata().providerName()); + Assertions.assertEquals("eaesin", model.value().get(0).properties().metadata().analysisTypes().get(0)); + Assertions.assertEquals("xcrseqwjksgh", model.value().get(0).properties().status().message()); + Assertions.assertEquals(1525561603, model.value().get(0).properties().status().statusId()); + Assertions.assertEquals("xog", model.value().get(0).properties().dataProviderMetadata().providerName()); + Assertions.assertEquals("srlsmd", model.nextLink()); } } 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 index 6f1a756c6a53..218856029862 100644 --- 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 @@ -1,53 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\":\"rkjpvdwxfzwii\",\"columns\":[{\"columnName\":\"bhyzsxjr\",\"dataType\":\"mbtrnegvmnvu\",\"columnType\":\"qvldspastjbkkd\"}],\"rows\":[\"datavestmjl\"]},\"renderingProperties\":{\"type\":1811256055,\"title\":\"ozapeew\",\"description\":\"pxlktwkuziycsl\",\"isVisible\":true}}") + "{\"table\":{\"tableName\":\"linhmdptysprqs\",\"columns\":[{\"columnName\":\"ojpslsvjgpliufi\",\"dataType\":\"oyxqvapcohhou\",\"columnType\":\"pqojxcx\"},{\"columnName\":\"zdcgdzbenr\",\"dataType\":\"cawetzqddt\",\"columnType\":\"fljhznamtua\"},{\"columnName\":\"zwcjjncqtj\",\"dataType\":\"izvg\",\"columnType\":\"atzuuv\"}],\"rows\":[\"\\\"datagrebwggahttzlsw\\\"\",\"\\\"dataajqfutlx\\\"\"]},\"renderingProperties\":{\"type\":1442149444,\"title\":\"sunwqrjzfrgqhaoh\",\"description\":\"buocnjr\",\"isVisible\":true}}") .toObject(DiagnosticsDataApiResponse.class); - Assertions.assertEquals("rkjpvdwxfzwii", model.table().tableName()); - Assertions.assertEquals("bhyzsxjr", model.table().columns().get(0).columnName()); - Assertions.assertEquals("mbtrnegvmnvu", model.table().columns().get(0).dataType()); - Assertions.assertEquals("qvldspastjbkkd", model.table().columns().get(0).columnType()); - Assertions.assertEquals(1811256055, model.renderingProperties().type()); - Assertions.assertEquals("ozapeew", model.renderingProperties().title()); - Assertions.assertEquals("pxlktwkuziycsl", model.renderingProperties().description()); - Assertions.assertTrue(model.renderingProperties().isVisible()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticsDataApiResponse model = new DiagnosticsDataApiResponse() - .withTable(new DiagnosticDataTableResponseObject().withTableName("rkjpvdwxfzwii") - .withColumns(Arrays.asList(new DiagnosticDataTableResponseColumn().withColumnName("bhyzsxjr") - .withDataType("mbtrnegvmnvu") - .withColumnType("qvldspastjbkkd"))) - .withRows(Arrays.asList("datavestmjl"))) - .withRenderingProperties(new DiagnosticRendering().withType(1811256055) - .withTitle("ozapeew") - .withDescription("pxlktwkuziycsl") - .withIsVisible(true)); - model = BinaryData.fromObject(model).toObject(DiagnosticsDataApiResponse.class); - Assertions.assertEquals("rkjpvdwxfzwii", model.table().tableName()); - Assertions.assertEquals("bhyzsxjr", model.table().columns().get(0).columnName()); - Assertions.assertEquals("mbtrnegvmnvu", model.table().columns().get(0).dataType()); - Assertions.assertEquals("qvldspastjbkkd", model.table().columns().get(0).columnType()); - Assertions.assertEquals(1811256055, model.renderingProperties().type()); - Assertions.assertEquals("ozapeew", model.renderingProperties().title()); - Assertions.assertEquals("pxlktwkuziycsl", model.renderingProperties().description()); + Assertions.assertEquals("linhmdptysprqs", model.table().tableName()); + Assertions.assertEquals("ojpslsvjgpliufi", model.table().columns().get(0).columnName()); + Assertions.assertEquals("oyxqvapcohhou", model.table().columns().get(0).dataType()); + Assertions.assertEquals("pqojxcx", model.table().columns().get(0).columnType()); + Assertions.assertEquals(1442149444, model.renderingProperties().type()); + Assertions.assertEquals("sunwqrjzfrgqhaoh", model.renderingProperties().title()); + Assertions.assertEquals("buocnjr", model.renderingProperties().description()); Assertions.assertTrue(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 index 1ddaec5cac88..d997210c0fed 100644 --- 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 @@ -1,31 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DiagnosticSupportTopic; import com.azure.resourcemanager.appcontainers.models.DiagnosticsDefinition; -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\":\"fnczdwvvbalx\",\"name\":\"lchpodbzevwrdn\",\"description\":\"ukuv\",\"author\":\"cswsmystul\",\"category\":\"ypfcvlerchpqbmf\",\"supportTopicList\":[{\"id\":\"bwidfcxsspuunn\",\"pesId\":\"yhkx\"},{\"id\":\"ddrihpf\",\"pesId\":\"qcaaewdaomdjvl\"},{\"id\":\"x\",\"pesId\":\"zb\"}],\"analysisTypes\":[\"geivsiykzkdncj\",\"xonbzoggculapz\"],\"type\":\"rpgogtqxep\",\"score\":23.087067}") + "{\"id\":\"dhqoawj\",\"name\":\"yueayfbpcmsp\",\"description\":\"yrrueqth\",\"author\":\"gnmbscbbxigdhx\",\"category\":\"d\",\"supportTopicList\":[{\"id\":\"dbwdpyqyybxubmdn\",\"pesId\":\"cbq\"},{\"id\":\"e\",\"pesId\":\"ela\"},{\"id\":\"cigeleohdbvqvw\",\"pesId\":\"jopwbeonrlkwz\"}],\"analysisTypes\":[\"bxcea\"],\"type\":\"cptsoqfyiase\",\"score\":63.184704}") .toObject(DiagnosticsDefinition.class); - Assertions.assertEquals("geivsiykzkdncj", model.analysisTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticsDefinition model = new DiagnosticsDefinition() - .withSupportTopicList( - Arrays.asList(new DiagnosticSupportTopic(), new DiagnosticSupportTopic(), new DiagnosticSupportTopic())) - .withAnalysisTypes(Arrays.asList("geivsiykzkdncj", "xonbzoggculapz")); - model = BinaryData.fromObject(model).toObject(DiagnosticsDefinition.class); - Assertions.assertEquals("geivsiykzkdncj", model.analysisTypes().get(0)); + Assertions.assertEquals("bxcea", 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 index 03487f30cacf..23ddd1ea2154 100644 --- 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 @@ -1,108 +1,30 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.DiagnosticSupportTopic; -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 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\":\"kwcf\",\"name\":\"ljyxgtczhe\",\"description\":\"bsdshmkxmaehvbbx\",\"author\":\"iplt\",\"category\":\"htba\",\"supportTopicList\":[{\"id\":\"ywrckp\",\"pesId\":\"lyhpluodpvruud\"}],\"analysisTypes\":[\"ibthostgktstvd\"],\"type\":\"clzedqbcvh\",\"score\":1.2831509},\"dataset\":[{\"table\":{\"tableName\":\"qkdlw\",\"columns\":[{},{}],\"rows\":[\"datamlkxtrqjfs\"]},\"renderingProperties\":{\"type\":539417397,\"title\":\"xhwgfwsrtaw\",\"description\":\"ezbrhubskh\",\"isVisible\":false}},{\"table\":{\"tableName\":\"ookk\",\"columns\":[{},{},{}],\"rows\":[\"datavleo\",\"datafmluiqtqzfavyvn\",\"dataqybaryeua\",\"datajkqa\"]},\"renderingProperties\":{\"type\":616874585,\"title\":\"lesjcbhe\",\"description\":\"ntiew\",\"isVisible\":false}},{\"table\":{\"tableName\":\"quwrbehwag\",\"columns\":[{},{},{},{}],\"rows\":[\"datafkmr\"]},\"renderingProperties\":{\"type\":226189444,\"title\":\"hmxtdr\",\"description\":\"utacoe\",\"isVisible\":false}},{\"table\":{\"tableName\":\"zcjznmwcpmgua\",\"columns\":[{},{},{},{}],\"rows\":[\"datafactka\",\"datazov\"]},\"renderingProperties\":{\"type\":753608642,\"title\":\"uxxpshne\",\"description\":\"ulfgslqu\",\"isVisible\":true}}],\"status\":{\"message\":\"enr\",\"statusId\":1559984904},\"dataProviderMetadata\":{\"providerName\":\"jbazpjuohminy\",\"propertyBag\":[{\"name\":\"rwm\",\"value\":\"vwpklvxwmygdxp\"},{\"name\":\"qchiszep\",\"value\":\"bjcrxgibbdaxco\"},{\"name\":\"ozauorsukokwb\",\"value\":\"lhlv\"},{\"name\":\"uepzl\",\"value\":\"hw\"}]}},\"id\":\"oldweyuqdu\",\"name\":\"vmnnrw\",\"type\":\"biorktal\"}") + "{\"properties\":{\"metadata\":{\"id\":\"lpvmjcdoewbidy\",\"name\":\"eowxvgpi\",\"description\":\"eu\",\"author\":\"sxze\",\"category\":\"axwk\",\"supportTopicList\":[{\"id\":\"h\",\"pesId\":\"hxepmrutzna\"}],\"analysisTypes\":[\"bnslujdjltym\"],\"type\":\"vguihywar\",\"score\":72.75749},\"dataset\":[{\"table\":{\"tableName\":\"xkykxdssjp\",\"columns\":[{},{},{}],\"rows\":[\"\\\"datafxhikkflrmymyi\\\"\",\"\\\"datacqlh\\\"\",\"\\\"dataisws\\\"\"]},\"renderingProperties\":{\"type\":521413145,\"title\":\"ovgqcgxuugqkctot\",\"description\":\"wlxte\",\"isVisible\":false}},{\"table\":{\"tableName\":\"gwdtgukran\",\"columns\":[{},{},{},{}],\"rows\":[\"\\\"dataqlkccuzgygqwaho\\\"\",\"\\\"dataulwgniiprglvawuw\\\"\",\"\\\"datad\\\"\",\"\\\"datafypiv\\\"\"]},\"renderingProperties\":{\"type\":1898131355,\"title\":\"pmcubkmifoxxkub\",\"description\":\"havpmhbrbqgvg\",\"isVisible\":true}},{\"table\":{\"tableName\":\"ttefjoknssq\",\"columns\":[{},{},{}],\"rows\":[\"\\\"dataik\\\"\",\"\\\"datafrdbiqmrjgeihf\\\"\",\"\\\"datalg\\\"\"]},\"renderingProperties\":{\"type\":1124077019,\"title\":\"zcxmjpbyep\",\"description\":\"gt\",\"isVisible\":false}}],\"status\":{\"message\":\"cmyfqipgxhnpo\",\"statusId\":143132468},\"dataProviderMetadata\":{\"providerName\":\"abvn\",\"propertyBag\":[{\"name\":\"ey\",\"value\":\"wlpaugmrmfjlrxwt\"},{\"name\":\"ukhfkvc\",\"value\":\"izmoaeds\"}]}},\"id\":\"wuived\",\"name\":\"cgyee\",\"type\":\"xeiqbpsmg\"}") .toObject(DiagnosticsInner.class); - Assertions.assertEquals("ibthostgktstvd", model.properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("qkdlw", model.properties().dataset().get(0).table().tableName()); - Assertions.assertEquals(539417397, model.properties().dataset().get(0).renderingProperties().type()); - Assertions.assertEquals("xhwgfwsrtaw", model.properties().dataset().get(0).renderingProperties().title()); - Assertions.assertEquals("ezbrhubskh", model.properties().dataset().get(0).renderingProperties().description()); + Assertions.assertEquals("bnslujdjltym", model.properties().metadata().analysisTypes().get(0)); + Assertions.assertEquals("xkykxdssjp", model.properties().dataset().get(0).table().tableName()); + Assertions.assertEquals(521413145, model.properties().dataset().get(0).renderingProperties().type()); + Assertions.assertEquals("ovgqcgxuugqkctot", model.properties().dataset().get(0).renderingProperties().title()); + Assertions.assertEquals("wlxte", model.properties().dataset().get(0).renderingProperties().description()); Assertions.assertFalse(model.properties().dataset().get(0).renderingProperties().isVisible()); - Assertions.assertEquals("enr", model.properties().status().message()); - Assertions.assertEquals(1559984904, model.properties().status().statusId()); - Assertions.assertEquals("jbazpjuohminy", model.properties().dataProviderMetadata().providerName()); - Assertions.assertEquals("rwm", model.properties().dataProviderMetadata().propertyBag().get(0).name()); - Assertions.assertEquals("vwpklvxwmygdxp", - 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())) - .withAnalysisTypes(Arrays.asList("ibthostgktstvd"))) - .withDataset(Arrays.asList( - new DiagnosticsDataApiResponse() - .withTable(new DiagnosticDataTableResponseObject().withTableName("qkdlw") - .withColumns(Arrays.asList(new DiagnosticDataTableResponseColumn(), - new DiagnosticDataTableResponseColumn())) - .withRows(Arrays.asList("datamlkxtrqjfs"))) - .withRenderingProperties(new DiagnosticRendering().withType(539417397) - .withTitle("xhwgfwsrtaw") - .withDescription("ezbrhubskh") - .withIsVisible(false)), - new DiagnosticsDataApiResponse() - .withTable(new DiagnosticDataTableResponseObject().withTableName("ookk") - .withColumns(Arrays.asList(new DiagnosticDataTableResponseColumn(), - new DiagnosticDataTableResponseColumn(), new DiagnosticDataTableResponseColumn())) - .withRows(Arrays.asList("datavleo", "datafmluiqtqzfavyvn", "dataqybaryeua", "datajkqa"))) - .withRenderingProperties(new DiagnosticRendering().withType(616874585) - .withTitle("lesjcbhe") - .withDescription("ntiew") - .withIsVisible(false)), - new DiagnosticsDataApiResponse() - .withTable(new DiagnosticDataTableResponseObject().withTableName("quwrbehwag") - .withColumns(Arrays.asList(new DiagnosticDataTableResponseColumn(), - new DiagnosticDataTableResponseColumn(), new DiagnosticDataTableResponseColumn(), - new DiagnosticDataTableResponseColumn())) - .withRows(Arrays.asList("datafkmr"))) - .withRenderingProperties(new DiagnosticRendering().withType(226189444) - .withTitle("hmxtdr") - .withDescription("utacoe") - .withIsVisible(false)), - new DiagnosticsDataApiResponse() - .withTable(new DiagnosticDataTableResponseObject().withTableName("zcjznmwcpmgua") - .withColumns(Arrays.asList(new DiagnosticDataTableResponseColumn(), - new DiagnosticDataTableResponseColumn(), new DiagnosticDataTableResponseColumn(), - new DiagnosticDataTableResponseColumn())) - .withRows(Arrays.asList("datafactka", "datazov"))) - .withRenderingProperties(new DiagnosticRendering().withType(753608642) - .withTitle("uxxpshne") - .withDescription("ulfgslqu") - .withIsVisible(true)))) - .withStatus(new DiagnosticsStatus().withMessage("enr").withStatusId(1559984904)) - .withDataProviderMetadata(new DiagnosticDataProviderMetadata().withProviderName("jbazpjuohminy") - .withPropertyBag(Arrays.asList( - new DiagnosticDataProviderMetadataPropertyBagItem().withName("rwm").withValue("vwpklvxwmygdxp"), - new DiagnosticDataProviderMetadataPropertyBagItem().withName("qchiszep") - .withValue("bjcrxgibbdaxco"), - new DiagnosticDataProviderMetadataPropertyBagItem().withName("ozauorsukokwb").withValue("lhlv"), - new DiagnosticDataProviderMetadataPropertyBagItem().withName("uepzl").withValue("hw"))))); - model = BinaryData.fromObject(model).toObject(DiagnosticsInner.class); - Assertions.assertEquals("ibthostgktstvd", model.properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("qkdlw", model.properties().dataset().get(0).table().tableName()); - Assertions.assertEquals(539417397, model.properties().dataset().get(0).renderingProperties().type()); - Assertions.assertEquals("xhwgfwsrtaw", model.properties().dataset().get(0).renderingProperties().title()); - Assertions.assertEquals("ezbrhubskh", model.properties().dataset().get(0).renderingProperties().description()); - Assertions.assertFalse(model.properties().dataset().get(0).renderingProperties().isVisible()); - Assertions.assertEquals("enr", model.properties().status().message()); - Assertions.assertEquals(1559984904, model.properties().status().statusId()); - Assertions.assertEquals("jbazpjuohminy", model.properties().dataProviderMetadata().providerName()); - Assertions.assertEquals("rwm", model.properties().dataProviderMetadata().propertyBag().get(0).name()); - Assertions.assertEquals("vwpklvxwmygdxp", + Assertions.assertEquals("cmyfqipgxhnpo", model.properties().status().message()); + Assertions.assertEquals(143132468, model.properties().status().statusId()); + Assertions.assertEquals("abvn", model.properties().dataProviderMetadata().providerName()); + Assertions.assertEquals("ey", model.properties().dataProviderMetadata().propertyBag().get(0).name()); + Assertions.assertEquals("wlpaugmrmfjlrxwt", 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 index d6cffb5dd37c..891dd854ea5c 100644 --- 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 @@ -1,90 +1,32 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.DiagnosticSupportTopic; -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 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\":\"hhg\",\"name\":\"hxmsivfo\",\"description\":\"loxggdufiqn\",\"author\":\"euzaof\",\"category\":\"hvcyyysfg\",\"supportTopicList\":[{\"id\":\"ubiipuipwoqonma\",\"pesId\":\"ekni\"},{\"id\":\"hqvcimpevfgmblr\",\"pesId\":\"lbywdxsm\"},{\"id\":\"cwrwfs\",\"pesId\":\"fnynszqujizdvoqy\"},{\"id\":\"byowbblgyavutp\",\"pesId\":\"joxoism\"}],\"analysisTypes\":[\"bpimlqoljxkcgxxl\",\"sffgcvizqzd\"],\"type\":\"vwlyoup\",\"score\":83.406975},\"dataset\":[{\"table\":{\"tableName\":\"bdyhgkfminsgowz\",\"columns\":[{\"columnName\":\"ttktlahbq\",\"dataType\":\"tx\",\"columnType\":\"zukxitmmqtgqq\"},{\"columnName\":\"hrnxrxc\",\"dataType\":\"uisavokq\",\"columnType\":\"fvazivjlfrqttba\"},{\"columnName\":\"katnwxyi\",\"dataType\":\"id\",\"columnType\":\"qfkuvscxkdmli\"}],\"rows\":[\"dataibrxkp\",\"dataloazuruocbgoo\",\"databteoybf\",\"datajxakv\"]},\"renderingProperties\":{\"type\":639924781,\"title\":\"ordilmywwtkgkxny\",\"description\":\"abgyvudt\",\"isVisible\":true}}],\"status\":{\"message\":\"cihxuuwhcjyx\",\"statusId\":1400153044},\"dataProviderMetadata\":{\"providerName\":\"payakkud\",\"propertyBag\":[{\"name\":\"wjplma\",\"value\":\"tcyohpfkyrk\"},{\"name\":\"dg\",\"value\":\"gsj\"},{\"name\":\"nwqjnoba\",\"value\":\"hdd\"},{\"name\":\"acegfnmntf\",\"value\":\"vm\"}]}}") + "{\"metadata\":{\"id\":\"u\",\"name\":\"ljdlrgmspl\",\"description\":\"auf\",\"author\":\"hhvnewgnxkymp\",\"category\":\"nxrjkixtwbtaoy\",\"supportTopicList\":[{\"id\":\"hshxcylhkgmnsghp\",\"pesId\":\"cphdrwjjkhvyo\"}],\"analysisTypes\":[\"luzvxnq\"],\"type\":\"rpqpd\",\"score\":59.6452},\"dataset\":[{\"table\":{\"tableName\":\"qc\",\"columns\":[{\"columnName\":\"xuifmcsypobkdqz\",\"dataType\":\"zsylollgt\",\"columnType\":\"zzydmxzjijpvua\"}],\"rows\":[\"\\\"dataihcirldef\\\"\",\"\\\"datardcoxnbkkj\\\"\",\"\\\"datanurnnq\\\"\"]},\"renderingProperties\":{\"type\":535354048,\"title\":\"izxqltgrd\",\"description\":\"ypxrx\",\"isVisible\":false}}],\"status\":{\"message\":\"wuh\",\"statusId\":1934047317},\"dataProviderMetadata\":{\"providerName\":\"s\",\"propertyBag\":[{\"name\":\"blml\",\"value\":\"wxihs\"},{\"name\":\"xwqagnepzw\",\"value\":\"lsbs\"},{\"name\":\"qqagwwr\",\"value\":\"omzisglrrcz\"},{\"name\":\"k\",\"value\":\"ltn\"}]}}") .toObject(DiagnosticsProperties.class); - Assertions.assertEquals("bpimlqoljxkcgxxl", model.metadata().analysisTypes().get(0)); - Assertions.assertEquals("bdyhgkfminsgowz", model.dataset().get(0).table().tableName()); - Assertions.assertEquals("ttktlahbq", model.dataset().get(0).table().columns().get(0).columnName()); - Assertions.assertEquals("tx", model.dataset().get(0).table().columns().get(0).dataType()); - Assertions.assertEquals("zukxitmmqtgqq", model.dataset().get(0).table().columns().get(0).columnType()); - Assertions.assertEquals(639924781, model.dataset().get(0).renderingProperties().type()); - Assertions.assertEquals("ordilmywwtkgkxny", model.dataset().get(0).renderingProperties().title()); - Assertions.assertEquals("abgyvudt", model.dataset().get(0).renderingProperties().description()); - Assertions.assertTrue(model.dataset().get(0).renderingProperties().isVisible()); - Assertions.assertEquals("cihxuuwhcjyx", model.status().message()); - Assertions.assertEquals(1400153044, model.status().statusId()); - Assertions.assertEquals("payakkud", model.dataProviderMetadata().providerName()); - Assertions.assertEquals("wjplma", model.dataProviderMetadata().propertyBag().get(0).name()); - Assertions.assertEquals("tcyohpfkyrk", 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(), - new DiagnosticSupportTopic(), new DiagnosticSupportTopic())) - .withAnalysisTypes(Arrays.asList("bpimlqoljxkcgxxl", "sffgcvizqzd"))) - .withDataset(Arrays.asList(new DiagnosticsDataApiResponse() - .withTable(new DiagnosticDataTableResponseObject().withTableName("bdyhgkfminsgowz") - .withColumns(Arrays.asList( - new DiagnosticDataTableResponseColumn().withColumnName("ttktlahbq") - .withDataType("tx") - .withColumnType("zukxitmmqtgqq"), - new DiagnosticDataTableResponseColumn().withColumnName("hrnxrxc") - .withDataType("uisavokq") - .withColumnType("fvazivjlfrqttba"), - new DiagnosticDataTableResponseColumn().withColumnName("katnwxyi") - .withDataType("id") - .withColumnType("qfkuvscxkdmli"))) - .withRows(Arrays.asList("dataibrxkp", "dataloazuruocbgoo", "databteoybf", "datajxakv"))) - .withRenderingProperties(new DiagnosticRendering().withType(639924781) - .withTitle("ordilmywwtkgkxny") - .withDescription("abgyvudt") - .withIsVisible(true)))) - .withStatus(new DiagnosticsStatus().withMessage("cihxuuwhcjyx").withStatusId(1400153044)) - .withDataProviderMetadata(new DiagnosticDataProviderMetadata().withProviderName("payakkud") - .withPropertyBag(Arrays.asList( - new DiagnosticDataProviderMetadataPropertyBagItem().withName("wjplma").withValue("tcyohpfkyrk"), - new DiagnosticDataProviderMetadataPropertyBagItem().withName("dg").withValue("gsj"), - new DiagnosticDataProviderMetadataPropertyBagItem().withName("nwqjnoba").withValue("hdd"), - new DiagnosticDataProviderMetadataPropertyBagItem().withName("acegfnmntf").withValue("vm")))); - model = BinaryData.fromObject(model).toObject(DiagnosticsProperties.class); - Assertions.assertEquals("bpimlqoljxkcgxxl", model.metadata().analysisTypes().get(0)); - Assertions.assertEquals("bdyhgkfminsgowz", model.dataset().get(0).table().tableName()); - Assertions.assertEquals("ttktlahbq", model.dataset().get(0).table().columns().get(0).columnName()); - Assertions.assertEquals("tx", model.dataset().get(0).table().columns().get(0).dataType()); - Assertions.assertEquals("zukxitmmqtgqq", model.dataset().get(0).table().columns().get(0).columnType()); - Assertions.assertEquals(639924781, model.dataset().get(0).renderingProperties().type()); - Assertions.assertEquals("ordilmywwtkgkxny", model.dataset().get(0).renderingProperties().title()); - Assertions.assertEquals("abgyvudt", model.dataset().get(0).renderingProperties().description()); - Assertions.assertTrue(model.dataset().get(0).renderingProperties().isVisible()); - Assertions.assertEquals("cihxuuwhcjyx", model.status().message()); - Assertions.assertEquals(1400153044, model.status().statusId()); - Assertions.assertEquals("payakkud", model.dataProviderMetadata().providerName()); - Assertions.assertEquals("wjplma", model.dataProviderMetadata().propertyBag().get(0).name()); - Assertions.assertEquals("tcyohpfkyrk", model.dataProviderMetadata().propertyBag().get(0).value()); + Assertions.assertEquals("luzvxnq", model.metadata().analysisTypes().get(0)); + Assertions.assertEquals("qc", model.dataset().get(0).table().tableName()); + Assertions.assertEquals("xuifmcsypobkdqz", model.dataset().get(0).table().columns().get(0).columnName()); + Assertions.assertEquals("zsylollgt", model.dataset().get(0).table().columns().get(0).dataType()); + Assertions.assertEquals("zzydmxzjijpvua", model.dataset().get(0).table().columns().get(0).columnType()); + Assertions.assertEquals(535354048, model.dataset().get(0).renderingProperties().type()); + Assertions.assertEquals("izxqltgrd", model.dataset().get(0).renderingProperties().title()); + Assertions.assertEquals("ypxrx", model.dataset().get(0).renderingProperties().description()); + Assertions.assertFalse(model.dataset().get(0).renderingProperties().isVisible()); + Assertions.assertEquals("wuh", model.status().message()); + Assertions.assertEquals(1934047317, model.status().statusId()); + Assertions.assertEquals("s", model.dataProviderMetadata().providerName()); + Assertions.assertEquals("blml", model.dataProviderMetadata().propertyBag().get(0).name()); + Assertions.assertEquals("wxihs", 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 index d0bc3c31c52e..dc0e08b32f1b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,17 +11,9 @@ public final class DiagnosticsStatusTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DiagnosticsStatus model = BinaryData.fromString("{\"message\":\"avluwmncs\",\"statusId\":736005906}") + DiagnosticsStatus model = BinaryData.fromString("{\"message\":\"dwwexymz\",\"statusId\":845567111}") .toObject(DiagnosticsStatus.class); - Assertions.assertEquals("avluwmncs", model.message()); - Assertions.assertEquals(736005906, model.statusId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticsStatus model = new DiagnosticsStatus().withMessage("avluwmncs").withStatusId(736005906); - model = BinaryData.fromObject(model).toObject(DiagnosticsStatus.class); - Assertions.assertEquals("avluwmncs", model.message()); - Assertions.assertEquals(736005906, model.statusId()); + Assertions.assertEquals("dwwexymz", model.message()); + Assertions.assertEquals(845567111, model.statusId()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentConfigurationPropertyTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentConfigurationPropertyTests.java new file mode 100644 index 000000000000..e3419ac741c9 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentConfigurationPropertyTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentConfigurationProperty; +import org.junit.jupiter.api.Assertions; + +public final class DotNetComponentConfigurationPropertyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DotNetComponentConfigurationProperty model + = BinaryData.fromString("{\"propertyName\":\"qtmldgxo\",\"value\":\"irclnpk\"}") + .toObject(DotNetComponentConfigurationProperty.class); + Assertions.assertEquals("qtmldgxo", model.propertyName()); + Assertions.assertEquals("irclnpk", model.value()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DotNetComponentConfigurationProperty model + = new DotNetComponentConfigurationProperty().withPropertyName("qtmldgxo").withValue("irclnpk"); + model = BinaryData.fromObject(model).toObject(DotNetComponentConfigurationProperty.class); + Assertions.assertEquals("qtmldgxo", model.propertyName()); + Assertions.assertEquals("irclnpk", model.value()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentInnerTests.java new file mode 100644 index 000000000000..eab06c0d64d8 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentInnerTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.fluent.models.DotNetComponentInner; +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; +import org.junit.jupiter.api.Assertions; + +public final class DotNetComponentInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DotNetComponentInner model = BinaryData.fromString( + "{\"properties\":{\"componentType\":\"AspireDashboard\",\"provisioningState\":\"Failed\",\"configurations\":[{\"propertyName\":\"ykzkdncjdxo\",\"value\":\"zoggculapz\"},{\"propertyName\":\"rpgogtqxep\",\"value\":\"lbfu\"},{\"propertyName\":\"lyjt\",\"value\":\"of\"},{\"propertyName\":\"hvfcibyfmow\",\"value\":\"rkjpvdwxfzwii\"}],\"serviceBinds\":[{\"name\":\"bhyzsxjr\",\"serviceId\":\"mbtrnegvmnvu\"}]},\"id\":\"qvldspastjbkkd\",\"name\":\"flvestmjlxrrilo\",\"type\":\"apeewchpxlkt\"}") + .toObject(DotNetComponentInner.class); + Assertions.assertEquals(DotNetComponentType.ASPIRE_DASHBOARD, model.componentType()); + Assertions.assertEquals("ykzkdncjdxo", model.configurations().get(0).propertyName()); + Assertions.assertEquals("zoggculapz", model.configurations().get(0).value()); + Assertions.assertEquals("bhyzsxjr", model.serviceBinds().get(0).name()); + Assertions.assertEquals("mbtrnegvmnvu", model.serviceBinds().get(0).serviceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DotNetComponentInner model = new DotNetComponentInner().withComponentType(DotNetComponentType.ASPIRE_DASHBOARD) + .withConfigurations(Arrays.asList( + new DotNetComponentConfigurationProperty().withPropertyName("ykzkdncjdxo").withValue("zoggculapz"), + new DotNetComponentConfigurationProperty().withPropertyName("rpgogtqxep").withValue("lbfu"), + new DotNetComponentConfigurationProperty().withPropertyName("lyjt").withValue("of"), + new DotNetComponentConfigurationProperty().withPropertyName("hvfcibyfmow").withValue("rkjpvdwxfzwii"))) + .withServiceBinds( + Arrays.asList(new DotNetComponentServiceBind().withName("bhyzsxjr").withServiceId("mbtrnegvmnvu"))); + model = BinaryData.fromObject(model).toObject(DotNetComponentInner.class); + Assertions.assertEquals(DotNetComponentType.ASPIRE_DASHBOARD, model.componentType()); + Assertions.assertEquals("ykzkdncjdxo", model.configurations().get(0).propertyName()); + Assertions.assertEquals("zoggculapz", model.configurations().get(0).value()); + Assertions.assertEquals("bhyzsxjr", model.serviceBinds().get(0).name()); + Assertions.assertEquals("mbtrnegvmnvu", model.serviceBinds().get(0).serviceId()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentPropertiesTests.java new file mode 100644 index 000000000000..1fbe3dfaa8f2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentPropertiesTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.fluent.models.DotNetComponentProperties; +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; +import org.junit.jupiter.api.Assertions; + +public final class DotNetComponentPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DotNetComponentProperties model = BinaryData.fromString( + "{\"componentType\":\"AspireDashboard\",\"provisioningState\":\"Succeeded\",\"configurations\":[{\"propertyName\":\"levufuztcktyhj\",\"value\":\"edcg\"},{\"propertyName\":\"lwmmrqzzrrjv\",\"value\":\"lydzgk\"},{\"propertyName\":\"qeevt\",\"value\":\"pryu\"},{\"propertyName\":\"wytpzdmovz\",\"value\":\"va\"}],\"serviceBinds\":[{\"name\":\"adflgzu\",\"serviceId\":\"glae\"},{\"name\":\"ndtic\",\"serviceId\":\"pvz\"}]}") + .toObject(DotNetComponentProperties.class); + Assertions.assertEquals(DotNetComponentType.ASPIRE_DASHBOARD, model.componentType()); + Assertions.assertEquals("levufuztcktyhj", model.configurations().get(0).propertyName()); + Assertions.assertEquals("edcg", model.configurations().get(0).value()); + Assertions.assertEquals("adflgzu", model.serviceBinds().get(0).name()); + Assertions.assertEquals("glae", model.serviceBinds().get(0).serviceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DotNetComponentProperties model + = new DotNetComponentProperties().withComponentType(DotNetComponentType.ASPIRE_DASHBOARD) + .withConfigurations(Arrays.asList( + new DotNetComponentConfigurationProperty().withPropertyName("levufuztcktyhj").withValue("edcg"), + new DotNetComponentConfigurationProperty().withPropertyName("lwmmrqzzrrjv").withValue("lydzgk"), + new DotNetComponentConfigurationProperty().withPropertyName("qeevt").withValue("pryu"), + new DotNetComponentConfigurationProperty().withPropertyName("wytpzdmovz").withValue("va"))) + .withServiceBinds( + Arrays.asList(new DotNetComponentServiceBind().withName("adflgzu").withServiceId("glae"), + new DotNetComponentServiceBind().withName("ndtic").withServiceId("pvz"))); + model = BinaryData.fromObject(model).toObject(DotNetComponentProperties.class); + Assertions.assertEquals(DotNetComponentType.ASPIRE_DASHBOARD, model.componentType()); + Assertions.assertEquals("levufuztcktyhj", model.configurations().get(0).propertyName()); + Assertions.assertEquals("edcg", model.configurations().get(0).value()); + Assertions.assertEquals("adflgzu", model.serviceBinds().get(0).name()); + Assertions.assertEquals("glae", model.serviceBinds().get(0).serviceId()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentServiceBindTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentServiceBindTests.java new file mode 100644 index 000000000000..9a93389bd0b8 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentServiceBindTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentServiceBind; +import org.junit.jupiter.api.Assertions; + +public final class DotNetComponentServiceBindTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DotNetComponentServiceBind model = BinaryData.fromString("{\"name\":\"ayzri\",\"serviceId\":\"hya\"}") + .toObject(DotNetComponentServiceBind.class); + Assertions.assertEquals("ayzri", model.name()); + Assertions.assertEquals("hya", model.serviceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DotNetComponentServiceBind model = new DotNetComponentServiceBind().withName("ayzri").withServiceId("hya"); + model = BinaryData.fromObject(model).toObject(DotNetComponentServiceBind.class); + Assertions.assertEquals("ayzri", model.name()); + Assertions.assertEquals("hya", model.serviceId()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsCollectionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsCollectionTests.java new file mode 100644 index 000000000000..1a3fe39a42ba --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsCollectionTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.implementation.models.DotNetComponentsCollection; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentType; +import org.junit.jupiter.api.Assertions; + +public final class DotNetComponentsCollectionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DotNetComponentsCollection model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"componentType\":\"AspireDashboard\",\"provisioningState\":\"Failed\",\"configurations\":[{\"propertyName\":\"kjlmx\",\"value\":\"mdy\"},{\"propertyName\":\"dwdigumb\",\"value\":\"aauzzptjazysd\"},{\"propertyName\":\"ezwwv\",\"value\":\"qyuvvfonkp\"}],\"serviceBinds\":[{\"name\":\"ikvylauya\",\"serviceId\":\"uwmncs\"},{\"name\":\"ijf\",\"serviceId\":\"vpo\"}]},\"id\":\"rsg\",\"name\":\"gbdhuzqgnjdg\",\"type\":\"ynscl\"},{\"properties\":{\"componentType\":\"AspireDashboard\",\"provisioningState\":\"Deleting\",\"configurations\":[{\"propertyName\":\"omtkub\",\"value\":\"ppnvdxz\"}],\"serviceBinds\":[{\"name\":\"frbbc\",\"serviceId\":\"qagt\"},{\"name\":\"dhlfkqojpykvgt\",\"serviceId\":\"cnifm\"},{\"name\":\"sdymbrn\",\"serviceId\":\"u\"}]},\"id\":\"prafwgckhoc\",\"name\":\"vdff\",\"type\":\"wafqroud\"},{\"properties\":{\"componentType\":\"AspireDashboard\",\"provisioningState\":\"Failed\",\"configurations\":[{\"propertyName\":\"vkbunzozudh\",\"value\":\"gkmoyxcdyuibhmfd\"}],\"serviceBinds\":[{\"name\":\"dvfvfcjnaeoi\",\"serviceId\":\"vhmgorffukis\"},{\"name\":\"w\",\"serviceId\":\"hwplefaxvx\"}]},\"id\":\"cbtgnhnz\",\"name\":\"yqxtjjfzql\",\"type\":\"hycav\"},{\"properties\":{\"componentType\":\"AspireDashboard\",\"provisioningState\":\"InProgress\",\"configurations\":[{\"propertyName\":\"smieknlra\",\"value\":\"aawiuagydwqfb\"}],\"serviceBinds\":[{\"name\":\"fgiagtcojocqwo\",\"serviceId\":\"nzjvusfzldm\"}]},\"id\":\"uxylfsbtkadpy\",\"name\":\"own\",\"type\":\"tgkbugrjqctojc\"}],\"nextLink\":\"sofieypefojyqd\"}") + .toObject(DotNetComponentsCollection.class); + Assertions.assertEquals(DotNetComponentType.ASPIRE_DASHBOARD, model.value().get(0).componentType()); + Assertions.assertEquals("kjlmx", model.value().get(0).configurations().get(0).propertyName()); + Assertions.assertEquals("mdy", model.value().get(0).configurations().get(0).value()); + Assertions.assertEquals("ikvylauya", model.value().get(0).serviceBinds().get(0).name()); + Assertions.assertEquals("uwmncs", model.value().get(0).serviceBinds().get(0).serviceId()); + Assertions.assertEquals("sofieypefojyqd", model.nextLink()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsCreateOrUpdateMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..40e313909c71 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsCreateOrUpdateMockTests.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +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.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DotNetComponentsCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"componentType\":\"AspireDashboard\",\"provisioningState\":\"Succeeded\",\"configurations\":[{\"propertyName\":\"frn\",\"value\":\"ktr\"},{\"propertyName\":\"s\",\"value\":\"lr\"},{\"propertyName\":\"myltrwntfmtbg\",\"value\":\"dxwnazkurrd\"}],\"serviceBinds\":[{\"name\":\"jwh\",\"serviceId\":\"twwjwzzq\"},{\"name\":\"uzu\",\"serviceId\":\"y\"},{\"name\":\"yqhyqqzzdcykey\",\"serviceId\":\"ewfopazdazg\"},{\"name\":\"qgpewqcfutmdpvoz\",\"serviceId\":\"qjbknl\"}]},\"id\":\"lctzeyowmndcovd\",\"name\":\"zqauxzan\",\"type\":\"mk\"}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + DotNetComponent response = manager.dotNetComponents() + .define("xxtjlflecomi") + .withExistingManagedEnvironment("qogdx", "bsfp") + .withComponentType(DotNetComponentType.ASPIRE_DASHBOARD) + .withConfigurations(Arrays.asList( + new DotNetComponentConfigurationProperty().withPropertyName("dhilzzdzz").withValue("mueza"), + new DotNetComponentConfigurationProperty().withPropertyName("vribqlotokht") + .withValue("taznkcqwwxwjyof"), + new DotNetComponentConfigurationProperty().withPropertyName("hnkbtlwljssmctsn").withValue("kpwolg"), + new DotNetComponentConfigurationProperty().withPropertyName("ubxbteogfgfiijr") + .withValue("wlefksxqceazfpxg"))) + .withServiceBinds( + Arrays.asList(new DotNetComponentServiceBind().withName("zvluyqqaiosss").withServiceId("vaifppuacvfy"), + new DotNetComponentServiceBind().withName("w").withServiceId("fxtjdhsoym"))) + .create(); + + Assertions.assertEquals(DotNetComponentType.ASPIRE_DASHBOARD, response.componentType()); + Assertions.assertEquals("frn", response.configurations().get(0).propertyName()); + Assertions.assertEquals("ktr", response.configurations().get(0).value()); + Assertions.assertEquals("jwh", response.serviceBinds().get(0).name()); + Assertions.assertEquals("twwjwzzq", response.serviceBinds().get(0).serviceId()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsGetWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsGetWithResponseMockTests.java new file mode 100644 index 000000000000..e1dc2fe6aa99 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsGetWithResponseMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.DotNetComponent; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentType; +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 DotNetComponentsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"componentType\":\"AspireDashboard\",\"provisioningState\":\"Failed\",\"configurations\":[{\"propertyName\":\"ihapfjiiknjdiq\",\"value\":\"iej\"},{\"propertyName\":\"cl\",\"value\":\"edfsbwc\"},{\"propertyName\":\"vbvzipbwxgo\",\"value\":\"x\"}],\"serviceBinds\":[{\"name\":\"dmskxknpdgzigjsu\",\"serviceId\":\"whgsaodkww\"}]},\"id\":\"afoctohz\",\"name\":\"aquvwsxbgnvkervq\",\"type\":\"hoadhrsxqvzv\"}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + DotNetComponent response = manager.dotNetComponents() + .getWithResponse("mqilrixysfnimsqy", "wwmhkruwae", "rympmlq", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(DotNetComponentType.ASPIRE_DASHBOARD, response.componentType()); + Assertions.assertEquals("ihapfjiiknjdiq", response.configurations().get(0).propertyName()); + Assertions.assertEquals("iej", response.configurations().get(0).value()); + Assertions.assertEquals("dmskxknpdgzigjsu", response.serviceBinds().get(0).name()); + Assertions.assertEquals("whgsaodkww", response.serviceBinds().get(0).serviceId()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsListMockTests.java new file mode 100644 index 000000000000..c7779c8a359c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DotNetComponentsListMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.DotNetComponent; +import com.azure.resourcemanager.appcontainers.models.DotNetComponentType; +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 DotNetComponentsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"componentType\":\"AspireDashboard\",\"provisioningState\":\"Canceled\",\"configurations\":[{\"propertyName\":\"jdvqy\",\"value\":\"eqq\"},{\"propertyName\":\"aruwdxvqzxoebw\",\"value\":\"xbibanbaupw\"},{\"propertyName\":\"vpaklozkxbz\",\"value\":\"ejpl\"},{\"propertyName\":\"anbtttkgsu\",\"value\":\"nrswgkpjhboyik\"}],\"serviceBinds\":[{\"name\":\"hkslgwlokhueoij\",\"serviceId\":\"cqypz\"},{\"name\":\"ufgsyfejyvdw\",\"serviceId\":\"xptpqaya\"},{\"name\":\"ncfgybmxsnxoc\",\"serviceId\":\"llojkpoyhgwwdj\"}]},\"id\":\"dbdljz\",\"name\":\"dyrcvuqb\",\"type\":\"gzlrqhbj\"}]}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.dotNetComponents().list("pabdsrg", "ajglzrsubklr", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(DotNetComponentType.ASPIRE_DASHBOARD, response.iterator().next().componentType()); + Assertions.assertEquals("jdvqy", response.iterator().next().configurations().get(0).propertyName()); + Assertions.assertEquals("eqq", response.iterator().next().configurations().get(0).value()); + Assertions.assertEquals("hkslgwlokhueoij", response.iterator().next().serviceBinds().get(0).name()); + Assertions.assertEquals("cqypz", response.iterator().next().serviceBinds().get(0).serviceId()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DynamicPoolConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DynamicPoolConfigurationTests.java index 62acafd646df..7aca29171007 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DynamicPoolConfigurationTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DynamicPoolConfigurationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -14,22 +14,22 @@ public final class DynamicPoolConfigurationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DynamicPoolConfiguration model = BinaryData.fromString( - "{\"lifecycleConfiguration\":{\"lifecycleType\":\"OnContainerExit\",\"cooldownPeriodInSeconds\":844827245,\"maxAlivePeriodInSeconds\":884050511}}") + "{\"lifecycleConfiguration\":{\"lifecycleType\":\"OnContainerExit\",\"cooldownPeriodInSeconds\":974943815,\"maxAlivePeriodInSeconds\":1420716073}}") .toObject(DynamicPoolConfiguration.class); Assertions.assertEquals(LifecycleType.ON_CONTAINER_EXIT, model.lifecycleConfiguration().lifecycleType()); - Assertions.assertEquals(844827245, model.lifecycleConfiguration().cooldownPeriodInSeconds()); - Assertions.assertEquals(884050511, model.lifecycleConfiguration().maxAlivePeriodInSeconds()); + Assertions.assertEquals(974943815, model.lifecycleConfiguration().cooldownPeriodInSeconds()); + Assertions.assertEquals(1420716073, model.lifecycleConfiguration().maxAlivePeriodInSeconds()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { DynamicPoolConfiguration model = new DynamicPoolConfiguration() .withLifecycleConfiguration(new LifecycleConfiguration().withLifecycleType(LifecycleType.ON_CONTAINER_EXIT) - .withCooldownPeriodInSeconds(844827245) - .withMaxAlivePeriodInSeconds(884050511)); + .withCooldownPeriodInSeconds(974943815) + .withMaxAlivePeriodInSeconds(1420716073)); model = BinaryData.fromObject(model).toObject(DynamicPoolConfiguration.class); Assertions.assertEquals(LifecycleType.ON_CONTAINER_EXIT, model.lifecycleConfiguration().lifecycleType()); - Assertions.assertEquals(844827245, model.lifecycleConfiguration().cooldownPeriodInSeconds()); - Assertions.assertEquals(884050511, model.lifecycleConfiguration().maxAlivePeriodInSeconds()); + Assertions.assertEquals(974943815, model.lifecycleConfiguration().cooldownPeriodInSeconds()); + Assertions.assertEquals(1420716073, model.lifecycleConfiguration().maxAlivePeriodInSeconds()); } } 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 index 8f851193e557..bd5b50056bce 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,18 +12,18 @@ public final class ExtendedLocationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ExtendedLocation model = BinaryData.fromString("{\"name\":\"ydagfuaxbe\",\"type\":\"CustomLocation\"}") - .toObject(ExtendedLocation.class); - Assertions.assertEquals("ydagfuaxbe", model.name()); + ExtendedLocation model + = BinaryData.fromString("{\"name\":\"nyga\",\"type\":\"CustomLocation\"}").toObject(ExtendedLocation.class); + Assertions.assertEquals("nyga", model.name()); Assertions.assertEquals(ExtendedLocationTypes.CUSTOM_LOCATION, model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ExtendedLocation model - = new ExtendedLocation().withName("ydagfuaxbe").withType(ExtendedLocationTypes.CUSTOM_LOCATION); + = new ExtendedLocation().withName("nyga").withType(ExtendedLocationTypes.CUSTOM_LOCATION); model = BinaryData.fromObject(model).toObject(ExtendedLocation.class); - Assertions.assertEquals("ydagfuaxbe", model.name()); + Assertions.assertEquals("nyga", 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 index 115054626916..18c9a7e5902d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,22 +12,23 @@ public final class ForwardProxyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ForwardProxy model = BinaryData.fromString( - "{\"convention\":\"Standard\",\"customHostHeaderName\":\"whdsoifiyip\",\"customProtoHeaderName\":\"sqwpgrjb\"}") + ForwardProxy model = BinaryData + .fromString( + "{\"convention\":\"NoProxy\",\"customHostHeaderName\":\"rtle\",\"customProtoHeaderName\":\"q\"}") .toObject(ForwardProxy.class); - Assertions.assertEquals(ForwardProxyConvention.STANDARD, model.convention()); - Assertions.assertEquals("whdsoifiyip", model.customHostHeaderName()); - Assertions.assertEquals("sqwpgrjb", model.customProtoHeaderName()); + Assertions.assertEquals(ForwardProxyConvention.NO_PROXY, model.convention()); + Assertions.assertEquals("rtle", model.customHostHeaderName()); + Assertions.assertEquals("q", model.customProtoHeaderName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ForwardProxy model = new ForwardProxy().withConvention(ForwardProxyConvention.STANDARD) - .withCustomHostHeaderName("whdsoifiyip") - .withCustomProtoHeaderName("sqwpgrjb"); + ForwardProxy model = new ForwardProxy().withConvention(ForwardProxyConvention.NO_PROXY) + .withCustomHostHeaderName("rtle") + .withCustomProtoHeaderName("q"); model = BinaryData.fromObject(model).toObject(ForwardProxy.class); - Assertions.assertEquals(ForwardProxyConvention.STANDARD, model.convention()); - Assertions.assertEquals("whdsoifiyip", model.customHostHeaderName()); - Assertions.assertEquals("sqwpgrjb", model.customProtoHeaderName()); + Assertions.assertEquals(ForwardProxyConvention.NO_PROXY, model.convention()); + Assertions.assertEquals("rtle", model.customHostHeaderName()); + Assertions.assertEquals("q", model.customProtoHeaderName()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/FunctionsExtensionsInvokeFunctionsHostWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/FunctionsExtensionsInvokeFunctionsHostWithResponseMockTests.java new file mode 100644 index 000000000000..e313fc867484 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/FunctionsExtensionsInvokeFunctionsHostWithResponseMockTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +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 FunctionsExtensionsInvokeFunctionsHostWithResponseMockTests { + @Test + public void testInvokeFunctionsHostWithResponse() throws Exception { + String responseStr = "\"tpzkgmeboywhcz\""; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + String response = manager.functionsExtensions() + .invokeFunctionsHostWithResponse("ktjtgra", "aqo", "fkbebauzl", "btxxwpfhnjzud", + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("tpzkgmeboywhcz", response); + } +} 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 index fa819149f34d..3af8b65b1d9f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -14,22 +14,22 @@ 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\"]}") + "{\"unauthenticatedClientAction\":\"AllowAnonymous\",\"redirectToProvider\":\"lmuoyxprimrsopte\",\"excludedPaths\":[\"meisls\"]}") .toObject(GlobalValidation.class); - Assertions.assertEquals(UnauthenticatedClientActionV2.RETURN401, model.unauthenticatedClientAction()); - Assertions.assertEquals("mglzufcy", model.redirectToProvider()); - Assertions.assertEquals("hdbihan", model.excludedPaths().get(0)); + Assertions.assertEquals(UnauthenticatedClientActionV2.ALLOW_ANONYMOUS, model.unauthenticatedClientAction()); + Assertions.assertEquals("lmuoyxprimrsopte", model.redirectToProvider()); + Assertions.assertEquals("meisls", 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")); + = new GlobalValidation().withUnauthenticatedClientAction(UnauthenticatedClientActionV2.ALLOW_ANONYMOUS) + .withRedirectToProvider("lmuoyxprimrsopte") + .withExcludedPaths(Arrays.asList("meisls")); 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)); + Assertions.assertEquals(UnauthenticatedClientActionV2.ALLOW_ANONYMOUS, model.unauthenticatedClientAction()); + Assertions.assertEquals("lmuoyxprimrsopte", model.redirectToProvider()); + Assertions.assertEquals("meisls", model.excludedPaths().get(0)); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteActionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteActionTests.java index ede22a619ccc..5bcf694997cd 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteActionTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteActionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,14 +11,15 @@ public final class HttpRouteActionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - HttpRouteAction model = BinaryData.fromString("{\"prefixRewrite\":\"vuqd\"}").toObject(HttpRouteAction.class); - Assertions.assertEquals("vuqd", model.prefixRewrite()); + HttpRouteAction model + = BinaryData.fromString("{\"prefixRewrite\":\"qawmoaianc\"}").toObject(HttpRouteAction.class); + Assertions.assertEquals("qawmoaianc", model.prefixRewrite()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - HttpRouteAction model = new HttpRouteAction().withPrefixRewrite("vuqd"); + HttpRouteAction model = new HttpRouteAction().withPrefixRewrite("qawmoaianc"); model = BinaryData.fromObject(model).toObject(HttpRouteAction.class); - Assertions.assertEquals("vuqd", model.prefixRewrite()); + Assertions.assertEquals("qawmoaianc", model.prefixRewrite()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigCollectionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigCollectionTests.java index a0d5d94dcacc..7655c580f445 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigCollectionTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigCollectionTests.java @@ -1,98 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.HttpRouteConfigInner; +import com.azure.resourcemanager.appcontainers.implementation.models.HttpRouteConfigCollection; import com.azure.resourcemanager.appcontainers.models.BindingType; -import com.azure.resourcemanager.appcontainers.models.CustomDomain; -import com.azure.resourcemanager.appcontainers.models.HttpRoute; -import com.azure.resourcemanager.appcontainers.models.HttpRouteConfigCollection; -import com.azure.resourcemanager.appcontainers.models.HttpRouteConfigProperties; -import com.azure.resourcemanager.appcontainers.models.HttpRouteRule; -import com.azure.resourcemanager.appcontainers.models.HttpRouteTarget; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class HttpRouteConfigCollectionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { HttpRouteConfigCollection model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"provisioningErrors\":[{\"timestamp\":\"2021-06-12T04:55:31Z\",\"message\":\"ubcpzgpxti\"}],\"fqdn\":\"j\",\"customDomains\":[{\"name\":\"dibgqjxgpnrhgov\",\"bindingType\":\"Disabled\",\"certificateId\":\"kqmhhaowjr\"},{\"name\":\"zvuporqzdfuydz\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"xcnqmxqpswokmvkh\"},{\"name\":\"ggdhbemzqkzszuw\",\"bindingType\":\"Auto\",\"certificateId\":\"lxxhljfp\"}],\"rules\":[{\"targets\":[{\"containerApp\":\"mnzhrgmqg\"},{\"containerApp\":\"sxvpqcbfrmbodths\"}],\"routes\":[{},{},{}],\"description\":\"riibakclacj\"},{\"targets\":[{\"containerApp\":\"xousxauzl\"}],\"routes\":[{},{}],\"description\":\"mwohqfzizvuxmmkj\"}]},\"id\":\"thnwpzte\",\"name\":\"ovmribiattg\",\"type\":\"lu\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"provisioningErrors\":[{\"timestamp\":\"2021-06-30T19:06:44Z\",\"message\":\"hnykz\"}],\"fqdn\":\"gswvxwlmzqwm\",\"customDomains\":[{\"name\":\"njmxmcuqudtcvcl\",\"bindingType\":\"Disabled\",\"certificateId\":\"dkvgfabuiyjibuzp\"},{\"name\":\"dugneiknp\",\"bindingType\":\"Auto\",\"certificateId\":\"jiuqhibtozi\"}],\"rules\":[{\"targets\":[{\"containerApp\":\"d\"},{\"containerApp\":\"urrxxgewpktv\"},{\"containerApp\":\"ylkmqp\"}],\"routes\":[{},{}],\"description\":\"lfbcgwgcl\"},{\"targets\":[{\"containerApp\":\"ebqinjipnw\"},{\"containerApp\":\"fujqlafcba\"},{\"containerApp\":\"hpzpo\"}],\"routes\":[{},{},{},{}],\"description\":\"jwpfilkm\"},{\"targets\":[{\"containerApp\":\"olvdnd\"},{\"containerApp\":\"iauogphuartv\"}],\"routes\":[{},{},{},{}],\"description\":\"yefchnm\"},{\"targets\":[{\"containerApp\":\"mnxhkxjqirwrweo\"},{\"containerApp\":\"xffi\"},{\"containerApp\":\"hx\"}],\"routes\":[{},{},{}],\"description\":\"ewmozqvbu\"}]},\"id\":\"ma\",\"name\":\"hsycxhxzgaz\",\"type\":\"taboidvmf\"}],\"nextLink\":\"ppu\"}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"provisioningErrors\":[{\"timestamp\":\"2021-05-24T14:12:48Z\",\"message\":\"lxydkxrxv\"},{\"timestamp\":\"2021-08-18T06:28:23Z\",\"message\":\"wkgfbqljnqkh\"}],\"fqdn\":\"h\",\"customDomains\":[{\"name\":\"kulehurqlrq\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"eyu\"},{\"name\":\"kphyjdxrav\",\"bindingType\":\"Disabled\",\"certificateId\":\"brxmrgch\"},{\"name\":\"apx\",\"bindingType\":\"Auto\",\"certificateId\":\"jjk\"},{\"name\":\"ajb\",\"bindingType\":\"Disabled\",\"certificateId\":\"duusioycblevpmcl\"}],\"rules\":[{\"targets\":[{\"containerApp\":\"yxlzgs\"}],\"routes\":[{},{},{}],\"description\":\"zltafhbzffovwm\"},{\"targets\":[{\"containerApp\":\"zqs\"}],\"routes\":[{},{},{}],\"description\":\"vdwnapfdqwowft\"}]},\"id\":\"n\",\"name\":\"wjtkschgcgqyhl\",\"type\":\"seyqrhvyeldotjv\"},{\"properties\":{\"provisioningState\":\"Waiting\",\"provisioningErrors\":[{\"timestamp\":\"2021-10-06T13:29:10Z\",\"message\":\"kjtasb\"}],\"fqdn\":\"ispkxkdtx\",\"customDomains\":[{\"name\":\"dlqvtwknvg\",\"bindingType\":\"Disabled\",\"certificateId\":\"gtywatmqaqkue\"},{\"name\":\"tgroesh\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"cbyfqxkf\"},{\"name\":\"oytehqpuvjm\",\"bindingType\":\"Disabled\",\"certificateId\":\"dwckygroe\"},{\"name\":\"n\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"djus\"}],\"rules\":[{\"targets\":[{\"containerApp\":\"qyn\"}],\"routes\":[{},{},{}],\"description\":\"sfaq\"},{\"targets\":[{\"containerApp\":\"lwryshwddkvbxgkq\"}],\"routes\":[{},{}],\"description\":\"w\"},{\"targets\":[{\"containerApp\":\"acarvvlf\"},{\"containerApp\":\"tymtpoiwenazer\"},{\"containerApp\":\"hzr\"}],\"routes\":[{}],\"description\":\"sxkdnwqapfgsdpc\"},{\"targets\":[{\"containerApp\":\"smzhhkuuipldqqct\"},{\"containerApp\":\"kva\"},{\"containerApp\":\"blhtjq\"}],\"routes\":[{},{},{}],\"description\":\"wehtaemxh\"}]},\"id\":\"ysev\",\"name\":\"sxivzrrryvei\",\"type\":\"ipsk\"}],\"nextLink\":\"zatvfuzka\"}") .toObject(HttpRouteConfigCollection.class); - Assertions.assertEquals("dibgqjxgpnrhgov", model.value().get(0).properties().customDomains().get(0).name()); - Assertions.assertEquals(BindingType.DISABLED, + Assertions.assertEquals("kulehurqlrq", model.value().get(0).properties().customDomains().get(0).name()); + Assertions.assertEquals(BindingType.SNI_ENABLED, model.value().get(0).properties().customDomains().get(0).bindingType()); - Assertions.assertEquals("kqmhhaowjr", model.value().get(0).properties().customDomains().get(0).certificateId()); - Assertions.assertEquals("mnzhrgmqg", + Assertions.assertEquals("eyu", model.value().get(0).properties().customDomains().get(0).certificateId()); + Assertions.assertEquals("yxlzgs", model.value().get(0).properties().rules().get(0).targets().get(0).containerApp()); - Assertions.assertEquals("riibakclacj", model.value().get(0).properties().rules().get(0).description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HttpRouteConfigCollection model = new HttpRouteConfigCollection().withValue(Arrays.asList( - new HttpRouteConfigInner().withProperties(new HttpRouteConfigProperties() - .withCustomDomains(Arrays.asList( - new CustomDomain().withName("dibgqjxgpnrhgov") - .withBindingType(BindingType.DISABLED) - .withCertificateId("kqmhhaowjr"), - new CustomDomain().withName("zvuporqzdfuydz") - .withBindingType(BindingType.SNI_ENABLED) - .withCertificateId("xcnqmxqpswokmvkh"), - new CustomDomain().withName("ggdhbemzqkzszuw") - .withBindingType(BindingType.AUTO) - .withCertificateId("lxxhljfp"))) - .withRules(Arrays.asList( - new HttpRouteRule() - .withTargets(Arrays.asList(new HttpRouteTarget().withContainerApp("mnzhrgmqg"), - new HttpRouteTarget().withContainerApp("sxvpqcbfrmbodths"))) - .withRoutes(Arrays.asList(new HttpRoute(), new HttpRoute(), new HttpRoute())) - .withDescription("riibakclacj"), - new HttpRouteRule().withTargets(Arrays.asList(new HttpRouteTarget().withContainerApp("xousxauzl"))) - .withRoutes(Arrays.asList(new HttpRoute(), new HttpRoute())) - .withDescription("mwohqfzizvuxmmkj")))), - new HttpRouteConfigInner().withProperties(new HttpRouteConfigProperties() - .withCustomDomains(Arrays.asList( - new CustomDomain().withName("njmxmcuqudtcvcl") - .withBindingType(BindingType.DISABLED) - .withCertificateId("dkvgfabuiyjibuzp"), - new CustomDomain().withName("dugneiknp") - .withBindingType(BindingType.AUTO) - .withCertificateId("jiuqhibtozi"))) - .withRules(Arrays.asList( - new HttpRouteRule() - .withTargets(Arrays.asList(new HttpRouteTarget().withContainerApp("d"), - new HttpRouteTarget().withContainerApp("urrxxgewpktv"), - new HttpRouteTarget().withContainerApp("ylkmqp"))) - .withRoutes(Arrays.asList(new HttpRoute(), new HttpRoute())) - .withDescription("lfbcgwgcl"), - new HttpRouteRule() - .withTargets(Arrays.asList(new HttpRouteTarget().withContainerApp("ebqinjipnw"), - new HttpRouteTarget().withContainerApp("fujqlafcba"), - new HttpRouteTarget().withContainerApp("hpzpo"))) - .withRoutes(Arrays.asList(new HttpRoute(), new HttpRoute(), new HttpRoute(), new HttpRoute())) - .withDescription("jwpfilkm"), - new HttpRouteRule() - .withTargets(Arrays.asList(new HttpRouteTarget().withContainerApp("olvdnd"), - new HttpRouteTarget().withContainerApp("iauogphuartv"))) - .withRoutes(Arrays.asList(new HttpRoute(), new HttpRoute(), new HttpRoute(), new HttpRoute())) - .withDescription("yefchnm"), - new HttpRouteRule() - .withTargets(Arrays.asList(new HttpRouteTarget().withContainerApp("mnxhkxjqirwrweo"), - new HttpRouteTarget().withContainerApp("xffi"), - new HttpRouteTarget().withContainerApp("hx"))) - .withRoutes(Arrays.asList(new HttpRoute(), new HttpRoute(), new HttpRoute())) - .withDescription("ewmozqvbu")))))); - model = BinaryData.fromObject(model).toObject(HttpRouteConfigCollection.class); - Assertions.assertEquals("dibgqjxgpnrhgov", model.value().get(0).properties().customDomains().get(0).name()); - Assertions.assertEquals(BindingType.DISABLED, - model.value().get(0).properties().customDomains().get(0).bindingType()); - Assertions.assertEquals("kqmhhaowjr", model.value().get(0).properties().customDomains().get(0).certificateId()); - Assertions.assertEquals("mnzhrgmqg", - model.value().get(0).properties().rules().get(0).targets().get(0).containerApp()); - Assertions.assertEquals("riibakclacj", model.value().get(0).properties().rules().get(0).description()); + Assertions.assertEquals("zltafhbzffovwm", model.value().get(0).properties().rules().get(0).description()); + Assertions.assertEquals("zatvfuzka", model.nextLink()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigInnerTests.java index b5852216c43c..0b8a1ca0a975 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigInnerTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -21,38 +21,61 @@ public final class HttpRouteConfigInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { HttpRouteConfigInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"provisioningErrors\":[{\"timestamp\":\"2021-04-06T20:01:23Z\",\"message\":\"wjizcilnghgsh\"},{\"timestamp\":\"2021-03-29T23:15:43Z\",\"message\":\"bxqmu\"},{\"timestamp\":\"2021-05-18T00:36:38Z\",\"message\":\"xqzv\"},{\"timestamp\":\"2021-07-23T03:53:30Z\",\"message\":\"bycucrwnamikz\"}],\"fqdn\":\"rqbsmswziq\",\"customDomains\":[{\"name\":\"hokzrusw\",\"bindingType\":\"Disabled\",\"certificateId\":\"zznvfbyc\"}],\"rules\":[{\"targets\":[{\"containerApp\":\"wix\",\"revision\":\"umwmxqhnd\",\"label\":\"oamld\"},{\"containerApp\":\"ehaohdjhh\",\"revision\":\"z\",\"label\":\"xcoxpelnjet\"},{\"containerApp\":\"gltsxoat\",\"revision\":\"g\",\"label\":\"npbs\"}],\"routes\":[{\"match\":{},\"action\":{}}],\"description\":\"ccsrmozihmipgaw\"}]},\"id\":\"xp\",\"name\":\"y\",\"type\":\"cxcjxgry\"}") + "{\"properties\":{\"provisioningState\":\"Updating\",\"provisioningErrors\":[{\"timestamp\":\"2021-04-18T23:10:57Z\",\"message\":\"n\"},{\"timestamp\":\"2021-10-01T04:07:55Z\",\"message\":\"fyut\"},{\"timestamp\":\"2021-06-24T14:07:57Z\",\"message\":\"gbpvnwswmtxkyct\"}],\"fqdn\":\"gzwx\",\"customDomains\":[{\"name\":\"ecvo\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"yvneeza\"},{\"name\":\"fg\",\"bindingType\":\"Auto\",\"certificateId\":\"qqtlffhzbkrkj\"},{\"name\":\"javfqn\",\"bindingType\":\"Auto\",\"certificateId\":\"oe\"},{\"name\":\"dogiyetesyp\",\"bindingType\":\"Disabled\",\"certificateId\":\"ztjhqtfbovnynkbw\"}],\"rules\":[{\"targets\":[{\"containerApp\":\"hpsprkzyaupiac\",\"revision\":\"n\",\"label\":\"bwqroohtuovm\"},{\"containerApp\":\"onurjtumghihpv\",\"revision\":\"mslclblyjxlt\",\"label\":\"juscvsfx\"},{\"containerApp\":\"gctmgxuupbezq\",\"revision\":\"ydrtc\",\"label\":\"kdqkkyihzt\"},{\"containerApp\":\"eq\",\"revision\":\"qzgwldoychil\",\"label\":\"ecfehuwa\"}],\"routes\":[{\"match\":{},\"action\":{}}],\"description\":\"cqlliz\"},{\"targets\":[{\"containerApp\":\"csjvhrwef\",\"revision\":\"wqejpmvsse\",\"label\":\"epwamcxtcz\"}],\"routes\":[{\"match\":{},\"action\":{}},{\"match\":{},\"action\":{}}],\"description\":\"jduyyespydjfb\"},{\"targets\":[{\"containerApp\":\"v\",\"revision\":\"ulrtywikdmh\",\"label\":\"kuflgbh\"}],\"routes\":[{\"match\":{},\"action\":{}},{\"match\":{},\"action\":{}},{\"match\":{},\"action\":{}}],\"description\":\"ufr\"}]},\"id\":\"yjq\",\"name\":\"dkfnozoeoqbvj\",\"type\":\"vefgwbmqjchntas\"}") .toObject(HttpRouteConfigInner.class); - Assertions.assertEquals("hokzrusw", model.properties().customDomains().get(0).name()); - Assertions.assertEquals(BindingType.DISABLED, model.properties().customDomains().get(0).bindingType()); - Assertions.assertEquals("zznvfbyc", model.properties().customDomains().get(0).certificateId()); - Assertions.assertEquals("wix", model.properties().rules().get(0).targets().get(0).containerApp()); - Assertions.assertEquals("umwmxqhnd", model.properties().rules().get(0).targets().get(0).revision()); - Assertions.assertEquals("oamld", model.properties().rules().get(0).targets().get(0).label()); - Assertions.assertEquals("ccsrmozihmipgaw", model.properties().rules().get(0).description()); + Assertions.assertEquals("ecvo", model.properties().customDomains().get(0).name()); + Assertions.assertEquals(BindingType.SNI_ENABLED, model.properties().customDomains().get(0).bindingType()); + Assertions.assertEquals("yvneeza", model.properties().customDomains().get(0).certificateId()); + Assertions.assertEquals("hpsprkzyaupiac", model.properties().rules().get(0).targets().get(0).containerApp()); + Assertions.assertEquals("n", model.properties().rules().get(0).targets().get(0).revision()); + Assertions.assertEquals("bwqroohtuovm", model.properties().rules().get(0).targets().get(0).label()); + Assertions.assertEquals("cqlliz", model.properties().rules().get(0).description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { HttpRouteConfigInner model = new HttpRouteConfigInner().withProperties(new HttpRouteConfigProperties() - .withCustomDomains(Arrays.asList(new CustomDomain().withName("hokzrusw") - .withBindingType(BindingType.DISABLED) - .withCertificateId("zznvfbyc"))) - .withRules(Arrays.asList(new HttpRouteRule() - .withTargets(Arrays.asList( - new HttpRouteTarget().withContainerApp("wix").withRevision("umwmxqhnd").withLabel("oamld"), - new HttpRouteTarget().withContainerApp("ehaohdjhh").withRevision("z").withLabel("xcoxpelnjet"), - new HttpRouteTarget().withContainerApp("gltsxoat").withRevision("g").withLabel("npbs"))) + .withCustomDomains(Arrays.asList(new CustomDomain().withName("ecvo") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId("yvneeza"), + new CustomDomain().withName("fg").withBindingType(BindingType.AUTO).withCertificateId("qqtlffhzbkrkj"), + new CustomDomain().withName("javfqn").withBindingType(BindingType.AUTO).withCertificateId("oe"), + new CustomDomain().withName("dogiyetesyp") + .withBindingType(BindingType.DISABLED) + .withCertificateId("ztjhqtfbovnynkbw"))) + .withRules(Arrays.asList(new HttpRouteRule().withTargets(Arrays.asList( + new HttpRouteTarget().withContainerApp("hpsprkzyaupiac").withRevision("n").withLabel("bwqroohtuovm"), + new HttpRouteTarget().withContainerApp("onurjtumghihpv") + .withRevision("mslclblyjxlt") + .withLabel("juscvsfx"), + new HttpRouteTarget().withContainerApp("gctmgxuupbezq").withRevision("ydrtc").withLabel("kdqkkyihzt"), + new HttpRouteTarget().withContainerApp("eq").withRevision("qzgwldoychil").withLabel("ecfehuwa"))) .withRoutes( Arrays.asList(new HttpRoute().withMatch(new HttpRouteMatch()).withAction(new HttpRouteAction()))) - .withDescription("ccsrmozihmipgaw")))); + .withDescription("cqlliz"), + new HttpRouteRule() + .withTargets(Arrays.asList(new HttpRouteTarget().withContainerApp("csjvhrwef") + .withRevision("wqejpmvsse") + .withLabel("epwamcxtcz"))) + .withRoutes( + Arrays.asList(new HttpRoute().withMatch(new HttpRouteMatch()).withAction(new HttpRouteAction()), + new HttpRoute().withMatch(new HttpRouteMatch()).withAction(new HttpRouteAction()))) + .withDescription("jduyyespydjfb"), + new HttpRouteRule() + .withTargets(Arrays.asList( + new HttpRouteTarget().withContainerApp("v").withRevision("ulrtywikdmh").withLabel("kuflgbh"))) + .withRoutes( + Arrays.asList(new HttpRoute().withMatch(new HttpRouteMatch()).withAction(new HttpRouteAction()), + new HttpRoute().withMatch(new HttpRouteMatch()).withAction(new HttpRouteAction()), + new HttpRoute().withMatch(new HttpRouteMatch()).withAction(new HttpRouteAction()))) + .withDescription("ufr")))); model = BinaryData.fromObject(model).toObject(HttpRouteConfigInner.class); - Assertions.assertEquals("hokzrusw", model.properties().customDomains().get(0).name()); - Assertions.assertEquals(BindingType.DISABLED, model.properties().customDomains().get(0).bindingType()); - Assertions.assertEquals("zznvfbyc", model.properties().customDomains().get(0).certificateId()); - Assertions.assertEquals("wix", model.properties().rules().get(0).targets().get(0).containerApp()); - Assertions.assertEquals("umwmxqhnd", model.properties().rules().get(0).targets().get(0).revision()); - Assertions.assertEquals("oamld", model.properties().rules().get(0).targets().get(0).label()); - Assertions.assertEquals("ccsrmozihmipgaw", model.properties().rules().get(0).description()); + Assertions.assertEquals("ecvo", model.properties().customDomains().get(0).name()); + Assertions.assertEquals(BindingType.SNI_ENABLED, model.properties().customDomains().get(0).bindingType()); + Assertions.assertEquals("yvneeza", model.properties().customDomains().get(0).certificateId()); + Assertions.assertEquals("hpsprkzyaupiac", model.properties().rules().get(0).targets().get(0).containerApp()); + Assertions.assertEquals("n", model.properties().rules().get(0).targets().get(0).revision()); + Assertions.assertEquals("bwqroohtuovm", model.properties().rules().get(0).targets().get(0).label()); + Assertions.assertEquals("cqlliz", model.properties().rules().get(0).description()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigPropertiesTests.java index f110cf592f9a..454c69a23300 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigPropertiesTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -20,56 +20,81 @@ public final class HttpRouteConfigPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { HttpRouteConfigProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Succeeded\",\"provisioningErrors\":[{\"timestamp\":\"2021-04-03T18:07:22Z\",\"message\":\"lrmcaykg\"}],\"fqdn\":\"oxuztrksx\",\"customDomains\":[{\"name\":\"d\",\"bindingType\":\"Disabled\",\"certificateId\":\"nznthjtw\"},{\"name\":\"jaosrxuzv\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"tcqiosmg\"}],\"rules\":[{\"targets\":[{\"containerApp\":\"xqdlyrtltlapr\",\"revision\":\"zkatb\",\"label\":\"mznnbsoqeqalarvl\"}],\"routes\":[{\"match\":{\"prefix\":\"tgfebwln\",\"path\":\"hyreeu\",\"pathSeparatedPrefix\":\"qavbpdqmj\",\"caseSensitive\":true},\"action\":{\"prefixRewrite\":\"glgou\"}}],\"description\":\"lmjjyuo\"}]}") + "{\"provisioningState\":\"Failed\",\"provisioningErrors\":[{\"timestamp\":\"2021-01-27T07:43:19Z\",\"message\":\"pzealbmqkyojw\"},{\"timestamp\":\"2021-12-04T15:32:33Z\",\"message\":\"mbtsuahxsg\"},{\"timestamp\":\"2021-05-26T19:56:29Z\",\"message\":\"mzrrscubiwsdrn\"},{\"timestamp\":\"2021-03-23T14:45:37Z\",\"message\":\"odiffjxcjrmmua\"}],\"fqdn\":\"ibvjogjonmcy\",\"customDomains\":[{\"name\":\"y\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"wine\"},{\"name\":\"fvfkak\",\"bindingType\":\"Auto\",\"certificateId\":\"t\"},{\"name\":\"evboclzhzjknyuxg\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"pnrupzaamrdi\"},{\"name\":\"trekidswys\",\"bindingType\":\"Disabled\",\"certificateId\":\"ffg\"}],\"rules\":[{\"targets\":[{\"containerApp\":\"utvlxhr\",\"revision\":\"hvmblcouqehbhbc\",\"label\":\"ziryrandoy\"},{\"containerApp\":\"mbltoo\",\"revision\":\"kfqlwx\",\"label\":\"ykalsyga\"},{\"containerApp\":\"lnjpnnbmjksibjgs\",\"revision\":\"xxahmrnadzyqegxy\",\"label\":\"pinbmhwbjijkgqxn\"}],\"routes\":[{\"match\":{\"prefix\":\"znj\",\"path\":\"jvaannggiycwkd\",\"pathSeparatedPrefix\":\"awxwfek\",\"caseSensitive\":true},\"action\":{\"prefixRewrite\":\"qmbzmq\"}},{\"match\":{\"prefix\":\"tbnxwbjsid\",\"path\":\"rkfpks\",\"pathSeparatedPrefix\":\"dgo\",\"caseSensitive\":false},\"action\":{\"prefixRewrite\":\"ym\"}}],\"description\":\"bguzozky\"},{\"targets\":[{\"containerApp\":\"f\",\"revision\":\"hhhqosm\",\"label\":\"jkutycyarnr\"},{\"containerApp\":\"ohguabz\",\"revision\":\"hkt\",\"label\":\"yczhco\"}],\"routes\":[{\"match\":{\"prefix\":\"zqro\",\"path\":\"jzcfyjzptwr\",\"pathSeparatedPrefix\":\"h\",\"caseSensitive\":true},\"action\":{\"prefixRewrite\":\"fs\"}}],\"description\":\"yglqdhmrjzral\"}]}") .toObject(HttpRouteConfigProperties.class); - Assertions.assertEquals("d", model.customDomains().get(0).name()); - Assertions.assertEquals(BindingType.DISABLED, model.customDomains().get(0).bindingType()); - Assertions.assertEquals("nznthjtw", model.customDomains().get(0).certificateId()); - Assertions.assertEquals("xqdlyrtltlapr", model.rules().get(0).targets().get(0).containerApp()); - Assertions.assertEquals("zkatb", model.rules().get(0).targets().get(0).revision()); - Assertions.assertEquals("mznnbsoqeqalarvl", model.rules().get(0).targets().get(0).label()); - Assertions.assertEquals("tgfebwln", model.rules().get(0).routes().get(0).match().prefix()); - Assertions.assertEquals("hyreeu", model.rules().get(0).routes().get(0).match().path()); - Assertions.assertEquals("qavbpdqmj", model.rules().get(0).routes().get(0).match().pathSeparatedPrefix()); + Assertions.assertEquals("y", model.customDomains().get(0).name()); + Assertions.assertEquals(BindingType.SNI_ENABLED, model.customDomains().get(0).bindingType()); + Assertions.assertEquals("wine", model.customDomains().get(0).certificateId()); + Assertions.assertEquals("utvlxhr", model.rules().get(0).targets().get(0).containerApp()); + Assertions.assertEquals("hvmblcouqehbhbc", model.rules().get(0).targets().get(0).revision()); + Assertions.assertEquals("ziryrandoy", model.rules().get(0).targets().get(0).label()); + Assertions.assertEquals("znj", model.rules().get(0).routes().get(0).match().prefix()); + Assertions.assertEquals("jvaannggiycwkd", model.rules().get(0).routes().get(0).match().path()); + Assertions.assertEquals("awxwfek", model.rules().get(0).routes().get(0).match().pathSeparatedPrefix()); Assertions.assertTrue(model.rules().get(0).routes().get(0).match().caseSensitive()); - Assertions.assertEquals("glgou", model.rules().get(0).routes().get(0).action().prefixRewrite()); - Assertions.assertEquals("lmjjyuo", model.rules().get(0).description()); + Assertions.assertEquals("qmbzmq", model.rules().get(0).routes().get(0).action().prefixRewrite()); + Assertions.assertEquals("bguzozky", model.rules().get(0).description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - HttpRouteConfigProperties model = new HttpRouteConfigProperties() - .withCustomDomains(Arrays.asList( - new CustomDomain().withName("d").withBindingType(BindingType.DISABLED).withCertificateId("nznthjtw"), - new CustomDomain().withName("jaosrxuzv") - .withBindingType(BindingType.SNI_ENABLED) - .withCertificateId("tcqiosmg"))) - .withRules( - Arrays - .asList( - new HttpRouteRule() - .withTargets(Arrays.asList(new HttpRouteTarget().withContainerApp("xqdlyrtltlapr") - .withRevision("zkatb") - .withLabel("mznnbsoqeqalarvl"))) - .withRoutes(Arrays.asList(new HttpRoute() - .withMatch(new HttpRouteMatch().withPrefix("tgfebwln") - .withPath("hyreeu") - .withPathSeparatedPrefix("qavbpdqmj") + HttpRouteConfigProperties model = new HttpRouteConfigProperties().withCustomDomains(Arrays.asList( + new CustomDomain().withName("y").withBindingType(BindingType.SNI_ENABLED).withCertificateId("wine"), + new CustomDomain().withName("fvfkak").withBindingType(BindingType.AUTO).withCertificateId("t"), + new CustomDomain().withName("evboclzhzjknyuxg") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId("pnrupzaamrdi"), + new CustomDomain().withName("trekidswys").withBindingType(BindingType.DISABLED).withCertificateId("ffg"))) + .withRules(Arrays.asList( + new HttpRouteRule() + .withTargets(Arrays.asList( + new HttpRouteTarget().withContainerApp("utvlxhr") + .withRevision("hvmblcouqehbhbc") + .withLabel("ziryrandoy"), + new HttpRouteTarget().withContainerApp("mbltoo").withRevision("kfqlwx").withLabel("ykalsyga"), + new HttpRouteTarget().withContainerApp("lnjpnnbmjksibjgs") + .withRevision("xxahmrnadzyqegxy") + .withLabel("pinbmhwbjijkgqxn"))) + .withRoutes( + Arrays.asList( + new HttpRoute() + .withMatch(new HttpRouteMatch().withPrefix("znj") + .withPath("jvaannggiycwkd") + .withPathSeparatedPrefix("awxwfek") .withCaseSensitive(true)) - .withAction(new HttpRouteAction().withPrefixRewrite("glgou")))) - .withDescription("lmjjyuo"))); + .withAction(new HttpRouteAction().withPrefixRewrite("qmbzmq")), + new HttpRoute() + .withMatch(new HttpRouteMatch().withPrefix("tbnxwbjsid") + .withPath("rkfpks") + .withPathSeparatedPrefix("dgo") + .withCaseSensitive(false)) + .withAction(new HttpRouteAction().withPrefixRewrite("ym")))) + .withDescription("bguzozky"), + new HttpRouteRule() + .withTargets(Arrays.asList( + new HttpRouteTarget().withContainerApp("f").withRevision("hhhqosm").withLabel("jkutycyarnr"), + new HttpRouteTarget().withContainerApp("ohguabz").withRevision("hkt").withLabel("yczhco"))) + .withRoutes( + Arrays + .asList(new HttpRoute() + .withMatch(new HttpRouteMatch().withPrefix("zqro") + .withPath("jzcfyjzptwr") + .withPathSeparatedPrefix("h") + .withCaseSensitive(true)) + .withAction(new HttpRouteAction().withPrefixRewrite("fs")))) + .withDescription("yglqdhmrjzral"))); model = BinaryData.fromObject(model).toObject(HttpRouteConfigProperties.class); - Assertions.assertEquals("d", model.customDomains().get(0).name()); - Assertions.assertEquals(BindingType.DISABLED, model.customDomains().get(0).bindingType()); - Assertions.assertEquals("nznthjtw", model.customDomains().get(0).certificateId()); - Assertions.assertEquals("xqdlyrtltlapr", model.rules().get(0).targets().get(0).containerApp()); - Assertions.assertEquals("zkatb", model.rules().get(0).targets().get(0).revision()); - Assertions.assertEquals("mznnbsoqeqalarvl", model.rules().get(0).targets().get(0).label()); - Assertions.assertEquals("tgfebwln", model.rules().get(0).routes().get(0).match().prefix()); - Assertions.assertEquals("hyreeu", model.rules().get(0).routes().get(0).match().path()); - Assertions.assertEquals("qavbpdqmj", model.rules().get(0).routes().get(0).match().pathSeparatedPrefix()); + Assertions.assertEquals("y", model.customDomains().get(0).name()); + Assertions.assertEquals(BindingType.SNI_ENABLED, model.customDomains().get(0).bindingType()); + Assertions.assertEquals("wine", model.customDomains().get(0).certificateId()); + Assertions.assertEquals("utvlxhr", model.rules().get(0).targets().get(0).containerApp()); + Assertions.assertEquals("hvmblcouqehbhbc", model.rules().get(0).targets().get(0).revision()); + Assertions.assertEquals("ziryrandoy", model.rules().get(0).targets().get(0).label()); + Assertions.assertEquals("znj", model.rules().get(0).routes().get(0).match().prefix()); + Assertions.assertEquals("jvaannggiycwkd", model.rules().get(0).routes().get(0).match().path()); + Assertions.assertEquals("awxwfek", model.rules().get(0).routes().get(0).match().pathSeparatedPrefix()); Assertions.assertTrue(model.rules().get(0).routes().get(0).match().caseSensitive()); - Assertions.assertEquals("glgou", model.rules().get(0).routes().get(0).action().prefixRewrite()); - Assertions.assertEquals("lmjjyuo", model.rules().get(0).description()); + Assertions.assertEquals("qmbzmq", model.rules().get(0).routes().get(0).action().prefixRewrite()); + Assertions.assertEquals("bguzozky", model.rules().get(0).description()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigsCreateOrUpdateWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigsCreateOrUpdateWithResponseMockTests.java index 92738654cfdc..a01d14af512d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigsCreateOrUpdateWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -28,7 +28,7 @@ public final class HttpRouteConfigsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Updating\",\"provisioningErrors\":[{\"timestamp\":\"2021-11-13T04:32:20Z\",\"message\":\"wixvtbouguxtndop\"}],\"fqdn\":\"ttbas\",\"customDomains\":[{\"name\":\"ap\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"bea\"},{\"name\":\"bkixvvlwyn\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"qvzfj\"}],\"rules\":[{\"targets\":[{\"containerApp\":\"zfe\"},{\"containerApp\":\"zjljmphfk\"}],\"routes\":[{},{},{},{}],\"description\":\"lgjzmi\"}]},\"id\":\"ydoccnxshanzb\",\"name\":\"iadhbatec\",\"type\":\"atsdohzniucbdaom\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"provisioningErrors\":[{\"timestamp\":\"2021-05-31T10:44:35Z\",\"message\":\"bzyvbsua\"},{\"timestamp\":\"2021-11-08T14:45:10Z\",\"message\":\"odkaxpfobkzhm\"},{\"timestamp\":\"2021-05-18T03:22:09Z\",\"message\":\"lt\"},{\"timestamp\":\"2021-03-19T03:45:34Z\",\"message\":\"qrojadhfztlray\"}],\"fqdn\":\"kg\",\"customDomains\":[{\"name\":\"hudbkuwpzqxlcw\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"ecjvxf\"}],\"rules\":[{\"targets\":[{\"containerApp\":\"izjv\"},{\"containerApp\":\"pwooajeyyj\"}],\"routes\":[{},{}],\"description\":\"izxpxhnzlsle\"},{\"targets\":[{\"containerApp\":\"tgzkjtyqpd\"},{\"containerApp\":\"adeghztldsvc\"},{\"containerApp\":\"djiah\"}],\"routes\":[{},{}],\"description\":\"jzucwwm\"},{\"targets\":[{\"containerApp\":\"qhdd\"},{\"containerApp\":\"vmqxi\"},{\"containerApp\":\"ookyfoz\"},{\"containerApp\":\"bn\"}],\"routes\":[{}],\"description\":\"pfqpgaixw\"}]},\"id\":\"rkkderfrswqikw\",\"name\":\"pw\",\"type\":\"g\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -38,43 +38,30 @@ public void testCreateOrUpdateWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); HttpRouteConfig response = manager.httpRouteConfigs() - .define("lqxov") - .withExistingManagedEnvironment("foxqwecrsn", "pcs") - .withProperties(new HttpRouteConfigProperties().withCustomDomains(Arrays.asList( - new CustomDomain().withName("zkxitd").withBindingType(BindingType.AUTO).withCertificateId("svkolru"), - new CustomDomain().withName("jovmozsaye") - .withBindingType(BindingType.SNI_ENABLED) - .withCertificateId("wzlpzbtz"))) + .define("doey") + .withExistingManagedEnvironment("o", "walzyxwhoeamoeo") + .withProperties(new HttpRouteConfigProperties() + .withCustomDomains(Arrays.asList(new CustomDomain().withName("rrkuumnqd") + .withBindingType(BindingType.DISABLED) + .withCertificateId("zfop"))) .withRules(Arrays.asList( new HttpRouteRule() - .withTargets(Arrays.asList(new HttpRouteTarget().withContainerApp("ip"), - new HttpRouteTarget().withContainerApp("sdyepfno"), - new HttpRouteTarget().withContainerApp("mbezacfpztg"))) - .withRoutes(Arrays.asList(new HttpRoute(), new HttpRoute(), new HttpRoute())) - .withDescription("qejg"), - new HttpRouteRule() - .withTargets(Arrays.asList(new HttpRouteTarget().withContainerApp("kctgkp"), - new HttpRouteTarget().withContainerApp("gkqzkcyzmffngdyf"), - new HttpRouteTarget().withContainerApp("ixrhl"), - new HttpRouteTarget().withContainerApp("qvhoej"))) - .withRoutes(Arrays.asList(new HttpRoute())) - .withDescription("tgwrmkahpqha"), - new HttpRouteRule() - .withTargets(Arrays.asList(new HttpRouteTarget().withContainerApp("tac"), - new HttpRouteTarget().withContainerApp("hncogmipnml"))) + .withTargets(Arrays.asList(new HttpRouteTarget().withContainerApp("svwlujop"), + new HttpRouteTarget().withContainerApp("nibittoztjdqumq"))) .withRoutes(Arrays.asList(new HttpRoute(), new HttpRoute(), new HttpRoute(), new HttpRoute())) - .withDescription("lbhik"), + .withDescription("caddtgc"), new HttpRouteRule() - .withTargets(Arrays.asList(new HttpRouteTarget().withContainerApp("grvgpomxp"), - new HttpRouteTarget().withContainerApp("pdtsdfjyiesocwi"))) - .withRoutes(Arrays.asList(new HttpRoute(), new HttpRoute())) - .withDescription("utmp")))) + .withTargets(Arrays.asList(new HttpRouteTarget().withContainerApp("gtvgwyu"), + new HttpRouteTarget().withContainerApp("be"), + new HttpRouteTarget().withContainerApp("fnzzryizwbxg"))) + .withRoutes(Arrays.asList(new HttpRoute(), new HttpRoute(), new HttpRoute(), new HttpRoute())) + .withDescription("layunomirhpfabe")))) .create(); - Assertions.assertEquals("ap", response.properties().customDomains().get(0).name()); + Assertions.assertEquals("hudbkuwpzqxlcw", response.properties().customDomains().get(0).name()); Assertions.assertEquals(BindingType.SNI_ENABLED, response.properties().customDomains().get(0).bindingType()); - Assertions.assertEquals("bea", response.properties().customDomains().get(0).certificateId()); - Assertions.assertEquals("zfe", response.properties().rules().get(0).targets().get(0).containerApp()); - Assertions.assertEquals("lgjzmi", response.properties().rules().get(0).description()); + Assertions.assertEquals("ecjvxf", response.properties().customDomains().get(0).certificateId()); + Assertions.assertEquals("izjv", response.properties().rules().get(0).targets().get(0).containerApp()); + Assertions.assertEquals("izxpxhnzlsle", response.properties().rules().get(0).description()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigsGetWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigsGetWithResponseMockTests.java index 25f53b8e95cc..b619673dae9f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigsGetWithResponseMockTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigsGetWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -22,7 +22,7 @@ public final class HttpRouteConfigsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Canceled\",\"provisioningErrors\":[{\"timestamp\":\"2021-10-11T19:11:58Z\",\"message\":\"y\"}],\"fqdn\":\"jahwriuomzczf\",\"customDomains\":[{\"name\":\"eevsa\",\"bindingType\":\"Auto\",\"certificateId\":\"p\"},{\"name\":\"axikhfjqebglcxk\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"romv\"}],\"rules\":[{\"targets\":[{\"containerApp\":\"mtmesrfsv\"}],\"routes\":[{},{},{},{}],\"description\":\"zpatqtd\"},{\"targets\":[{\"containerApp\":\"xspvckojazb\"},{\"containerApp\":\"gspftesu\"},{\"containerApp\":\"zpvpvdyly\"}],\"routes\":[{},{},{},{}],\"description\":\"qseusrfjbdxzfxnx\"},{\"targets\":[{\"containerApp\":\"muoswkjmdih\"}],\"routes\":[{},{},{}],\"description\":\"yzlwhbwzjnufzrf\"},{\"targets\":[{\"containerApp\":\"qgnnbz\"}],\"routes\":[{},{},{},{}],\"description\":\"edzuub\"}]},\"id\":\"vgjs\",\"name\":\"mt\",\"type\":\"jjvavdpww\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"provisioningErrors\":[{\"timestamp\":\"2021-07-18T04:33:40Z\",\"message\":\"cdq\"},{\"timestamp\":\"2021-01-17T16:18:13Z\",\"message\":\"whrktjleifibfipl\"}],\"fqdn\":\"fnsmycjowly\",\"customDomains\":[{\"name\":\"mudsqcmhnxl\",\"bindingType\":\"Auto\",\"certificateId\":\"o\"},{\"name\":\"machbkv\",\"bindingType\":\"Auto\",\"certificateId\":\"j\"}],\"rules\":[{\"targets\":[{\"containerApp\":\"qplehmumkzdllczd\"}],\"routes\":[{},{}],\"description\":\"hkgqggoxsst\"},{\"targets\":[{\"containerApp\":\"rak\"}],\"routes\":[{}],\"description\":\"njcwmhly\"}]},\"id\":\"nukxrkemjp\",\"name\":\"qu\",\"type\":\"rlzaudg\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,13 +32,14 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); HttpRouteConfig response = manager.httpRouteConfigs() - .getWithResponse("clrvtzqnrbctbh", "jhxpcvrd", "y", com.azure.core.util.Context.NONE) + .getWithResponse("zqjim", "jtgzj", "xlfejlzuqloiwya", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("eevsa", response.properties().customDomains().get(0).name()); + Assertions.assertEquals("mudsqcmhnxl", response.properties().customDomains().get(0).name()); Assertions.assertEquals(BindingType.AUTO, response.properties().customDomains().get(0).bindingType()); - Assertions.assertEquals("p", response.properties().customDomains().get(0).certificateId()); - Assertions.assertEquals("mtmesrfsv", response.properties().rules().get(0).targets().get(0).containerApp()); - Assertions.assertEquals("zpatqtd", response.properties().rules().get(0).description()); + Assertions.assertEquals("o", response.properties().customDomains().get(0).certificateId()); + Assertions.assertEquals("qplehmumkzdllczd", + response.properties().rules().get(0).targets().get(0).containerApp()); + Assertions.assertEquals("hkgqggoxsst", response.properties().rules().get(0).description()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigsListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigsListMockTests.java index 783eb67ac0fa..dd33895ef0b7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigsListMockTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteConfigsListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -23,7 +23,7 @@ public final class HttpRouteConfigsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"provisioningErrors\":[{\"timestamp\":\"2021-05-09T06:58:48Z\",\"message\":\"riwgybjp\"}],\"fqdn\":\"ok\",\"customDomains\":[{\"name\":\"gllixdgbyfgwew\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"xprwpxs\"},{\"name\":\"ohutxlcsk\",\"bindingType\":\"Auto\",\"certificateId\":\"uugggzlfbgrd\"},{\"name\":\"gubsrtmdylpe\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"ttjzg\"}],\"rules\":[{\"targets\":[{\"containerApp\":\"fpfbodetres\"}],\"routes\":[{},{}],\"description\":\"shuvftwaivmuqkev\"}]},\"id\":\"jypanhxmpdxxzet\",\"name\":\"wzjwotnxlkfhg\",\"type\":\"h\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"provisioningErrors\":[{\"timestamp\":\"2021-09-20T08:01:22Z\",\"message\":\"qwwvgwkslvl\"},{\"timestamp\":\"2021-11-25T15:37:55Z\",\"message\":\"vbia\"}],\"fqdn\":\"n\",\"customDomains\":[{\"name\":\"ekzyqxadyfhb\",\"bindingType\":\"Auto\",\"certificateId\":\"ojqttbsp\"}],\"rules\":[{\"targets\":[{\"containerApp\":\"aqjsgyzstujr\"},{\"containerApp\":\"xrk\"},{\"containerApp\":\"sf\"},{\"containerApp\":\"rlduyehiiittugy\"}],\"routes\":[{},{}],\"description\":\"lda\"}]},\"id\":\"rfqazcsozjv\",\"name\":\"dzciggb\",\"type\":\"vt\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,17 +33,15 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.httpRouteConfigs().list("btdphti", "sffofwanmhksca", com.azure.core.util.Context.NONE); + = manager.httpRouteConfigs().list("tfbclakkuc", "dwnhczbutoucgjti", com.azure.core.util.Context.NONE); - Assertions.assertEquals("gllixdgbyfgwew", - response.iterator().next().properties().customDomains().get(0).name()); - Assertions.assertEquals(BindingType.SNI_ENABLED, + Assertions.assertEquals("ekzyqxadyfhb", response.iterator().next().properties().customDomains().get(0).name()); + Assertions.assertEquals(BindingType.AUTO, response.iterator().next().properties().customDomains().get(0).bindingType()); - Assertions.assertEquals("xprwpxs", + Assertions.assertEquals("ojqttbsp", response.iterator().next().properties().customDomains().get(0).certificateId()); - Assertions.assertEquals("fpfbodetres", + Assertions.assertEquals("aqjsgyzstujr", response.iterator().next().properties().rules().get(0).targets().get(0).containerApp()); - Assertions.assertEquals("shuvftwaivmuqkev", - response.iterator().next().properties().rules().get(0).description()); + Assertions.assertEquals("lda", response.iterator().next().properties().rules().get(0).description()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteMatchTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteMatchTests.java index 0641958ccb41..639f60ea1bc7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteMatchTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteMatchTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,24 +12,24 @@ public final class HttpRouteMatchTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { HttpRouteMatch model = BinaryData.fromString( - "{\"prefix\":\"unjdx\",\"path\":\"lnkvxlx\",\"pathSeparatedPrefix\":\"glqivbgkcv\",\"caseSensitive\":true}") + "{\"prefix\":\"gyipem\",\"path\":\"gavsczuejd\",\"pathSeparatedPrefix\":\"ptlghwzhomewjjst\",\"caseSensitive\":true}") .toObject(HttpRouteMatch.class); - Assertions.assertEquals("unjdx", model.prefix()); - Assertions.assertEquals("lnkvxlx", model.path()); - Assertions.assertEquals("glqivbgkcv", model.pathSeparatedPrefix()); + Assertions.assertEquals("gyipem", model.prefix()); + Assertions.assertEquals("gavsczuejd", model.path()); + Assertions.assertEquals("ptlghwzhomewjjst", model.pathSeparatedPrefix()); Assertions.assertTrue(model.caseSensitive()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - HttpRouteMatch model = new HttpRouteMatch().withPrefix("unjdx") - .withPath("lnkvxlx") - .withPathSeparatedPrefix("glqivbgkcv") + HttpRouteMatch model = new HttpRouteMatch().withPrefix("gyipem") + .withPath("gavsczuejd") + .withPathSeparatedPrefix("ptlghwzhomewjjst") .withCaseSensitive(true); model = BinaryData.fromObject(model).toObject(HttpRouteMatch.class); - Assertions.assertEquals("unjdx", model.prefix()); - Assertions.assertEquals("lnkvxlx", model.path()); - Assertions.assertEquals("glqivbgkcv", model.pathSeparatedPrefix()); + Assertions.assertEquals("gyipem", model.prefix()); + Assertions.assertEquals("gavsczuejd", model.path()); + Assertions.assertEquals("ptlghwzhomewjjst", model.pathSeparatedPrefix()); Assertions.assertTrue(model.caseSensitive()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteProvisioningErrorsTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteProvisioningErrorsTests.java index 8186944c6669..5c517abb82c8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteProvisioningErrorsTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteProvisioningErrorsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,13 +11,7 @@ public final class HttpRouteProvisioningErrorsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { HttpRouteProvisioningErrors model - = BinaryData.fromString("{\"timestamp\":\"2021-02-27T03:40:46Z\",\"message\":\"baxk\"}") + = BinaryData.fromString("{\"timestamp\":\"2021-09-12T07:50:01Z\",\"message\":\"byypsjoqcjenky\"}") .toObject(HttpRouteProvisioningErrors.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HttpRouteProvisioningErrors model = new HttpRouteProvisioningErrors(); - model = BinaryData.fromObject(model).toObject(HttpRouteProvisioningErrors.class); - } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteRuleTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteRuleTests.java index ba9a6d82f60c..93c0e0688d36 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteRuleTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteRuleTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -17,63 +17,49 @@ public final class HttpRouteRuleTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { HttpRouteRule model = BinaryData.fromString( - "{\"targets\":[{\"containerApp\":\"tu\",\"revision\":\"bfjkw\",\"label\":\"snkq\"},{\"containerApp\":\"hsyrqunj\",\"revision\":\"denxau\",\"label\":\"pakdkifmjnnawt\"},{\"containerApp\":\"abpxuc\",\"revision\":\"ggqowey\",\"label\":\"dhlisngwflqqmpi\"}],\"routes\":[{\"match\":{\"prefix\":\"pqxpx\",\"path\":\"fcngjsa\",\"pathSeparatedPrefix\":\"iixtmkzj\",\"caseSensitive\":true},\"action\":{\"prefixRewrite\":\"rhgfgrwsdpgrat\"}},{\"match\":{\"prefix\":\"bglbyvict\",\"path\":\"brxkjzwr\",\"pathSeparatedPrefix\":\"ffm\",\"caseSensitive\":false},\"action\":{\"prefixRewrite\":\"bkgozxwopdbydpi\"}},{\"match\":{\"prefix\":\"clnapxbiygnugjkn\",\"path\":\"mfcttux\",\"pathSeparatedPrefix\":\"yilflqoiquvrehmr\",\"caseSensitive\":false},\"action\":{\"prefixRewrite\":\"ujztcz\"}},{\"match\":{\"prefix\":\"jtwhauunf\",\"path\":\"njle\",\"pathSeparatedPrefix\":\"xsmrpddouifamow\",\"caseSensitive\":false},\"action\":{\"prefixRewrite\":\"knlqwzdvpiwhxqsz\"}}],\"description\":\"maajquhuxylr\"}") + "{\"targets\":[{\"containerApp\":\"zv\",\"revision\":\"xfxjelgcmpzqj\",\"label\":\"hqxu\"}],\"routes\":[{\"match\":{\"prefix\":\"co\",\"path\":\"i\",\"pathSeparatedPrefix\":\"s\",\"caseSensitive\":true},\"action\":{\"prefixRewrite\":\"szlbscm\"}},{\"match\":{\"prefix\":\"ijiufehgmvfln\",\"path\":\"v\",\"pathSeparatedPrefix\":\"xrerlniylylyf\",\"caseSensitive\":true},\"action\":{\"prefixRewrite\":\"gqztwhghmupgx\"}}],\"description\":\"tcdxabbujftaben\"}") .toObject(HttpRouteRule.class); - Assertions.assertEquals("tu", model.targets().get(0).containerApp()); - Assertions.assertEquals("bfjkw", model.targets().get(0).revision()); - Assertions.assertEquals("snkq", model.targets().get(0).label()); - Assertions.assertEquals("pqxpx", model.routes().get(0).match().prefix()); - Assertions.assertEquals("fcngjsa", model.routes().get(0).match().path()); - Assertions.assertEquals("iixtmkzj", model.routes().get(0).match().pathSeparatedPrefix()); + Assertions.assertEquals("zv", model.targets().get(0).containerApp()); + Assertions.assertEquals("xfxjelgcmpzqj", model.targets().get(0).revision()); + Assertions.assertEquals("hqxu", model.targets().get(0).label()); + Assertions.assertEquals("co", model.routes().get(0).match().prefix()); + Assertions.assertEquals("i", model.routes().get(0).match().path()); + Assertions.assertEquals("s", model.routes().get(0).match().pathSeparatedPrefix()); Assertions.assertTrue(model.routes().get(0).match().caseSensitive()); - Assertions.assertEquals("rhgfgrwsdpgrat", model.routes().get(0).action().prefixRewrite()); - Assertions.assertEquals("maajquhuxylr", model.description()); + Assertions.assertEquals("szlbscm", model.routes().get(0).action().prefixRewrite()); + Assertions.assertEquals("tcdxabbujftaben", model.description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - HttpRouteRule model = new HttpRouteRule() - .withTargets(Arrays.asList( - new HttpRouteTarget().withContainerApp("tu").withRevision("bfjkw").withLabel("snkq"), - new HttpRouteTarget().withContainerApp("hsyrqunj").withRevision("denxau").withLabel("pakdkifmjnnawt"), - new HttpRouteTarget().withContainerApp("abpxuc").withRevision("ggqowey").withLabel("dhlisngwflqqmpi"))) - .withRoutes( - Arrays - .asList( + HttpRouteRule model + = new HttpRouteRule() + .withTargets(Arrays.asList( + new HttpRouteTarget().withContainerApp("zv").withRevision("xfxjelgcmpzqj").withLabel("hqxu"))) + .withRoutes( + Arrays.asList( new HttpRoute() - .withMatch(new HttpRouteMatch().withPrefix("pqxpx") - .withPath("fcngjsa") - .withPathSeparatedPrefix("iixtmkzj") + .withMatch(new HttpRouteMatch().withPrefix("co") + .withPath("i") + .withPathSeparatedPrefix("s") .withCaseSensitive(true)) - .withAction(new HttpRouteAction().withPrefixRewrite("rhgfgrwsdpgrat")), + .withAction(new HttpRouteAction().withPrefixRewrite("szlbscm")), new HttpRoute() - .withMatch(new HttpRouteMatch().withPrefix("bglbyvict") - .withPath("brxkjzwr") - .withPathSeparatedPrefix("ffm") - .withCaseSensitive(false)) - .withAction(new HttpRouteAction().withPrefixRewrite("bkgozxwopdbydpi")), - new HttpRoute() - .withMatch(new HttpRouteMatch().withPrefix("clnapxbiygnugjkn") - .withPath("mfcttux") - .withPathSeparatedPrefix("yilflqoiquvrehmr") - .withCaseSensitive(false)) - .withAction(new HttpRouteAction().withPrefixRewrite("ujztcz")), - new HttpRoute() - .withMatch(new HttpRouteMatch().withPrefix("jtwhauunf") - .withPath("njle") - .withPathSeparatedPrefix("xsmrpddouifamow") - .withCaseSensitive(false)) - .withAction(new HttpRouteAction().withPrefixRewrite("knlqwzdvpiwhxqsz")))) - .withDescription("maajquhuxylr"); + .withMatch(new HttpRouteMatch().withPrefix("ijiufehgmvfln") + .withPath("v") + .withPathSeparatedPrefix("xrerlniylylyf") + .withCaseSensitive(true)) + .withAction(new HttpRouteAction().withPrefixRewrite("gqztwhghmupgx")))) + .withDescription("tcdxabbujftaben"); model = BinaryData.fromObject(model).toObject(HttpRouteRule.class); - Assertions.assertEquals("tu", model.targets().get(0).containerApp()); - Assertions.assertEquals("bfjkw", model.targets().get(0).revision()); - Assertions.assertEquals("snkq", model.targets().get(0).label()); - Assertions.assertEquals("pqxpx", model.routes().get(0).match().prefix()); - Assertions.assertEquals("fcngjsa", model.routes().get(0).match().path()); - Assertions.assertEquals("iixtmkzj", model.routes().get(0).match().pathSeparatedPrefix()); + Assertions.assertEquals("zv", model.targets().get(0).containerApp()); + Assertions.assertEquals("xfxjelgcmpzqj", model.targets().get(0).revision()); + Assertions.assertEquals("hqxu", model.targets().get(0).label()); + Assertions.assertEquals("co", model.routes().get(0).match().prefix()); + Assertions.assertEquals("i", model.routes().get(0).match().path()); + Assertions.assertEquals("s", model.routes().get(0).match().pathSeparatedPrefix()); Assertions.assertTrue(model.routes().get(0).match().caseSensitive()); - Assertions.assertEquals("rhgfgrwsdpgrat", model.routes().get(0).action().prefixRewrite()); - Assertions.assertEquals("maajquhuxylr", model.description()); + Assertions.assertEquals("szlbscm", model.routes().get(0).action().prefixRewrite()); + Assertions.assertEquals("tcdxabbujftaben", model.description()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteTargetTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteTargetTests.java index 089554c9284f..5d8a176b91ed 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteTargetTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteTargetTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,19 +12,20 @@ public final class HttpRouteTargetTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { HttpRouteTarget model - = BinaryData.fromString("{\"containerApp\":\"vmtygj\",\"revision\":\"zyos\",\"label\":\"p\"}") + = BinaryData.fromString("{\"containerApp\":\"bklqpxz\",\"revision\":\"afeddwwnlza\",\"label\":\"xud\"}") .toObject(HttpRouteTarget.class); - Assertions.assertEquals("vmtygj", model.containerApp()); - Assertions.assertEquals("zyos", model.revision()); - Assertions.assertEquals("p", model.label()); + Assertions.assertEquals("bklqpxz", model.containerApp()); + Assertions.assertEquals("afeddwwnlza", model.revision()); + Assertions.assertEquals("xud", model.label()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - HttpRouteTarget model = new HttpRouteTarget().withContainerApp("vmtygj").withRevision("zyos").withLabel("p"); + HttpRouteTarget model + = new HttpRouteTarget().withContainerApp("bklqpxz").withRevision("afeddwwnlza").withLabel("xud"); model = BinaryData.fromObject(model).toObject(HttpRouteTarget.class); - Assertions.assertEquals("vmtygj", model.containerApp()); - Assertions.assertEquals("zyos", model.revision()); - Assertions.assertEquals("p", model.label()); + Assertions.assertEquals("bklqpxz", model.containerApp()); + Assertions.assertEquals("afeddwwnlza", model.revision()); + Assertions.assertEquals("xud", model.label()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteTests.java index 68932c6184fd..532d9674af4e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpRouteTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -14,26 +14,26 @@ public final class HttpRouteTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { HttpRoute model = BinaryData.fromString( - "{\"match\":{\"prefix\":\"kfkyjp\",\"path\":\"pbpssdfpp\",\"pathSeparatedPrefix\":\"gt\",\"caseSensitive\":true},\"action\":{\"prefixRewrite\":\"tvczkcnyxr\"}}") + "{\"match\":{\"prefix\":\"gookrtalvnb\",\"path\":\"pbeme\",\"pathSeparatedPrefix\":\"clvdjjukyrdnqod\",\"caseSensitive\":false},\"action\":{\"prefixRewrite\":\"hqfaqnvz\"}}") .toObject(HttpRoute.class); - Assertions.assertEquals("kfkyjp", model.match().prefix()); - Assertions.assertEquals("pbpssdfpp", model.match().path()); - Assertions.assertEquals("gt", model.match().pathSeparatedPrefix()); - Assertions.assertTrue(model.match().caseSensitive()); - Assertions.assertEquals("tvczkcnyxr", model.action().prefixRewrite()); + Assertions.assertEquals("gookrtalvnb", model.match().prefix()); + Assertions.assertEquals("pbeme", model.match().path()); + Assertions.assertEquals("clvdjjukyrdnqod", model.match().pathSeparatedPrefix()); + Assertions.assertFalse(model.match().caseSensitive()); + Assertions.assertEquals("hqfaqnvz", model.action().prefixRewrite()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - HttpRoute model = new HttpRoute().withMatch(new HttpRouteMatch().withPrefix("kfkyjp") - .withPath("pbpssdfpp") - .withPathSeparatedPrefix("gt") - .withCaseSensitive(true)).withAction(new HttpRouteAction().withPrefixRewrite("tvczkcnyxr")); + HttpRoute model = new HttpRoute().withMatch(new HttpRouteMatch().withPrefix("gookrtalvnb") + .withPath("pbeme") + .withPathSeparatedPrefix("clvdjjukyrdnqod") + .withCaseSensitive(false)).withAction(new HttpRouteAction().withPrefixRewrite("hqfaqnvz")); model = BinaryData.fromObject(model).toObject(HttpRoute.class); - Assertions.assertEquals("kfkyjp", model.match().prefix()); - Assertions.assertEquals("pbpssdfpp", model.match().path()); - Assertions.assertEquals("gt", model.match().pathSeparatedPrefix()); - Assertions.assertTrue(model.match().caseSensitive()); - Assertions.assertEquals("tvczkcnyxr", model.action().prefixRewrite()); + Assertions.assertEquals("gookrtalvnb", model.match().prefix()); + Assertions.assertEquals("pbeme", model.match().path()); + Assertions.assertEquals("clvdjjukyrdnqod", model.match().pathSeparatedPrefix()); + Assertions.assertFalse(model.match().caseSensitive()); + Assertions.assertEquals("hqfaqnvz", model.action().prefixRewrite()); } } 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 index f6c7004ee180..f0f559eb2128 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,14 +12,14 @@ 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()); + = BinaryData.fromString("{\"apiPrefix\":\"fezrx\"}").toObject(HttpSettingsRoutes.class); + Assertions.assertEquals("fezrx", model.apiPrefix()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - HttpSettingsRoutes model = new HttpSettingsRoutes().withApiPrefix("soodqxhcrmnoh"); + HttpSettingsRoutes model = new HttpSettingsRoutes().withApiPrefix("fezrx"); model = BinaryData.fromObject(model).toObject(HttpSettingsRoutes.class); - Assertions.assertEquals("soodqxhcrmnoh", model.apiPrefix()); + Assertions.assertEquals("fezrx", 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 index a1c4f3952113..9cb16e22c608 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -15,27 +15,27 @@ 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\"}}") + "{\"requireHttps\":false,\"routes\":{\"apiPrefix\":\"vhdbevwqqxey\"},\"forwardProxy\":{\"convention\":\"Standard\",\"customHostHeaderName\":\"zinkfkbgbzbowxeq\",\"customProtoHeaderName\":\"ljmygvkzqkjjeokb\"}}") .toObject(HttpSettings.class); - Assertions.assertTrue(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()); + Assertions.assertFalse(model.requireHttps()); + Assertions.assertEquals("vhdbevwqqxey", model.routes().apiPrefix()); + Assertions.assertEquals(ForwardProxyConvention.STANDARD, model.forwardProxy().convention()); + Assertions.assertEquals("zinkfkbgbzbowxeq", model.forwardProxy().customHostHeaderName()); + Assertions.assertEquals("ljmygvkzqkjjeokb", 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")); + HttpSettings model = new HttpSettings().withRequireHttps(false) + .withRoutes(new HttpSettingsRoutes().withApiPrefix("vhdbevwqqxey")) + .withForwardProxy(new ForwardProxy().withConvention(ForwardProxyConvention.STANDARD) + .withCustomHostHeaderName("zinkfkbgbzbowxeq") + .withCustomProtoHeaderName("ljmygvkzqkjjeokb")); model = BinaryData.fromObject(model).toObject(HttpSettings.class); - Assertions.assertTrue(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()); + Assertions.assertFalse(model.requireHttps()); + Assertions.assertEquals("vhdbevwqqxey", model.routes().apiPrefix()); + Assertions.assertEquals(ForwardProxyConvention.STANDARD, model.forwardProxy().convention()); + Assertions.assertEquals("zinkfkbgbzbowxeq", model.forwardProxy().customHostHeaderName()); + Assertions.assertEquals("ljmygvkzqkjjeokb", model.forwardProxy().customProtoHeaderName()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IdentitySettingsTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IdentitySettingsTests.java index 9803af1df6f3..3b6991fe7bc1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IdentitySettingsTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IdentitySettingsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,18 +12,18 @@ public final class IdentitySettingsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - IdentitySettings model - = BinaryData.fromString("{\"identity\":\"blytk\",\"lifecycle\":\"Init\"}").toObject(IdentitySettings.class); - Assertions.assertEquals("blytk", model.identity()); - Assertions.assertEquals(IdentitySettingsLifeCycle.INIT, model.lifecycle()); + IdentitySettings model = BinaryData.fromString("{\"identity\":\"ynduha\",\"lifecycle\":\"Main\"}") + .toObject(IdentitySettings.class); + Assertions.assertEquals("ynduha", model.identity()); + Assertions.assertEquals(IdentitySettingsLifeCycle.MAIN, model.lifecycle()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { IdentitySettings model - = new IdentitySettings().withIdentity("blytk").withLifecycle(IdentitySettingsLifeCycle.INIT); + = new IdentitySettings().withIdentity("ynduha").withLifecycle(IdentitySettingsLifeCycle.MAIN); model = BinaryData.fromObject(model).toObject(IdentitySettings.class); - Assertions.assertEquals("blytk", model.identity()); - Assertions.assertEquals(IdentitySettingsLifeCycle.INIT, model.lifecycle()); + Assertions.assertEquals("ynduha", model.identity()); + Assertions.assertEquals(IdentitySettingsLifeCycle.MAIN, model.lifecycle()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IngressConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IngressConfigurationTests.java index ee79c36fb8ba..0283323826fc 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IngressConfigurationTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IngressConfigurationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,24 +12,24 @@ public final class IngressConfigurationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IngressConfiguration model = BinaryData.fromString( - "{\"workloadProfileName\":\"wn\",\"terminationGracePeriodSeconds\":268742670,\"headerCountLimit\":1188867128,\"requestIdleTimeout\":792325056}") + "{\"workloadProfileName\":\"uhok\",\"terminationGracePeriodSeconds\":1886757766,\"headerCountLimit\":597476008,\"requestIdleTimeout\":302343226}") .toObject(IngressConfiguration.class); - Assertions.assertEquals("wn", model.workloadProfileName()); - Assertions.assertEquals(268742670, model.terminationGracePeriodSeconds()); - Assertions.assertEquals(1188867128, model.headerCountLimit()); - Assertions.assertEquals(792325056, model.requestIdleTimeout()); + Assertions.assertEquals("uhok", model.workloadProfileName()); + Assertions.assertEquals(1886757766, model.terminationGracePeriodSeconds()); + Assertions.assertEquals(597476008, model.headerCountLimit()); + Assertions.assertEquals(302343226, model.requestIdleTimeout()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - IngressConfiguration model = new IngressConfiguration().withWorkloadProfileName("wn") - .withTerminationGracePeriodSeconds(268742670) - .withHeaderCountLimit(1188867128) - .withRequestIdleTimeout(792325056); + IngressConfiguration model = new IngressConfiguration().withWorkloadProfileName("uhok") + .withTerminationGracePeriodSeconds(1886757766) + .withHeaderCountLimit(597476008) + .withRequestIdleTimeout(302343226); model = BinaryData.fromObject(model).toObject(IngressConfiguration.class); - Assertions.assertEquals("wn", model.workloadProfileName()); - Assertions.assertEquals(268742670, model.terminationGracePeriodSeconds()); - Assertions.assertEquals(1188867128, model.headerCountLimit()); - Assertions.assertEquals(792325056, model.requestIdleTimeout()); + Assertions.assertEquals("uhok", model.workloadProfileName()); + Assertions.assertEquals(1886757766, model.terminationGracePeriodSeconds()); + Assertions.assertEquals(597476008, model.headerCountLimit()); + Assertions.assertEquals(302343226, model.requestIdleTimeout()); } } 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 index 371411345960..fcdae8cdc779 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,20 +12,20 @@ public final class IngressPortMappingTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IngressPortMapping model - = BinaryData.fromString("{\"external\":true,\"targetPort\":1114534772,\"exposedPort\":883110642}") + = BinaryData.fromString("{\"external\":false,\"targetPort\":567516658,\"exposedPort\":475216783}") .toObject(IngressPortMapping.class); - Assertions.assertTrue(model.external()); - Assertions.assertEquals(1114534772, model.targetPort()); - Assertions.assertEquals(883110642, model.exposedPort()); + Assertions.assertFalse(model.external()); + Assertions.assertEquals(567516658, model.targetPort()); + Assertions.assertEquals(475216783, model.exposedPort()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { IngressPortMapping model - = new IngressPortMapping().withExternal(true).withTargetPort(1114534772).withExposedPort(883110642); + = new IngressPortMapping().withExternal(false).withTargetPort(567516658).withExposedPort(475216783); model = BinaryData.fromObject(model).toObject(IngressPortMapping.class); - Assertions.assertTrue(model.external()); - Assertions.assertEquals(1114534772, model.targetPort()); - Assertions.assertEquals(883110642, model.exposedPort()); + Assertions.assertFalse(model.external()); + Assertions.assertEquals(567516658, model.targetPort()); + Assertions.assertEquals(475216783, 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 index e7527474a97c..c07ea7b7a653 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -13,14 +13,14 @@ public final class IngressStickySessionsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IngressStickySessions model - = BinaryData.fromString("{\"affinity\":\"sticky\"}").toObject(IngressStickySessions.class); - Assertions.assertEquals(Affinity.STICKY, model.affinity()); + = 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.STICKY); + IngressStickySessions model = new IngressStickySessions().withAffinity(Affinity.NONE); model = BinaryData.fromObject(model).toObject(IngressStickySessions.class); - Assertions.assertEquals(Affinity.STICKY, model.affinity()); + 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 index 6b73efc0a2d4..853d288c3f6a 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -13,24 +13,25 @@ public final class IpSecurityRestrictionRuleTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IpSecurityRestrictionRule model = BinaryData - .fromString("{\"name\":\"eli\",\"description\":\"nr\",\"ipAddressRange\":\"tfolhbnx\",\"action\":\"Deny\"}") + .fromString( + "{\"name\":\"moizpos\",\"description\":\"grcfb\",\"ipAddressRange\":\"nrmfqjhhk\",\"action\":\"Deny\"}") .toObject(IpSecurityRestrictionRule.class); - Assertions.assertEquals("eli", model.name()); - Assertions.assertEquals("nr", model.description()); - Assertions.assertEquals("tfolhbnx", model.ipAddressRange()); + Assertions.assertEquals("moizpos", model.name()); + Assertions.assertEquals("grcfb", model.description()); + Assertions.assertEquals("nrmfqjhhk", model.ipAddressRange()); Assertions.assertEquals(Action.DENY, model.action()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - IpSecurityRestrictionRule model = new IpSecurityRestrictionRule().withName("eli") - .withDescription("nr") - .withIpAddressRange("tfolhbnx") + IpSecurityRestrictionRule model = new IpSecurityRestrictionRule().withName("moizpos") + .withDescription("grcfb") + .withIpAddressRange("nrmfqjhhk") .withAction(Action.DENY); model = BinaryData.fromObject(model).toObject(IpSecurityRestrictionRule.class); - Assertions.assertEquals("eli", model.name()); - Assertions.assertEquals("nr", model.description()); - Assertions.assertEquals("tfolhbnx", model.ipAddressRange()); + Assertions.assertEquals("moizpos", model.name()); + Assertions.assertEquals("grcfb", model.description()); + Assertions.assertEquals("nrmfqjhhk", model.ipAddressRange()); Assertions.assertEquals(Action.DENY, model.action()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentConfigurationPropertyTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentConfigurationPropertyTests.java index 7ea0b0cca37c..9b0ae4608923 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentConfigurationPropertyTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentConfigurationPropertyTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,18 +12,18 @@ public final class JavaComponentConfigurationPropertyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { JavaComponentConfigurationProperty model - = BinaryData.fromString("{\"propertyName\":\"qitmhheioqaqhv\",\"value\":\"ufuqyrx\"}") + = BinaryData.fromString("{\"propertyName\":\"uemsly\",\"value\":\"qyrp\"}") .toObject(JavaComponentConfigurationProperty.class); - Assertions.assertEquals("qitmhheioqaqhv", model.propertyName()); - Assertions.assertEquals("ufuqyrx", model.value()); + Assertions.assertEquals("uemsly", model.propertyName()); + Assertions.assertEquals("qyrp", model.value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { JavaComponentConfigurationProperty model - = new JavaComponentConfigurationProperty().withPropertyName("qitmhheioqaqhv").withValue("ufuqyrx"); + = new JavaComponentConfigurationProperty().withPropertyName("uemsly").withValue("qyrp"); model = BinaryData.fromObject(model).toObject(JavaComponentConfigurationProperty.class); - Assertions.assertEquals("qitmhheioqaqhv", model.propertyName()); - Assertions.assertEquals("ufuqyrx", model.value()); + Assertions.assertEquals("uemsly", model.propertyName()); + Assertions.assertEquals("qyrp", model.value()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentIngressTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentIngressTests.java index d6e8608973da..b48bf0e80c51 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentIngressTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentIngressTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -10,8 +10,7 @@ public final class JavaComponentIngressTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - JavaComponentIngress model - = BinaryData.fromString("{\"fqdn\":\"bhvjglr\"}").toObject(JavaComponentIngress.class); + JavaComponentIngress model = BinaryData.fromString("{\"fqdn\":\"t\"}").toObject(JavaComponentIngress.class); } @org.junit.jupiter.api.Test diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentInnerTests.java index 6243c346b2aa..2514460218d5 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentInnerTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -17,32 +17,33 @@ public final class JavaComponentInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { JavaComponentInner model = BinaryData.fromString( - "{\"properties\":{\"componentType\":\"JavaComponentProperties\",\"provisioningState\":\"Failed\",\"configurations\":[{\"propertyName\":\"esmkssjhoiftxfkf\",\"value\":\"gpr\"}],\"scale\":{\"minReplicas\":802789506,\"maxReplicas\":1296145602},\"serviceBinds\":[{\"name\":\"iqtgdqoh\",\"serviceId\":\"wsldrizetpwbr\"},{\"name\":\"llibphbqzmizak\",\"serviceId\":\"ankjpdnjzh\"},{\"name\":\"oylhjlmuoyxprimr\",\"serviceId\":\"pteecjme\"}]},\"id\":\"ls\",\"name\":\"vasylwxdzau\",\"type\":\"weoohguufuzboyj\"}") + "{\"properties\":{\"componentType\":\"JavaComponentProperties\",\"provisioningState\":\"Canceled\",\"configurations\":[{\"propertyName\":\"lcwkhihihlhz\",\"value\":\"qtz\"}],\"scale\":{\"minReplicas\":1553526894,\"maxReplicas\":167600863},\"serviceBinds\":[{\"name\":\"hfgmvecactxm\",\"serviceId\":\"teyowclu\"},{\"name\":\"vekqvgqo\",\"serviceId\":\"ifzmpjwyivqi\"},{\"name\":\"xcvhrfs\",\"serviceId\":\"uagrttikteusqc\"},{\"name\":\"vyklxuby\",\"serviceId\":\"ff\"}]},\"id\":\"fblcq\",\"name\":\"u\",\"type\":\"bgq\"}") .toObject(JavaComponentInner.class); - Assertions.assertEquals("esmkssjhoiftxfkf", model.properties().configurations().get(0).propertyName()); - Assertions.assertEquals("gpr", model.properties().configurations().get(0).value()); - Assertions.assertEquals(802789506, model.properties().scale().minReplicas()); - Assertions.assertEquals(1296145602, model.properties().scale().maxReplicas()); - Assertions.assertEquals("iqtgdqoh", model.properties().serviceBinds().get(0).name()); - Assertions.assertEquals("wsldrizetpwbr", model.properties().serviceBinds().get(0).serviceId()); + Assertions.assertEquals("lcwkhihihlhz", model.properties().configurations().get(0).propertyName()); + Assertions.assertEquals("qtz", model.properties().configurations().get(0).value()); + Assertions.assertEquals(1553526894, model.properties().scale().minReplicas()); + Assertions.assertEquals(167600863, model.properties().scale().maxReplicas()); + Assertions.assertEquals("hfgmvecactxm", model.properties().serviceBinds().get(0).name()); + Assertions.assertEquals("teyowclu", model.properties().serviceBinds().get(0).serviceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { JavaComponentInner model = new JavaComponentInner().withProperties(new JavaComponentProperties() .withConfigurations(Arrays - .asList(new JavaComponentConfigurationProperty().withPropertyName("esmkssjhoiftxfkf").withValue("gpr"))) - .withScale(new JavaComponentPropertiesScale().withMinReplicas(802789506).withMaxReplicas(1296145602)) + .asList(new JavaComponentConfigurationProperty().withPropertyName("lcwkhihihlhz").withValue("qtz"))) + .withScale(new JavaComponentPropertiesScale().withMinReplicas(1553526894).withMaxReplicas(167600863)) .withServiceBinds( - Arrays.asList(new JavaComponentServiceBind().withName("iqtgdqoh").withServiceId("wsldrizetpwbr"), - new JavaComponentServiceBind().withName("llibphbqzmizak").withServiceId("ankjpdnjzh"), - new JavaComponentServiceBind().withName("oylhjlmuoyxprimr").withServiceId("pteecjme")))); + Arrays.asList(new JavaComponentServiceBind().withName("hfgmvecactxm").withServiceId("teyowclu"), + new JavaComponentServiceBind().withName("vekqvgqo").withServiceId("ifzmpjwyivqi"), + new JavaComponentServiceBind().withName("xcvhrfs").withServiceId("uagrttikteusqc"), + new JavaComponentServiceBind().withName("vyklxuby").withServiceId("ff")))); model = BinaryData.fromObject(model).toObject(JavaComponentInner.class); - Assertions.assertEquals("esmkssjhoiftxfkf", model.properties().configurations().get(0).propertyName()); - Assertions.assertEquals("gpr", model.properties().configurations().get(0).value()); - Assertions.assertEquals(802789506, model.properties().scale().minReplicas()); - Assertions.assertEquals(1296145602, model.properties().scale().maxReplicas()); - Assertions.assertEquals("iqtgdqoh", model.properties().serviceBinds().get(0).name()); - Assertions.assertEquals("wsldrizetpwbr", model.properties().serviceBinds().get(0).serviceId()); + Assertions.assertEquals("lcwkhihihlhz", model.properties().configurations().get(0).propertyName()); + Assertions.assertEquals("qtz", model.properties().configurations().get(0).value()); + Assertions.assertEquals(1553526894, model.properties().scale().minReplicas()); + Assertions.assertEquals(167600863, model.properties().scale().maxReplicas()); + Assertions.assertEquals("hfgmvecactxm", model.properties().serviceBinds().get(0).name()); + Assertions.assertEquals("teyowclu", model.properties().serviceBinds().get(0).serviceId()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentPropertiesScaleTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentPropertiesScaleTests.java index 0064bc9a99df..0baefb62b7a1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentPropertiesScaleTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentPropertiesScaleTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,18 +12,18 @@ public final class JavaComponentPropertiesScaleTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { JavaComponentPropertiesScale model - = BinaryData.fromString("{\"minReplicas\":451431639,\"maxReplicas\":801625089}") + = BinaryData.fromString("{\"minReplicas\":1551193152,\"maxReplicas\":2112535859}") .toObject(JavaComponentPropertiesScale.class); - Assertions.assertEquals(451431639, model.minReplicas()); - Assertions.assertEquals(801625089, model.maxReplicas()); + Assertions.assertEquals(1551193152, model.minReplicas()); + Assertions.assertEquals(2112535859, model.maxReplicas()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { JavaComponentPropertiesScale model - = new JavaComponentPropertiesScale().withMinReplicas(451431639).withMaxReplicas(801625089); + = new JavaComponentPropertiesScale().withMinReplicas(1551193152).withMaxReplicas(2112535859); model = BinaryData.fromObject(model).toObject(JavaComponentPropertiesScale.class); - Assertions.assertEquals(451431639, model.minReplicas()); - Assertions.assertEquals(801625089, model.maxReplicas()); + Assertions.assertEquals(1551193152, model.minReplicas()); + Assertions.assertEquals(2112535859, model.maxReplicas()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentPropertiesTests.java index 844f1b7b9453..0bb62e809887 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentPropertiesTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -16,34 +16,30 @@ public final class JavaComponentPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { JavaComponentProperties model = BinaryData.fromString( - "{\"componentType\":\"JavaComponentProperties\",\"provisioningState\":\"Deleting\",\"configurations\":[{\"propertyName\":\"olbaemwmdx\",\"value\":\"bwjscjpahlxveab\"},{\"propertyName\":\"xnmwmqtibxyijddt\",\"value\":\"cttadi\"},{\"propertyName\":\"eukmr\",\"value\":\"eekpndz\"},{\"propertyName\":\"pmudqmeqwig\",\"value\":\"bu\"}],\"scale\":{\"minReplicas\":968271036,\"maxReplicas\":517735759},\"serviceBinds\":[{\"name\":\"bpmzzn\",\"serviceId\":\"ff\"}]}") + "{\"componentType\":\"JavaComponentProperties\",\"provisioningState\":\"Canceled\",\"configurations\":[{\"propertyName\":\"metttwgd\",\"value\":\"qxihhrmooi\"}],\"scale\":{\"minReplicas\":1687537761,\"maxReplicas\":1524776028},\"serviceBinds\":[{\"name\":\"tcxapzhyrpetogeb\",\"serviceId\":\"xslhvnhlabrqnkk\"}]}") .toObject(JavaComponentProperties.class); - Assertions.assertEquals("olbaemwmdx", model.configurations().get(0).propertyName()); - Assertions.assertEquals("bwjscjpahlxveab", model.configurations().get(0).value()); - Assertions.assertEquals(968271036, model.scale().minReplicas()); - Assertions.assertEquals(517735759, model.scale().maxReplicas()); - Assertions.assertEquals("bpmzzn", model.serviceBinds().get(0).name()); - Assertions.assertEquals("ff", model.serviceBinds().get(0).serviceId()); + Assertions.assertEquals("metttwgd", model.configurations().get(0).propertyName()); + Assertions.assertEquals("qxihhrmooi", model.configurations().get(0).value()); + Assertions.assertEquals(1687537761, model.scale().minReplicas()); + Assertions.assertEquals(1524776028, model.scale().maxReplicas()); + Assertions.assertEquals("tcxapzhyrpetogeb", model.serviceBinds().get(0).name()); + Assertions.assertEquals("xslhvnhlabrqnkk", model.serviceBinds().get(0).serviceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - JavaComponentProperties model - = new JavaComponentProperties() - .withConfigurations(Arrays.asList( - new JavaComponentConfigurationProperty().withPropertyName("olbaemwmdx") - .withValue("bwjscjpahlxveab"), - new JavaComponentConfigurationProperty().withPropertyName("xnmwmqtibxyijddt").withValue("cttadi"), - new JavaComponentConfigurationProperty().withPropertyName("eukmr").withValue("eekpndz"), - new JavaComponentConfigurationProperty().withPropertyName("pmudqmeqwig").withValue("bu"))) - .withScale(new JavaComponentPropertiesScale().withMinReplicas(968271036).withMaxReplicas(517735759)) - .withServiceBinds(Arrays.asList(new JavaComponentServiceBind().withName("bpmzzn").withServiceId("ff"))); + JavaComponentProperties model = new JavaComponentProperties() + .withConfigurations(Arrays + .asList(new JavaComponentConfigurationProperty().withPropertyName("metttwgd").withValue("qxihhrmooi"))) + .withScale(new JavaComponentPropertiesScale().withMinReplicas(1687537761).withMaxReplicas(1524776028)) + .withServiceBinds(Arrays + .asList(new JavaComponentServiceBind().withName("tcxapzhyrpetogeb").withServiceId("xslhvnhlabrqnkk"))); model = BinaryData.fromObject(model).toObject(JavaComponentProperties.class); - Assertions.assertEquals("olbaemwmdx", model.configurations().get(0).propertyName()); - Assertions.assertEquals("bwjscjpahlxveab", model.configurations().get(0).value()); - Assertions.assertEquals(968271036, model.scale().minReplicas()); - Assertions.assertEquals(517735759, model.scale().maxReplicas()); - Assertions.assertEquals("bpmzzn", model.serviceBinds().get(0).name()); - Assertions.assertEquals("ff", model.serviceBinds().get(0).serviceId()); + Assertions.assertEquals("metttwgd", model.configurations().get(0).propertyName()); + Assertions.assertEquals("qxihhrmooi", model.configurations().get(0).value()); + Assertions.assertEquals(1687537761, model.scale().minReplicas()); + Assertions.assertEquals(1524776028, model.scale().maxReplicas()); + Assertions.assertEquals("tcxapzhyrpetogeb", model.serviceBinds().get(0).name()); + Assertions.assertEquals("xslhvnhlabrqnkk", model.serviceBinds().get(0).serviceId()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentServiceBindTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentServiceBindTests.java index 8452141276b3..fd9d0b9217b8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentServiceBindTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentServiceBindTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,17 +11,17 @@ public final class JavaComponentServiceBindTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - JavaComponentServiceBind model = BinaryData.fromString("{\"name\":\"lsismjqfrd\",\"serviceId\":\"amqu\"}") + JavaComponentServiceBind model = BinaryData.fromString("{\"name\":\"ttymsjny\",\"serviceId\":\"dnfwqzdzg\"}") .toObject(JavaComponentServiceBind.class); - Assertions.assertEquals("lsismjqfrd", model.name()); - Assertions.assertEquals("amqu", model.serviceId()); + Assertions.assertEquals("ttymsjny", model.name()); + Assertions.assertEquals("dnfwqzdzg", model.serviceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - JavaComponentServiceBind model = new JavaComponentServiceBind().withName("lsismjqfrd").withServiceId("amqu"); + JavaComponentServiceBind model = new JavaComponentServiceBind().withName("ttymsjny").withServiceId("dnfwqzdzg"); model = BinaryData.fromObject(model).toObject(JavaComponentServiceBind.class); - Assertions.assertEquals("lsismjqfrd", model.name()); - Assertions.assertEquals("amqu", model.serviceId()); + Assertions.assertEquals("ttymsjny", model.name()); + Assertions.assertEquals("dnfwqzdzg", model.serviceId()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsCollectionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsCollectionTests.java index 25b3630cb6ca..879ec32d8ed4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsCollectionTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsCollectionTests.java @@ -1,89 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.JavaComponentInner; -import com.azure.resourcemanager.appcontainers.models.JavaComponentConfigurationProperty; -import com.azure.resourcemanager.appcontainers.models.JavaComponentProperties; -import com.azure.resourcemanager.appcontainers.models.JavaComponentPropertiesScale; -import com.azure.resourcemanager.appcontainers.models.JavaComponentServiceBind; -import com.azure.resourcemanager.appcontainers.models.JavaComponentsCollection; -import java.util.Arrays; +import com.azure.resourcemanager.appcontainers.implementation.models.JavaComponentsCollection; import org.junit.jupiter.api.Assertions; public final class JavaComponentsCollectionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { JavaComponentsCollection model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"componentType\":\"JavaComponentProperties\",\"provisioningState\":\"Deleting\",\"configurations\":[{\"propertyName\":\"ezkgi\",\"value\":\"idxas\"},{\"propertyName\":\"ddyvvjskgfmo\",\"value\":\"ah\"},{\"propertyName\":\"gat\",\"value\":\"a\"},{\"propertyName\":\"hvjhhnakzyb\",\"value\":\"jid\"}],\"scale\":{\"minReplicas\":1763110580,\"maxReplicas\":1374695683},\"serviceBinds\":[{\"name\":\"xevbl\",\"serviceId\":\"ednljl\"},{\"name\":\"euaulxu\",\"serviceId\":\"mjbnk\"},{\"name\":\"xynenl\",\"serviceId\":\"xeizzg\"},{\"name\":\"lnsrmffe\",\"serviceId\":\"xcktpiymerteeamm\"}]},\"id\":\"iekkkzddrtkgdojb\",\"name\":\"xv\",\"type\":\"vrefdeesv\"},{\"properties\":{\"componentType\":\"JavaComponentProperties\",\"provisioningState\":\"Failed\",\"configurations\":[{\"propertyName\":\"txsu\",\"value\":\"rtujwsawddjibab\"},{\"propertyName\":\"ititvtzeexavoxt\",\"value\":\"lecdmdqbw\"}],\"scale\":{\"minReplicas\":146518611,\"maxReplicas\":1413070711},\"serviceBinds\":[{\"name\":\"acbslhhxu\",\"serviceId\":\"xvodhtnsir\"},{\"name\":\"hzmme\",\"serviceId\":\"kdlpa\"},{\"name\":\"rcxfailcfxwmdb\",\"serviceId\":\"dfgsftufqobrj\"},{\"name\":\"acgcckknhx\",\"serviceId\":\"zvytnrzvuljraaer\"}]},\"id\":\"okqgukkjq\",\"name\":\"vbroylaxxu\",\"type\":\"cdisd\"},{\"properties\":{\"componentType\":\"JavaComponentProperties\",\"provisioningState\":\"Succeeded\",\"configurations\":[{\"propertyName\":\"vgjrwhr\",\"value\":\"ycy\"}],\"scale\":{\"minReplicas\":1491139189,\"maxReplicas\":513530726},\"serviceBinds\":[{\"name\":\"nfnw\",\"serviceId\":\"tmvpdvjdhtt\"},{\"name\":\"efedxihchrphkm\",\"serviceId\":\"jdqnsdfzpbgt\"},{\"name\":\"ylkdghrje\",\"serviceId\":\"tl\"},{\"name\":\"ez\",\"serviceId\":\"hokvbwnh\"}]},\"id\":\"qlgehg\",\"name\":\"pipifh\",\"type\":\"f\"}],\"nextLink\":\"ajvgcxtxjcsheafi\"}") + "{\"value\":[{\"properties\":{\"componentType\":\"JavaComponentProperties\",\"provisioningState\":\"Canceled\",\"configurations\":[{\"propertyName\":\"hqlyvijo\",\"value\":\"iv\"},{\"propertyName\":\"oyzunbixxr\",\"value\":\"kvcpwpgclr\"},{\"propertyName\":\"vtsoxf\",\"value\":\"enxpmyyefr\"},{\"propertyName\":\"pdnqqskawaoqvmmb\",\"value\":\"qfr\"}],\"scale\":{\"minReplicas\":1371498334,\"maxReplicas\":1084640594},\"serviceBinds\":[{\"name\":\"itgvkx\",\"serviceId\":\"yqdrf\"},{\"name\":\"cealzxwh\",\"serviceId\":\"nsymoyqhlwigd\"},{\"name\":\"bkbxgomfa\",\"serviceId\":\"wasqvdaeyyg\"}]},\"id\":\"akjsqz\",\"name\":\"zbezkgimsidxasic\",\"type\":\"dyvvjskgfmocwahp\"},{\"properties\":{\"componentType\":\"JavaComponentProperties\",\"provisioningState\":\"Canceled\",\"configurations\":[{\"propertyName\":\"ahhvjhhna\",\"value\":\"ybbjjidjksyx\"},{\"propertyName\":\"xvxevblbjednljla\",\"value\":\"uaulxunsm\"},{\"propertyName\":\"nkppxynen\",\"value\":\"vxei\"}],\"scale\":{\"minReplicas\":913388828,\"maxReplicas\":1958797848},\"serviceBinds\":[{\"name\":\"mffeycxcktpi\",\"serviceId\":\"erteeammxqiekk\"},{\"name\":\"ddrtkgdojb\",\"serviceId\":\"vavrefdees\"},{\"name\":\"cuijpxt\",\"serviceId\":\"uwprtujwsawd\"},{\"name\":\"ibabxvititvtzeex\",\"serviceId\":\"oxtfglecdmdqbwp\"}]},\"id\":\"q\",\"name\":\"gsfjac\",\"type\":\"slhhxudbxv\"}],\"nextLink\":\"htnsi\"}") .toObject(JavaComponentsCollection.class); - Assertions.assertEquals("ezkgi", model.value().get(0).properties().configurations().get(0).propertyName()); - Assertions.assertEquals("idxas", model.value().get(0).properties().configurations().get(0).value()); - Assertions.assertEquals(1763110580, model.value().get(0).properties().scale().minReplicas()); - Assertions.assertEquals(1374695683, model.value().get(0).properties().scale().maxReplicas()); - Assertions.assertEquals("xevbl", model.value().get(0).properties().serviceBinds().get(0).name()); - Assertions.assertEquals("ednljl", model.value().get(0).properties().serviceBinds().get(0).serviceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JavaComponentsCollection model - = new JavaComponentsCollection() - .withValue( - Arrays.asList( - new JavaComponentInner().withProperties(new JavaComponentProperties() - .withConfigurations(Arrays.asList( - new JavaComponentConfigurationProperty().withPropertyName("ezkgi").withValue("idxas"), - new JavaComponentConfigurationProperty().withPropertyName("ddyvvjskgfmo") - .withValue("ah"), - new JavaComponentConfigurationProperty().withPropertyName("gat").withValue("a"), - new JavaComponentConfigurationProperty().withPropertyName("hvjhhnakzyb") - .withValue("jid"))) - .withScale(new JavaComponentPropertiesScale().withMinReplicas(1763110580) - .withMaxReplicas(1374695683)) - .withServiceBinds( - Arrays.asList(new JavaComponentServiceBind().withName("xevbl").withServiceId("ednljl"), - new JavaComponentServiceBind().withName("euaulxu").withServiceId("mjbnk"), - new JavaComponentServiceBind().withName("xynenl").withServiceId("xeizzg"), - new JavaComponentServiceBind() - .withName("lnsrmffe") - .withServiceId("xcktpiymerteeamm")))), - new JavaComponentInner().withProperties(new JavaComponentProperties() - .withConfigurations(Arrays.asList( - new JavaComponentConfigurationProperty().withPropertyName("txsu") - .withValue("rtujwsawddjibab"), - new JavaComponentConfigurationProperty().withPropertyName("ititvtzeexavoxt") - .withValue("lecdmdqbw"))) - .withScale(new JavaComponentPropertiesScale().withMinReplicas(146518611) - .withMaxReplicas(1413070711)) - .withServiceBinds(Arrays.asList( - new JavaComponentServiceBind().withName("acbslhhxu").withServiceId("xvodhtnsir"), - new JavaComponentServiceBind().withName("hzmme").withServiceId("kdlpa"), - new JavaComponentServiceBind() - .withName("rcxfailcfxwmdb") - .withServiceId("dfgsftufqobrj"), - new JavaComponentServiceBind() - .withName("acgcckknhx") - .withServiceId("zvytnrzvuljraaer")))), - new JavaComponentInner().withProperties(new JavaComponentProperties() - .withConfigurations(Arrays.asList( - new JavaComponentConfigurationProperty().withPropertyName("vgjrwhr").withValue("ycy"))) - .withScale(new JavaComponentPropertiesScale().withMinReplicas(1491139189) - .withMaxReplicas(513530726)) - .withServiceBinds(Arrays.asList( - new JavaComponentServiceBind().withName("nfnw").withServiceId("tmvpdvjdhtt"), - new JavaComponentServiceBind().withName("efedxihchrphkm").withServiceId("jdqnsdfzpbgt"), - new JavaComponentServiceBind().withName("ylkdghrje").withServiceId("tl"), - new JavaComponentServiceBind().withName("ez").withServiceId("hokvbwnh")))))); - model = BinaryData.fromObject(model).toObject(JavaComponentsCollection.class); - Assertions.assertEquals("ezkgi", model.value().get(0).properties().configurations().get(0).propertyName()); - Assertions.assertEquals("idxas", model.value().get(0).properties().configurations().get(0).value()); - Assertions.assertEquals(1763110580, model.value().get(0).properties().scale().minReplicas()); - Assertions.assertEquals(1374695683, model.value().get(0).properties().scale().maxReplicas()); - Assertions.assertEquals("xevbl", model.value().get(0).properties().serviceBinds().get(0).name()); - Assertions.assertEquals("ednljl", model.value().get(0).properties().serviceBinds().get(0).serviceId()); + Assertions.assertEquals("hqlyvijo", model.value().get(0).properties().configurations().get(0).propertyName()); + Assertions.assertEquals("iv", model.value().get(0).properties().configurations().get(0).value()); + Assertions.assertEquals(1371498334, model.value().get(0).properties().scale().minReplicas()); + Assertions.assertEquals(1084640594, model.value().get(0).properties().scale().maxReplicas()); + Assertions.assertEquals("itgvkx", model.value().get(0).properties().serviceBinds().get(0).name()); + Assertions.assertEquals("yqdrf", model.value().get(0).properties().serviceBinds().get(0).serviceId()); + Assertions.assertEquals("htnsi", model.nextLink()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsCreateOrUpdateMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsCreateOrUpdateMockTests.java index 14754f14d872..3695762af357 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsCreateOrUpdateMockTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsCreateOrUpdateMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -26,7 +26,7 @@ public final class JavaComponentsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"componentType\":\"JavaComponentProperties\",\"provisioningState\":\"Succeeded\",\"configurations\":[{\"propertyName\":\"tfxptpqayamkncfg\",\"value\":\"mxsnxocuul\"},{\"propertyName\":\"j\",\"value\":\"oy\"}],\"scale\":{\"minReplicas\":1378586528,\"maxReplicas\":117635238},\"serviceBinds\":[{\"name\":\"bdl\",\"serviceId\":\"gdyrcvuqbsgzl\"},{\"name\":\"hbj\",\"serviceId\":\"ogdxwbsfpyxxtjlf\"},{\"name\":\"cominxojjluxx\",\"serviceId\":\"ilz\"},{\"name\":\"zzqjmu\",\"serviceId\":\"ay\"}]},\"id\":\"ribqlotokh\",\"name\":\"vwta\",\"type\":\"nkcqwwxwjyofgw\"}"; + = "{\"properties\":{\"componentType\":\"JavaComponentProperties\",\"provisioningState\":\"Succeeded\",\"configurations\":[{\"propertyName\":\"htukfac\",\"value\":\"mbf\"}],\"scale\":{\"minReplicas\":1004904072,\"maxReplicas\":88507884},\"serviceBinds\":[{\"name\":\"vqxbnuvw\",\"serviceId\":\"asgom\"},{\"name\":\"jzwxuqgovsxpwwz\",\"serviceId\":\"fmkk\"},{\"name\":\"gfredmlscg\",\"serviceId\":\"lccnaovjowaz\"}]},\"id\":\"abacomlyotgkws\",\"name\":\"nsrqor\",\"type\":\"genmvceb\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -36,25 +36,22 @@ public void testCreateOrUpdate() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); JavaComponent response = manager.javaComponents() - .define("hoadhrsxqvzv") - .withExistingManagedEnvironment("wwnbafoctohz", "aquvwsxbgnvkervq") + .define("ezsdsuxheq") + .withExistingManagedEnvironment("pqht", "qhnmhk") .withProperties(new JavaComponentProperties() .withConfigurations( - Arrays.asList(new JavaComponentConfigurationProperty().withPropertyName("gfajglzrsubklr") - .withValue("jnltcetjdvqydi"))) - .withScale(new JavaComponentPropertiesScale().withMinReplicas(408396280).withMaxReplicas(1461869156)) + Arrays.asList(new JavaComponentConfigurationProperty().withPropertyName("pinymmqgwokmikp") + .withValue("fbmjxuvji"))) + .withScale(new JavaComponentPropertiesScale().withMinReplicas(853861431).withMaxReplicas(484105170)) .withServiceBinds( - Arrays.asList(new JavaComponentServiceBind().withName("dxvqzxoe").withServiceId("gjxb"), - new JavaComponentServiceBind().withName("an").withServiceId("upwtz"), - new JavaComponentServiceBind().withName("aklozk").withServiceId("zrpejpl"), - new JavaComponentServiceBind().withName("anbtttkgsu").withServiceId("nrswgkpjhboyik")))) + Arrays.asList(new JavaComponentServiceBind().withName("w").withServiceId("ehpphthdklmveta")))) .create(); - Assertions.assertEquals("tfxptpqayamkncfg", response.properties().configurations().get(0).propertyName()); - Assertions.assertEquals("mxsnxocuul", response.properties().configurations().get(0).value()); - Assertions.assertEquals(1378586528, response.properties().scale().minReplicas()); - Assertions.assertEquals(117635238, response.properties().scale().maxReplicas()); - Assertions.assertEquals("bdl", response.properties().serviceBinds().get(0).name()); - Assertions.assertEquals("gdyrcvuqbsgzl", response.properties().serviceBinds().get(0).serviceId()); + Assertions.assertEquals("htukfac", response.properties().configurations().get(0).propertyName()); + Assertions.assertEquals("mbf", response.properties().configurations().get(0).value()); + Assertions.assertEquals(1004904072, response.properties().scale().minReplicas()); + Assertions.assertEquals(88507884, response.properties().scale().maxReplicas()); + Assertions.assertEquals("vqxbnuvw", response.properties().serviceBinds().get(0).name()); + Assertions.assertEquals("asgom", response.properties().serviceBinds().get(0).serviceId()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsGetWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsGetWithResponseMockTests.java index 5c457b8e6f68..2713d75c0e2e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsGetWithResponseMockTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsGetWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -21,7 +21,7 @@ public final class JavaComponentsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"componentType\":\"JavaComponentProperties\",\"provisioningState\":\"InProgress\",\"configurations\":[{\"propertyName\":\"mttjxophgerh\",\"value\":\"vgohtw\"},{\"propertyName\":\"qilrixysfn\",\"value\":\"sqywwwmhkru\"},{\"propertyName\":\"edrympmlqo\",\"value\":\"hzdue\"}],\"scale\":{\"minReplicas\":1624660611,\"maxReplicas\":653073155},\"serviceBinds\":[{\"name\":\"knjdiqfliejhp\",\"serviceId\":\"bi\"},{\"name\":\"fsbw\",\"serviceId\":\"ivbvzi\"}]},\"id\":\"wxgoooxzpra\",\"name\":\"mskxknp\",\"type\":\"gzigjsugswhgsaod\"}"; + = "{\"properties\":{\"componentType\":\"JavaComponentProperties\",\"provisioningState\":\"InProgress\",\"configurations\":[{\"propertyName\":\"jauwcgxefnohaitr\",\"value\":\"izerw\"},{\"propertyName\":\"dasmxu\",\"value\":\"fbngfcocef\"}],\"scale\":{\"minReplicas\":694255702,\"maxReplicas\":1843062880},\"serviceBinds\":[{\"name\":\"ztraud\",\"serviceId\":\"hlcdc\"},{\"name\":\"regp\",\"serviceId\":\"moj\"},{\"name\":\"rztnv\",\"serviceId\":\"shqrdgrt\"},{\"name\":\"ewjzl\",\"serviceId\":\"kcfazzw\"}]},\"id\":\"ayerzrran\",\"name\":\"ybylpol\",\"type\":\"zrghsrleink\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,14 +31,14 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); JavaComponent response = manager.javaComponents() - .getWithResponse("nl", "kpsimsfeypofqp", "bh", com.azure.core.util.Context.NONE) + .getWithResponse("fruwkud", "bcpftxudqyemebun", "ucmci", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("mttjxophgerh", response.properties().configurations().get(0).propertyName()); - Assertions.assertEquals("vgohtw", response.properties().configurations().get(0).value()); - Assertions.assertEquals(1624660611, response.properties().scale().minReplicas()); - Assertions.assertEquals(653073155, response.properties().scale().maxReplicas()); - Assertions.assertEquals("knjdiqfliejhp", response.properties().serviceBinds().get(0).name()); - Assertions.assertEquals("bi", response.properties().serviceBinds().get(0).serviceId()); + Assertions.assertEquals("jauwcgxefnohaitr", response.properties().configurations().get(0).propertyName()); + Assertions.assertEquals("izerw", response.properties().configurations().get(0).value()); + Assertions.assertEquals(694255702, response.properties().scale().minReplicas()); + Assertions.assertEquals(1843062880, response.properties().scale().maxReplicas()); + Assertions.assertEquals("ztraud", response.properties().serviceBinds().get(0).name()); + Assertions.assertEquals("hlcdc", response.properties().serviceBinds().get(0).serviceId()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsListMockTests.java index 39f075c25072..5763cc20906b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsListMockTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JavaComponentsListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -22,7 +22,7 @@ public final class JavaComponentsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"componentType\":\"JavaComponentProperties\",\"provisioningState\":\"InProgress\",\"configurations\":[{\"propertyName\":\"owgw\",\"value\":\"mkekxpkzwaqxo\"},{\"propertyName\":\"ovchiqbplvfid\",\"value\":\"ztekxbyjgmsfep\"},{\"propertyName\":\"ihpq\",\"value\":\"agr\"}],\"scale\":{\"minReplicas\":18587902,\"maxReplicas\":262952356},\"serviceBinds\":[{\"name\":\"jfowxwy\",\"serviceId\":\"c\"},{\"name\":\"sgbipcukdveksbuh\",\"serviceId\":\"uchvlscrd\"},{\"name\":\"bfdyjduss\",\"serviceId\":\"szekbh\"},{\"name\":\"kaaggkreh\",\"serviceId\":\"rnuybffljfii\"}]},\"id\":\"eoagsqta\",\"name\":\"dusr\",\"type\":\"xxfavsqwudohzilf\"}]}"; + = "{\"value\":[{\"properties\":{\"componentType\":\"JavaComponentProperties\",\"provisioningState\":\"Canceled\",\"configurations\":[{\"propertyName\":\"wo\",\"value\":\"fsvagh\"},{\"propertyName\":\"ynwlslrcigtzjcv\",\"value\":\"qlapsnsso\"}],\"scale\":{\"minReplicas\":1215763715,\"maxReplicas\":1448235256},\"serviceBinds\":[{\"name\":\"ievw\",\"serviceId\":\"cvvy\"},{\"name\":\"slpuxgcbdsva\",\"serviceId\":\"nptw\"},{\"name\":\"kx\",\"serviceId\":\"azwu\"}]},\"id\":\"yqvnjobfe\",\"name\":\"hldiuhzzgqlm\",\"type\":\"aewzgiudjp\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,14 +32,13 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.javaComponents().list("toyrplixlajml", "pq", com.azure.core.util.Context.NONE); + = manager.javaComponents().list("scjfncjwvuagf", "wtltngvmreuptrk", com.azure.core.util.Context.NONE); - Assertions.assertEquals("owgw", response.iterator().next().properties().configurations().get(0).propertyName()); - Assertions.assertEquals("mkekxpkzwaqxo", - response.iterator().next().properties().configurations().get(0).value()); - Assertions.assertEquals(18587902, response.iterator().next().properties().scale().minReplicas()); - Assertions.assertEquals(262952356, response.iterator().next().properties().scale().maxReplicas()); - Assertions.assertEquals("jfowxwy", response.iterator().next().properties().serviceBinds().get(0).name()); - Assertions.assertEquals("c", response.iterator().next().properties().serviceBinds().get(0).serviceId()); + Assertions.assertEquals("wo", response.iterator().next().properties().configurations().get(0).propertyName()); + Assertions.assertEquals("fsvagh", response.iterator().next().properties().configurations().get(0).value()); + Assertions.assertEquals(1215763715, response.iterator().next().properties().scale().minReplicas()); + Assertions.assertEquals(1448235256, response.iterator().next().properties().scale().maxReplicas()); + Assertions.assertEquals("ievw", response.iterator().next().properties().serviceBinds().get(0).name()); + Assertions.assertEquals("cvvy", response.iterator().next().properties().serviceBinds().get(0).serviceId()); } } 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 index e0f1ca9d958a..7ce8c91af82b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,19 +12,19 @@ public final class JobConfigurationManualTriggerConfigTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { JobConfigurationManualTriggerConfig model - = BinaryData.fromString("{\"replicaCompletionCount\":1730417051,\"parallelism\":378855798}") + = BinaryData.fromString("{\"replicaCompletionCount\":1953914585,\"parallelism\":381049622}") .toObject(JobConfigurationManualTriggerConfig.class); - Assertions.assertEquals(1730417051, model.replicaCompletionCount()); - Assertions.assertEquals(378855798, model.parallelism()); + Assertions.assertEquals(1953914585, model.replicaCompletionCount()); + Assertions.assertEquals(381049622, model.parallelism()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { JobConfigurationManualTriggerConfig model - = new JobConfigurationManualTriggerConfig().withReplicaCompletionCount(1730417051) - .withParallelism(378855798); + = new JobConfigurationManualTriggerConfig().withReplicaCompletionCount(1953914585) + .withParallelism(381049622); model = BinaryData.fromObject(model).toObject(JobConfigurationManualTriggerConfig.class); - Assertions.assertEquals(1730417051, model.replicaCompletionCount()); - Assertions.assertEquals(378855798, model.parallelism()); + Assertions.assertEquals(1953914585, model.replicaCompletionCount()); + Assertions.assertEquals(381049622, 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 index e825ffe0a2dc..20138dd33991 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,24 +11,23 @@ public final class JobConfigurationScheduleTriggerConfigTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - JobConfigurationScheduleTriggerConfig model = BinaryData - .fromString( - "{\"replicaCompletionCount\":586405587,\"cronExpression\":\"xykxhdj\",\"parallelism\":1418215471}") + JobConfigurationScheduleTriggerConfig model = BinaryData.fromString( + "{\"replicaCompletionCount\":1283350745,\"cronExpression\":\"yvwgcwwpbmzgwe\",\"parallelism\":1953398353}") .toObject(JobConfigurationScheduleTriggerConfig.class); - Assertions.assertEquals(586405587, model.replicaCompletionCount()); - Assertions.assertEquals("xykxhdj", model.cronExpression()); - Assertions.assertEquals(1418215471, model.parallelism()); + Assertions.assertEquals(1283350745, model.replicaCompletionCount()); + Assertions.assertEquals("yvwgcwwpbmzgwe", model.cronExpression()); + Assertions.assertEquals(1953398353, model.parallelism()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { JobConfigurationScheduleTriggerConfig model - = new JobConfigurationScheduleTriggerConfig().withReplicaCompletionCount(586405587) - .withCronExpression("xykxhdj") - .withParallelism(1418215471); + = new JobConfigurationScheduleTriggerConfig().withReplicaCompletionCount(1283350745) + .withCronExpression("yvwgcwwpbmzgwe") + .withParallelism(1953398353); model = BinaryData.fromObject(model).toObject(JobConfigurationScheduleTriggerConfig.class); - Assertions.assertEquals(586405587, model.replicaCompletionCount()); - Assertions.assertEquals("xykxhdj", model.cronExpression()); - Assertions.assertEquals(1418215471, model.parallelism()); + Assertions.assertEquals(1283350745, model.replicaCompletionCount()); + Assertions.assertEquals("yvwgcwwpbmzgwe", model.cronExpression()); + Assertions.assertEquals(1953398353, 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 index 9f7b1d965521..535b38749d23 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,17 +11,9 @@ public final class JobExecutionBaseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - JobExecutionBaseInner model = BinaryData.fromString("{\"name\":\"biuimzdlyjdfq\",\"id\":\"kyoqufdv\"}") + JobExecutionBaseInner model = BinaryData.fromString("{\"name\":\"ejchcsrlz\",\"id\":\"mzlanru\"}") .toObject(JobExecutionBaseInner.class); - Assertions.assertEquals("biuimzdlyjdfq", model.name()); - Assertions.assertEquals("kyoqufdv", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobExecutionBaseInner model = new JobExecutionBaseInner().withName("biuimzdlyjdfq").withId("kyoqufdv"); - model = BinaryData.fromObject(model).toObject(JobExecutionBaseInner.class); - Assertions.assertEquals("biuimzdlyjdfq", model.name()); - Assertions.assertEquals("kyoqufdv", model.id()); + Assertions.assertEquals("ejchcsrlz", model.name()); + Assertions.assertEquals("mzlanru", 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 index aeda62189e90..4eaa833cc1a3 100644 --- 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 @@ -1,99 +1,34 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\":\"hlqhykprlpy\",\"id\":\"uciqdsme\",\"type\":\"itdfuxtyasiib\",\"properties\":{\"status\":\"Stopped\",\"startTime\":\"2021-02-06T14:14:01Z\",\"endTime\":\"2021-03-24T20:59:38Z\",\"template\":{\"containers\":[{\"image\":\"jh\",\"name\":\"g\",\"command\":[\"cmavmqfoudorhcg\",\"yprotwyp\",\"ndm\"],\"args\":[\"ugcmjkavlgorb\"],\"env\":[{}],\"resources\":{\"cpu\":76.50184391700549,\"memory\":\"fjltfvnzcyjtotp\",\"ephemeralStorage\":\"pvpbdbzqgqqiheds\"}}],\"initContainers\":[{\"image\":\"hmkyibc\",\"name\":\"ihsgq\",\"command\":[\"hohsd\",\"mcdzsufcohdxbz\",\"mcmuapc\",\"hdbevwqqxeyskon\"],\"args\":[\"nkfkbgbzb\",\"wxeqocljmygvkzqk\",\"jeokbzefezrxccz\"],\"env\":[{},{},{}],\"resources\":{\"cpu\":78.14739475558221,\"memory\":\"xbkwv\",\"ephemeralStorage\":\"nzvdfbzdixzmq\"}},{\"image\":\"odawopqhewjptmcg\",\"name\":\"ostzelndlatu\",\"command\":[\"lbiojlvfhrb\",\"pn\",\"qvcww\",\"yurmochpprprs\"],\"args\":[\"k\",\"yzejnhlbk\",\"bzpcpiljhahzvec\",\"ndbnwieh\"],\"env\":[{},{},{}],\"resources\":{\"cpu\":31.054065492211336,\"memory\":\"ubwefqs\",\"ephemeralStorage\":\"paq\"}}]}}}") + "{\"properties\":{\"status\":\"Unknown\",\"startTime\":\"2021-01-10T23:50:38Z\",\"endTime\":\"2021-04-18T16:08:42Z\",\"template\":{\"containers\":[{\"image\":\"jhphoyc\",\"name\":\"xaobhdxbmtqioqjz\",\"command\":[\"bmufpown\",\"izhwlrxy\"],\"args\":[\"oqijgkdmbpaz\",\"obcu\"],\"env\":[{},{},{}],\"resources\":{\"cpu\":18.556714481519954,\"memory\":\"cqqjnqglhqgn\",\"ephemeralStorage\":\"ooojywifsqe\"}},{\"image\":\"agdfmglzlh\",\"name\":\"rifkwm\",\"command\":[\"tsizntocipaoua\",\"psqucmpoyf\",\"kfo\",\"knygjofjddeq\"],\"args\":[\"eupewnwreitjz\",\"flusarhmof\",\"qhsmyurkdtml\"],\"env\":[{},{}],\"resources\":{\"cpu\":4.594009479276762,\"memory\":\"txukcdmp\",\"ephemeralStorage\":\"cryuan\"}},{\"image\":\"uxzdxtay\",\"name\":\"hmwhfpmrqo\",\"command\":[\"u\"],\"args\":[\"ryrtihfxtijbpzv\",\"nwzsymg\"],\"env\":[{}],\"resources\":{\"cpu\":77.50267850961393,\"memory\":\"ohdbihanufh\",\"ephemeralStorage\":\"bj\"}},{\"image\":\"a\",\"name\":\"th\",\"command\":[\"abifpikxwczbys\"],\"args\":[\"q\"],\"env\":[{}],\"resources\":{\"cpu\":5.176143207851247,\"memory\":\"iwbybrkxvdumjg\",\"ephemeralStorage\":\"fwvuk\"}}],\"initContainers\":[{\"image\":\"dcc\",\"name\":\"h\",\"command\":[\"nyejhkryhtnap\",\"zw\",\"okjye\",\"kkvnipjox\"],\"args\":[\"chgejspodm\",\"ilzyd\"],\"env\":[{}],\"resources\":{\"cpu\":29.215250116613134,\"memory\":\"uxinpmqnjaq\",\"ephemeralStorage\":\"xj\"}},{\"image\":\"r\",\"name\":\"vcputegj\",\"command\":[\"fdatsc\",\"dvpjhulsuuvmk\",\"ozkrwfndiodjpslw\"],\"args\":[\"pvwryoqpsoacc\",\"azakl\",\"lahbcryff\",\"fdosyg\"],\"env\":[{},{},{},{}],\"resources\":{\"cpu\":58.733613352591284,\"memory\":\"hmsbzjhcrzevdp\",\"ephemeralStorage\":\"xaolth\"}},{\"image\":\"rgqjbpfzfsinzg\",\"name\":\"cjrwzoxxjtfellu\",\"command\":[\"it\",\"np\",\"qfpjk\",\"lxofpdvhpfxxypin\"],\"args\":[\"ayhuy\",\"bkpodepooginuv\",\"mihe\",\"gnarxzxtheo\"],\"env\":[{}],\"resources\":{\"cpu\":24.967819069813192,\"memory\":\"cciqihnhungbwjz\",\"ephemeralStorage\":\"fygxgispemvtzfk\"}}]},\"detailedStatus\":{\"replicas\":[{\"name\":\"jofxqe\",\"containers\":[{}]},{\"name\":\"e\",\"containers\":[{},{},{}]},{\"name\":\"jbasvmsmjqulngs\",\"containers\":[{},{},{},{}]}]},\"reason\":\"ybkzgcwr\",\"message\":\"lxxwrljdouskc\"},\"id\":\"kocrcjdkwtnhx\",\"name\":\"njbiksqrglssain\",\"type\":\"p\"}") .toObject(JobExecutionInner.class); - Assertions.assertEquals("hlqhykprlpy", model.name()); - Assertions.assertEquals("uciqdsme", model.id()); - Assertions.assertEquals("itdfuxtyasiib", model.type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T14:14:01Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-24T20:59:38Z"), model.endTime()); - Assertions.assertEquals("jh", model.template().containers().get(0).image()); - Assertions.assertEquals("g", model.template().containers().get(0).name()); - Assertions.assertEquals("cmavmqfoudorhcg", model.template().containers().get(0).command().get(0)); - Assertions.assertEquals("ugcmjkavlgorb", model.template().containers().get(0).args().get(0)); - Assertions.assertEquals(76.50184391700549D, model.template().containers().get(0).resources().cpu()); - Assertions.assertEquals("fjltfvnzcyjtotp", model.template().containers().get(0).resources().memory()); - Assertions.assertEquals("hmkyibc", model.template().initContainers().get(0).image()); - Assertions.assertEquals("ihsgq", model.template().initContainers().get(0).name()); - Assertions.assertEquals("hohsd", model.template().initContainers().get(0).command().get(0)); - Assertions.assertEquals("nkfkbgbzb", model.template().initContainers().get(0).args().get(0)); - Assertions.assertEquals(78.14739475558221D, model.template().initContainers().get(0).resources().cpu()); - Assertions.assertEquals("xbkwv", model.template().initContainers().get(0).resources().memory()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JobExecutionInner model - = new JobExecutionInner().withName("hlqhykprlpy") - .withId("uciqdsme") - .withType("itdfuxtyasiib") - .withStartTime(OffsetDateTime.parse("2021-02-06T14:14:01Z")) - .withEndTime(OffsetDateTime.parse("2021-03-24T20:59:38Z")) - .withTemplate( - new JobExecutionTemplate() - .withContainers( - Arrays.asList(new JobExecutionContainer().withImage("jh") - .withName("g") - .withCommand(Arrays.asList("cmavmqfoudorhcg", "yprotwyp", "ndm")) - .withArgs(Arrays.asList("ugcmjkavlgorb")) - .withEnv(Arrays.asList(new EnvironmentVar())) - .withResources(new ContainerResources().withCpu(76.50184391700549D) - .withMemory("fjltfvnzcyjtotp")))) - .withInitContainers( - Arrays - .asList( - new JobExecutionContainer().withImage("hmkyibc") - .withName("ihsgq") - .withCommand( - Arrays.asList("hohsd", "mcdzsufcohdxbz", "mcmuapc", "hdbevwqqxeyskon")) - .withArgs(Arrays.asList("nkfkbgbzb", "wxeqocljmygvkzqk", "jeokbzefezrxccz")) - .withEnv(Arrays.asList(new EnvironmentVar(), new EnvironmentVar(), - new EnvironmentVar())) - .withResources( - new ContainerResources().withCpu(78.14739475558221D).withMemory("xbkwv")), - new JobExecutionContainer().withImage("odawopqhewjptmcg") - .withName("ostzelndlatu") - .withCommand(Arrays.asList("lbiojlvfhrb", "pn", "qvcww", "yurmochpprprs")) - .withArgs(Arrays.asList("k", "yzejnhlbk", "bzpcpiljhahzvec", "ndbnwieh")) - .withEnv(Arrays.asList(new EnvironmentVar(), new EnvironmentVar(), - new EnvironmentVar())) - .withResources(new ContainerResources().withCpu(31.054065492211336D) - .withMemory("ubwefqs"))))); - model = BinaryData.fromObject(model).toObject(JobExecutionInner.class); - Assertions.assertEquals("hlqhykprlpy", model.name()); - Assertions.assertEquals("uciqdsme", model.id()); - Assertions.assertEquals("itdfuxtyasiib", model.type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T14:14:01Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-24T20:59:38Z"), model.endTime()); - Assertions.assertEquals("jh", model.template().containers().get(0).image()); - Assertions.assertEquals("g", model.template().containers().get(0).name()); - Assertions.assertEquals("cmavmqfoudorhcg", model.template().containers().get(0).command().get(0)); - Assertions.assertEquals("ugcmjkavlgorb", model.template().containers().get(0).args().get(0)); - Assertions.assertEquals(76.50184391700549D, model.template().containers().get(0).resources().cpu()); - Assertions.assertEquals("fjltfvnzcyjtotp", model.template().containers().get(0).resources().memory()); - Assertions.assertEquals("hmkyibc", model.template().initContainers().get(0).image()); - Assertions.assertEquals("ihsgq", model.template().initContainers().get(0).name()); - Assertions.assertEquals("hohsd", model.template().initContainers().get(0).command().get(0)); - Assertions.assertEquals("nkfkbgbzb", model.template().initContainers().get(0).args().get(0)); - Assertions.assertEquals(78.14739475558221D, model.template().initContainers().get(0).resources().cpu()); - Assertions.assertEquals("xbkwv", model.template().initContainers().get(0).resources().memory()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-10T23:50:38Z"), model.startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-18T16:08:42Z"), model.endTime()); + Assertions.assertEquals("jhphoyc", model.template().containers().get(0).image()); + Assertions.assertEquals("xaobhdxbmtqioqjz", model.template().containers().get(0).name()); + Assertions.assertEquals("bmufpown", model.template().containers().get(0).command().get(0)); + Assertions.assertEquals("oqijgkdmbpaz", model.template().containers().get(0).args().get(0)); + Assertions.assertEquals(18.556714481519954D, model.template().containers().get(0).resources().cpu()); + Assertions.assertEquals("cqqjnqglhqgn", model.template().containers().get(0).resources().memory()); + Assertions.assertEquals("dcc", model.template().initContainers().get(0).image()); + Assertions.assertEquals("h", model.template().initContainers().get(0).name()); + Assertions.assertEquals("nyejhkryhtnap", model.template().initContainers().get(0).command().get(0)); + Assertions.assertEquals("chgejspodm", model.template().initContainers().get(0).args().get(0)); + Assertions.assertEquals(29.215250116613134D, model.template().initContainers().get(0).resources().cpu()); + Assertions.assertEquals("uxinpmqnjaq", model.template().initContainers().get(0).resources().memory()); + Assertions.assertEquals("jofxqe", model.detailedStatus().replicas().get(0).name()); } } 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 index 024a997dbf69..13f025d3c9b8 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -27,7 +27,7 @@ public void testDelete() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.jobs().delete("uvrzmzqmzjqrb", "pv", com.azure.core.util.Context.NONE); + manager.jobs().delete("cptvdxxheig", "lilw", 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 index 0dc86ae918dd..3019d4c9ae3f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -22,7 +22,7 @@ public final class JobsExecutionsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"fiijrykwlefksxqc\",\"id\":\"zfpxgnmqvzvluy\",\"type\":\"aiossscyvaifp\",\"properties\":{\"status\":\"Running\",\"startTime\":\"2021-06-18T06:17:35Z\",\"endTime\":\"2021-10-04T22:51:20Z\",\"template\":{\"containers\":[{\"image\":\"fxtjdhsoym\",\"name\":\"v\",\"command\":[\"ftteh\",\"pboujs\",\"kfvvdshxcde\",\"suenyg\"],\"args\":[\"g\",\"tfrnquk\",\"rf\",\"s\"],\"env\":[{}],\"resources\":{}}],\"initContainers\":[{\"image\":\"ylt\",\"name\":\"ntf\",\"command\":[\"g\",\"jdxwnazkurrdre\",\"zjwhsetwwjwz\"],\"args\":[\"e\",\"zuukykcyqhyqq\"],\"env\":[{},{}],\"resources\":{}}]}}}]}"; + = "{\"value\":[{\"properties\":{\"status\":\"Stopped\",\"startTime\":\"2021-07-28T19:34:21Z\",\"endTime\":\"2021-06-16T00:01:12Z\",\"template\":{\"containers\":[{\"image\":\"ynrceqavfdbdf\",\"name\":\"xjdnajuo\",\"command\":[\"yqmkwlh\"],\"args\":[\"loqd\"],\"env\":[{},{},{},{}],\"resources\":{}},{\"image\":\"xxr\",\"name\":\"obuzmsxga\",\"command\":[\"tkwppthuzd\",\"rmimrljdpoqfxyem\"],\"args\":[\"tbaewhte\"],\"env\":[{},{},{},{}],\"resources\":{}},{\"image\":\"fmxtllf\",\"name\":\"ymqcnrrfijhgga\",\"command\":[\"gamk\",\"ilir\",\"d\"],\"args\":[\"hsdp\",\"ouh\",\"tqrxqwqnjxrdf\"],\"env\":[{}],\"resources\":{}}],\"initContainers\":[{\"image\":\"gtavczcxdfwea\",\"name\":\"fmlxrljphr\",\"command\":[\"ifleimixlmd\",\"gicehfgsmdr\",\"uq\"],\"args\":[\"tokljmtznpaxw\",\"qtyyqiprcltungb\",\"olj\"],\"env\":[{},{}],\"resources\":{}},{\"image\":\"gzbkuckgkdsk\",\"name\":\"tiiqqcqikclsmaln\",\"command\":[\"oykdno\",\"aaxwmgzr\",\"jlqcwny\",\"lleiq\"],\"args\":[\"gvsbtsertoxad\",\"xuvj\",\"xmnrqstjcmet\",\"mlgicvnpvvdhgjna\"],\"env\":[{},{}],\"resources\":{}},{\"image\":\"slz\",\"name\":\"cdsvmwbitek\",\"command\":[\"obvfiybx\",\"ich\",\"ybfzdqekivycp\",\"cv\"],\"args\":[\"ulrqtbht\",\"ezp\"],\"env\":[{},{},{},{}],\"resources\":{}},{\"image\":\"f\",\"name\":\"mdutzfk\",\"command\":[\"no\",\"dccgndjgdpriggqq\"],\"args\":[\"f\",\"buu\"],\"env\":[{}],\"resources\":{}}]},\"detailedStatus\":{\"replicas\":[{\"name\":\"fsh\",\"containers\":[{},{},{}]},{\"name\":\"yohi\",\"containers\":[{},{},{},{}]},{\"name\":\"dc\",\"containers\":[{}]}]},\"reason\":\"qnq\",\"message\":\"ixnmbz\"},\"id\":\"cuyrzwim\",\"name\":\"zayspzvriet\",\"type\":\"fphmdzxplg\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,21 +31,21 @@ public void testList() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.jobsExecutions() - .list("nkbtlwljss", "ctsnldkpwol", "isubxbteog", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.jobsExecutions().list("gicwnxhtfmcqbs", "d", "pgchzpgfqum", com.azure.core.util.Context.NONE); - Assertions.assertEquals("fiijrykwlefksxqc", response.iterator().next().name()); - Assertions.assertEquals("zfpxgnmqvzvluy", response.iterator().next().id()); - Assertions.assertEquals("aiossscyvaifp", response.iterator().next().type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-18T06:17:35Z"), response.iterator().next().startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-04T22:51:20Z"), response.iterator().next().endTime()); - Assertions.assertEquals("fxtjdhsoym", response.iterator().next().template().containers().get(0).image()); - Assertions.assertEquals("v", response.iterator().next().template().containers().get(0).name()); - Assertions.assertEquals("ftteh", response.iterator().next().template().containers().get(0).command().get(0)); - Assertions.assertEquals("g", response.iterator().next().template().containers().get(0).args().get(0)); - Assertions.assertEquals("ylt", response.iterator().next().template().initContainers().get(0).image()); - Assertions.assertEquals("ntf", response.iterator().next().template().initContainers().get(0).name()); - Assertions.assertEquals("g", response.iterator().next().template().initContainers().get(0).command().get(0)); - Assertions.assertEquals("e", response.iterator().next().template().initContainers().get(0).args().get(0)); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-28T19:34:21Z"), response.iterator().next().startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-16T00:01:12Z"), response.iterator().next().endTime()); + Assertions.assertEquals("ynrceqavfdbdf", response.iterator().next().template().containers().get(0).image()); + Assertions.assertEquals("xjdnajuo", response.iterator().next().template().containers().get(0).name()); + Assertions.assertEquals("yqmkwlh", response.iterator().next().template().containers().get(0).command().get(0)); + Assertions.assertEquals("loqd", response.iterator().next().template().containers().get(0).args().get(0)); + Assertions.assertEquals("gtavczcxdfwea", response.iterator().next().template().initContainers().get(0).image()); + Assertions.assertEquals("fmlxrljphr", response.iterator().next().template().initContainers().get(0).name()); + Assertions.assertEquals("ifleimixlmd", + response.iterator().next().template().initContainers().get(0).command().get(0)); + Assertions.assertEquals("tokljmtznpaxw", + response.iterator().next().template().initContainers().get(0).args().get(0)); + Assertions.assertEquals("fsh", response.iterator().next().detailedStatus().replicas().get(0).name()); } } 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 index c8e7dc392626..bc323448a96e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -21,7 +21,7 @@ public final class JobsGetDetectorWithResponseMockTests { @Test public void testGetDetectorWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"metadata\":{\"id\":\"n\",\"name\":\"ywsxvjabjqqaxu\",\"description\":\"y\",\"author\":\"nudn\",\"category\":\"abhjx\",\"supportTopicList\":[{\"id\":\"euipmpvksmitnsq\",\"pesId\":\"l\"},{\"id\":\"lkrdpqgfhy\",\"pesId\":\"rakkld\"}],\"analysisTypes\":[\"wfcmfcnr\"],\"type\":\"jqmatxjtielnzq\",\"score\":22.43058},\"dataset\":[{\"table\":{\"tableName\":\"mtlpqagyno\",\"columns\":[{},{},{}],\"rows\":[\"datacalincryqxz\",\"dataaqzi\",\"datamqimiymqru\"]},\"renderingProperties\":{\"type\":1939195457,\"title\":\"upet\",\"description\":\"vvoqsbpkf\",\"isVisible\":true}},{\"table\":{\"tableName\":\"gxsyaowuzowpu\",\"columns\":[{},{}],\"rows\":[\"dataprgukxrztiochl\",\"datatixmqrudjiz\",\"databfzm\",\"datarunfhiucnmfb\"]},\"renderingProperties\":{\"type\":2078932157,\"title\":\"tk\",\"description\":\"mzuedkyzbfvxovq\",\"isVisible\":true}}],\"status\":{\"message\":\"q\",\"statusId\":1828475728},\"dataProviderMetadata\":{\"providerName\":\"nhyhlwcjsqggj\",\"propertyBag\":[{\"name\":\"xrqrkijpeuqlsd\",\"value\":\"qztvx\"}]}},\"id\":\"wwmjs\",\"name\":\"en\",\"type\":\"wwa\"}"; + = "{\"properties\":{\"metadata\":{\"id\":\"kymffztsils\",\"name\":\"qs\",\"description\":\"iihfymkoui\",\"author\":\"eseuugci\",\"category\":\"hogsmgbvmtd\",\"supportTopicList\":[{\"id\":\"ebjnf\",\"pesId\":\"glab\"}],\"analysisTypes\":[\"biwznhtfgficudy\",\"izpacz\",\"uhbcak\",\"nhokh\"],\"type\":\"twhrjsdm\",\"score\":50.139664},\"dataset\":[{\"table\":{\"tableName\":\"idb\",\"columns\":[{},{}],\"rows\":[\"\\\"datazqpxzbawkikcd\\\"\",\"\\\"datafhbssdpjeyoqxded\\\"\",\"\\\"datacfiwhagxsurejq\\\"\",\"\\\"datashzz\\\"\"]},\"renderingProperties\":{\"type\":439119969,\"title\":\"cxiqq\",\"description\":\"koxdupnamgl\",\"isVisible\":true}},{\"table\":{\"tableName\":\"d\",\"columns\":[{}],\"rows\":[\"\\\"dataqterdqq\\\"\"]},\"renderingProperties\":{\"type\":1612987642,\"title\":\"kghpcv\",\"description\":\"qirvtk\",\"isVisible\":false}},{\"table\":{\"tableName\":\"vfxlapjajodmkrr\",\"columns\":[{},{}],\"rows\":[\"\\\"datavqokql\\\"\",\"\\\"datajqgir\\\"\"]},\"renderingProperties\":{\"type\":1862427572,\"title\":\"vxchpqvct\",\"description\":\"aeuhwwsknstvz\",\"isVisible\":true}}],\"status\":{\"message\":\"upmlppdpgzv\",\"statusId\":1734301537},\"dataProviderMetadata\":{\"providerName\":\"bkarkptg\",\"propertyBag\":[{\"name\":\"uatsyiysjqheni\",\"value\":\"eq\"},{\"name\":\"uba\",\"value\":\"jdeayscse\"},{\"name\":\"zjemexmnvkvm\",\"value\":\"rxl\"},{\"name\":\"wmcpmrrdlhvdvm\",\"value\":\"hbeae\"}]}},\"id\":\"zmhkdclacroczfmu\",\"name\":\"erkeluxzsh\",\"type\":\"zezbzu\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,21 +31,21 @@ public void testGetDetectorWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Diagnostics response = manager.jobs() - .getDetectorWithResponse("wiyjvzuko", "r", "awn", com.azure.core.util.Context.NONE) + .getDetectorWithResponse("nguuzhwvla", "p", "mhjhaus", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("wfcmfcnr", response.properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("mtlpqagyno", response.properties().dataset().get(0).table().tableName()); - Assertions.assertEquals(1939195457, response.properties().dataset().get(0).renderingProperties().type()); - Assertions.assertEquals("upet", response.properties().dataset().get(0).renderingProperties().title()); - Assertions.assertEquals("vvoqsbpkf", + Assertions.assertEquals("biwznhtfgficudy", response.properties().metadata().analysisTypes().get(0)); + Assertions.assertEquals("idb", response.properties().dataset().get(0).table().tableName()); + Assertions.assertEquals(439119969, response.properties().dataset().get(0).renderingProperties().type()); + Assertions.assertEquals("cxiqq", response.properties().dataset().get(0).renderingProperties().title()); + Assertions.assertEquals("koxdupnamgl", response.properties().dataset().get(0).renderingProperties().description()); Assertions.assertTrue(response.properties().dataset().get(0).renderingProperties().isVisible()); - Assertions.assertEquals("q", response.properties().status().message()); - Assertions.assertEquals(1828475728, response.properties().status().statusId()); - Assertions.assertEquals("nhyhlwcjsqggj", response.properties().dataProviderMetadata().providerName()); - Assertions.assertEquals("xrqrkijpeuqlsd", + Assertions.assertEquals("upmlppdpgzv", response.properties().status().message()); + Assertions.assertEquals(1734301537, response.properties().status().statusId()); + Assertions.assertEquals("bkarkptg", response.properties().dataProviderMetadata().providerName()); + Assertions.assertEquals("uatsyiysjqheni", response.properties().dataProviderMetadata().propertyBag().get(0).name()); - Assertions.assertEquals("qztvx", response.properties().dataProviderMetadata().propertyBag().get(0).value()); + Assertions.assertEquals("eq", 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 index a092916eabf8..93f8c2fa0a4d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -22,7 +22,7 @@ public final class JobsListDetectorsMockTests { @Test public void testListDetectors() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"metadata\":{\"id\":\"cmufunlcpxxv\",\"name\":\"yeyng\",\"description\":\"vrquv\",\"author\":\"gglpmcrdcuelj\",\"category\":\"ahxm\",\"supportTopicList\":[{\"id\":\"arvsx\",\"pesId\":\"bglcjkayspthzodu\"},{\"id\":\"lmjtg\",\"pesId\":\"ioskkfmkmfdjxyxg\"},{\"id\":\"kqvjcteoedlr\",\"pesId\":\"skkzpxvjnzdpvo\"}],\"analysisTypes\":[\"hpcnabxzfsn\",\"gyte\"],\"type\":\"zilmhivzkww\",\"score\":40.958393},\"dataset\":[{\"table\":{\"tableName\":\"dajlskzpt\",\"columns\":[{},{},{}],\"rows\":[\"dataeucyrth\",\"dataqlehmcgcjeinu\"]},\"renderingProperties\":{\"type\":1413570369,\"title\":\"mvfejvqnttmbqd\",\"description\":\"zfivfokpysthhzag\",\"isVisible\":false}},{\"table\":{\"tableName\":\"rlhgenuze\",\"columns\":[{},{},{}],\"rows\":[\"dataeba\"]},\"renderingProperties\":{\"type\":1830979931,\"title\":\"rzl\",\"description\":\"mdqgmihzpimcqr\",\"isVisible\":true}},{\"table\":{\"tableName\":\"inklogxs\",\"columns\":[{},{},{},{}],\"rows\":[\"datahzvqnsqktcmbjwz\",\"dataoslpky\"]},\"renderingProperties\":{\"type\":1502522516,\"title\":\"kzpgaj\",\"description\":\"jcemqbmfuvqar\",\"isVisible\":false}},{\"table\":{\"tableName\":\"rebluimmbwxsf\",\"columns\":[{},{},{}],\"rows\":[\"datavxekraokqkbud\"]},\"renderingProperties\":{\"type\":2107378541,\"title\":\"kbavlyt\",\"description\":\"aknwfrkebsmh\",\"isVisible\":false}}],\"status\":{\"message\":\"igatolekscbctna\",\"statusId\":1168856320},\"dataProviderMetadata\":{\"providerName\":\"bzxpdcld\",\"propertyBag\":[{\"name\":\"n\",\"value\":\"laimouxwk\"},{\"name\":\"mud\",\"value\":\"coibicziuswswjrk\"},{\"name\":\"sjhbtq\",\"value\":\"yfscyrfwbivqvo\"}]}},\"id\":\"uyzwvbhlimbyqecr\",\"name\":\"odlikcdrdaasax\",\"type\":\"obsmf\"}]}"; + = "{\"value\":[{\"properties\":{\"metadata\":{\"id\":\"dvqgcnbhcbmjkz\",\"name\":\"bn\",\"description\":\"ntsxjmfmeftvh\",\"author\":\"o\",\"category\":\"jrhskbwgmjgrul\",\"supportTopicList\":[{\"id\":\"xhcxnwjtpfdz\",\"pesId\":\"ouzfwofwakuk\"},{\"id\":\"dtzxsoe\",\"pesId\":\"lwglihezomucmqg\"}],\"analysisTypes\":[\"ionetbzdrdpuenxk\",\"tlzlmtrlxcznnhz\"],\"type\":\"nbmxlx\",\"score\":44.0681},\"dataset\":[{\"table\":{\"tableName\":\"zusitoqcahfs\",\"columns\":[{},{},{},{}],\"rows\":[\"\\\"datareesrfwsszvl\\\"\",\"\\\"datawliso\\\"\",\"\\\"datantfxxcrqmipfjwfo\\\"\",\"\\\"datagizmshxxbaizabu\\\"\"]},\"renderingProperties\":{\"type\":625721867,\"title\":\"k\",\"description\":\"o\",\"isVisible\":false}}],\"status\":{\"message\":\"sjznvhx\",\"statusId\":1004769177},\"dataProviderMetadata\":{\"providerName\":\"paydhfn\",\"propertyBag\":[{\"name\":\"mtfshksnyzmspa\",\"value\":\"bwmbnlslcef\"}]}},\"id\":\"d\",\"name\":\"twtkvih\",\"type\":\"pfliwo\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,27 +32,27 @@ public void testListDetectors() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.jobs().listDetectors("xkecifhocj", "wkloozr", com.azure.core.util.Context.NONE); + = manager.jobs().listDetectors("pzxkzrntmkct", "huosgwqpsqaz", com.azure.core.util.Context.NONE); - Assertions.assertEquals("hpcnabxzfsn", + Assertions.assertEquals("ionetbzdrdpuenxk", response.iterator().next().properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("dajlskzpt", + Assertions.assertEquals("zusitoqcahfs", response.iterator().next().properties().dataset().get(0).table().tableName()); - Assertions.assertEquals(1413570369, + Assertions.assertEquals(625721867, response.iterator().next().properties().dataset().get(0).renderingProperties().type()); - Assertions.assertEquals("mvfejvqnttmbqd", + Assertions.assertEquals("k", response.iterator().next().properties().dataset().get(0).renderingProperties().title()); - Assertions.assertEquals("zfivfokpysthhzag", + Assertions.assertEquals("o", response.iterator().next().properties().dataset().get(0).renderingProperties().description()); Assertions .assertFalse(response.iterator().next().properties().dataset().get(0).renderingProperties().isVisible()); - Assertions.assertEquals("igatolekscbctna", response.iterator().next().properties().status().message()); - Assertions.assertEquals(1168856320, response.iterator().next().properties().status().statusId()); - Assertions.assertEquals("bzxpdcld", + Assertions.assertEquals("sjznvhx", response.iterator().next().properties().status().message()); + Assertions.assertEquals(1004769177, response.iterator().next().properties().status().statusId()); + Assertions.assertEquals("paydhfn", response.iterator().next().properties().dataProviderMetadata().providerName()); - Assertions.assertEquals("n", + Assertions.assertEquals("mtfshksnyzmspa", response.iterator().next().properties().dataProviderMetadata().propertyBag().get(0).name()); - Assertions.assertEquals("laimouxwk", + Assertions.assertEquals("bwmbnlslcef", 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 index fdde654029d6..f6fbf05b7223 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -27,7 +27,7 @@ public void testStopExecution() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.jobs().stopExecution("oifuvnyttzgixgy", "ihlgm", "behlqtxnr", com.azure.core.util.Context.NONE); + manager.jobs().stopExecution("ewnahwkxjjmzt", "lmsoodtmve", "dhdyswcrptveaj", 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 index 0ea830f826df..ac1c7d9ff7df 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -21,7 +21,7 @@ public final class JobsStopMultipleExecutionsMockTests { @Test public void testStopMultipleExecutions() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"owzafczu\",\"id\":\"ljcirvpefycdvei\",\"type\":\"tjnsx\",\"properties\":{\"status\":\"Running\",\"startTime\":\"2021-09-01T14:25:33Z\",\"endTime\":\"2021-10-08T22:15:33Z\",\"template\":{\"containers\":[{}],\"initContainers\":[{},{}]}}},{\"name\":\"bxqvmvuayt\",\"id\":\"dxk\",\"type\":\"qbwpntghyk\",\"properties\":{\"status\":\"Running\",\"startTime\":\"2021-07-12T18:58:47Z\",\"endTime\":\"2021-10-22T05:34:35Z\",\"template\":{\"containers\":[{}],\"initContainers\":[{},{},{},{}]}}}],\"nextLink\":\"ladltxkpbqhvfd\"}"; + = "{\"value\":[{\"properties\":{\"status\":\"Processing\",\"startTime\":\"2021-11-28T00:45:51Z\",\"endTime\":\"2021-02-27T09:22:58Z\",\"template\":{\"containers\":[{}],\"initContainers\":[{},{}]},\"detailedStatus\":{\"replicas\":[{},{}]},\"reason\":\"kahmjedbiucvkhhw\",\"message\":\"pjbweunxcq\"},\"id\":\"ihufoihp\",\"name\":\"iybxvgnzuzpb\",\"type\":\"kzcscpiuzvkun\"},{\"properties\":{\"status\":\"Degraded\",\"startTime\":\"2020-12-23T19:54:33Z\",\"endTime\":\"2021-06-06T16:57:38Z\",\"template\":{\"containers\":[{},{},{},{}],\"initContainers\":[{}]},\"detailedStatus\":{\"replicas\":[{},{}]},\"reason\":\"cdocfqpl\",\"message\":\"o\"},\"id\":\"hxw\",\"name\":\"jlvzklk\",\"type\":\"bgikyjtkakvlbi\"},{\"properties\":{\"status\":\"Running\",\"startTime\":\"2021-10-05T09:15:49Z\",\"endTime\":\"2021-05-28T11:55:32Z\",\"template\":{\"containers\":[{},{},{}],\"initContainers\":[{},{},{}]},\"detailedStatus\":{\"replicas\":[{},{},{}]},\"reason\":\"jixwfgc\",\"message\":\"y\"},\"id\":\"c\",\"name\":\"wnujvqynvav\",\"type\":\"tmdmuqohhihr\"}],\"nextLink\":\"quddrwjclj\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -30,13 +30,11 @@ public void testStopMultipleExecutions() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - ContainerAppJobExecutions response = manager.jobs() - .stopMultipleExecutions("lkndrndpgfjodh", "aqotwfhipxwgsabv", com.azure.core.util.Context.NONE); + ContainerAppJobExecutions response + = manager.jobs().stopMultipleExecutions("oeajogsy", "wetamfddrvlk", com.azure.core.util.Context.NONE); - Assertions.assertEquals("owzafczu", response.value().get(0).name()); - Assertions.assertEquals("ljcirvpefycdvei", response.value().get(0).id()); - Assertions.assertEquals("tjnsx", response.value().get(0).type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-01T14:25:33Z"), response.value().get(0).startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-08T22:15:33Z"), response.value().get(0).endTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-28T00:45:51Z"), response.value().get(0).startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-27T09:22:58Z"), response.value().get(0).endTime()); + Assertions.assertEquals("quddrwjclj", response.nextLink()); } } 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 index bf00df8a7cca..ce3636f36737 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -13,19 +13,18 @@ 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\"]}") + "{\"allowedGroups\":[\"pmjerbdkelvidiz\",\"zsdbccxjmon\"],\"allowedClientApplications\":[\"nwncypuuw\",\"ltv\",\"qjctzenkeif\",\"zhmkdasvflyh\"]}") .toObject(JwtClaimChecks.class); - Assertions.assertEquals("wzo", model.allowedGroups().get(0)); - Assertions.assertEquals("ofpdvh", model.allowedClientApplications().get(0)); + Assertions.assertEquals("pmjerbdkelvidiz", model.allowedGroups().get(0)); + Assertions.assertEquals("nwncypuuw", 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")); + JwtClaimChecks model = new JwtClaimChecks().withAllowedGroups(Arrays.asList("pmjerbdkelvidiz", "zsdbccxjmon")) + .withAllowedClientApplications(Arrays.asList("nwncypuuw", "ltv", "qjctzenkeif", "zhmkdasvflyh")); model = BinaryData.fromObject(model).toObject(JwtClaimChecks.class); - Assertions.assertEquals("wzo", model.allowedGroups().get(0)); - Assertions.assertEquals("ofpdvh", model.allowedClientApplications().get(0)); + Assertions.assertEquals("pmjerbdkelvidiz", model.allowedGroups().get(0)); + Assertions.assertEquals("nwncypuuw", 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 index 24492405c956..395ab465893b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,7 +11,7 @@ public final class KedaConfigurationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { KedaConfiguration model - = BinaryData.fromString("{\"version\":\"wogfnzjvu\"}").toObject(KedaConfiguration.class); + = BinaryData.fromString("{\"version\":\"vnersbycucrw\"}").toObject(KedaConfiguration.class); } @org.junit.jupiter.api.Test diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LabelHistoryCollectionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LabelHistoryCollectionTests.java new file mode 100644 index 000000000000..beab5775a42e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LabelHistoryCollectionTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.implementation.models.LabelHistoryCollection; +import org.junit.jupiter.api.Assertions; + +public final class LabelHistoryCollectionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + LabelHistoryCollection model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"records\":[{\"revision\":\"slol\",\"start\":\"2021-02-21T14:26:24Z\",\"stop\":\"2021-03-28T02:00:51Z\",\"status\":\"Failed\"},{\"revision\":\"vfelfktgplcrpwj\",\"start\":\"2021-11-19T03:15:56Z\",\"stop\":\"2021-07-18T10:14:23Z\",\"status\":\"Failed\"},{\"revision\":\"rnjwmw\",\"start\":\"2021-03-16T02:28:23Z\",\"stop\":\"2021-07-09T21:36:51Z\",\"status\":\"Succeeded\"}]},\"id\":\"jjoqkagf\",\"name\":\"sxtta\",\"type\":\"gzxnfaazpxdtnk\"}],\"nextLink\":\"kqjjlwuenvrkp\"}") + .toObject(LabelHistoryCollection.class); + Assertions.assertEquals("kqjjlwuenvrkp", model.nextLink()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LabelHistoryInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LabelHistoryInnerTests.java new file mode 100644 index 000000000000..0d6b8bd60e8d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LabelHistoryInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.fluent.models.LabelHistoryInner; + +public final class LabelHistoryInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + LabelHistoryInner model = BinaryData.fromString( + "{\"properties\":{\"records\":[{\"revision\":\"ygvjayvblmh\",\"start\":\"2021-07-26T11:14:50Z\",\"stop\":\"2021-12-10T06:42:49Z\",\"status\":\"Failed\"},{\"revision\":\"yhgsopbyrqufe\",\"start\":\"2021-07-20T15:49:39Z\",\"stop\":\"2021-05-12T22:51:33Z\",\"status\":\"Succeeded\"},{\"revision\":\"nhlmctlpdng\",\"start\":\"2021-01-29T19:24:27Z\",\"stop\":\"2021-02-05T15:31:44Z\",\"status\":\"Succeeded\"},{\"revision\":\"ixkwmyijejveg\",\"start\":\"2021-11-23T01:18:41Z\",\"stop\":\"2021-03-10T10:01:23Z\",\"status\":\"Failed\"}]},\"id\":\"exccbdreaxhcexd\",\"name\":\"rvqahqkghtpwi\",\"type\":\"nhyjsv\"}") + .toObject(LabelHistoryInner.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LabelHistoryPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LabelHistoryPropertiesTests.java new file mode 100644 index 000000000000..db46bc13e0f4 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LabelHistoryPropertiesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.LabelHistoryProperties; + +public final class LabelHistoryPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + LabelHistoryProperties model = BinaryData.fromString( + "{\"records\":[{\"revision\":\"z\",\"start\":\"2021-07-29T17:24:39Z\",\"stop\":\"2021-06-29T07:27:22Z\",\"status\":\"Starting\"},{\"revision\":\"vmtgjqppy\",\"start\":\"2021-05-10T01:51:42Z\",\"stop\":\"2021-07-06T23:25:37Z\",\"status\":\"Failed\"},{\"revision\":\"yhgfipnsx\",\"start\":\"2021-11-02T02:58:50Z\",\"stop\":\"2021-10-27T14:15:12Z\",\"status\":\"Succeeded\"}]}") + .toObject(LabelHistoryProperties.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LabelHistoryRecordItemTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LabelHistoryRecordItemTests.java new file mode 100644 index 000000000000..5c8c2e7f7d6e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LabelHistoryRecordItemTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.LabelHistoryRecordItem; + +public final class LabelHistoryRecordItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + LabelHistoryRecordItem model = BinaryData.fromString( + "{\"revision\":\"rjreafxts\",\"start\":\"2021-09-12T04:25:24Z\",\"stop\":\"2021-05-28T06:32:59Z\",\"status\":\"Starting\"}") + .toObject(LabelHistoryRecordItem.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LifecycleConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LifecycleConfigurationTests.java index fc020b2e71bb..615fe1056a9d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LifecycleConfigurationTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LifecycleConfigurationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -13,21 +13,21 @@ public final class LifecycleConfigurationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LifecycleConfiguration model = BinaryData.fromString( - "{\"lifecycleType\":\"OnContainerExit\",\"cooldownPeriodInSeconds\":627294033,\"maxAlivePeriodInSeconds\":939102144}") + "{\"lifecycleType\":\"OnContainerExit\",\"cooldownPeriodInSeconds\":104949992,\"maxAlivePeriodInSeconds\":227486860}") .toObject(LifecycleConfiguration.class); Assertions.assertEquals(LifecycleType.ON_CONTAINER_EXIT, model.lifecycleType()); - Assertions.assertEquals(627294033, model.cooldownPeriodInSeconds()); - Assertions.assertEquals(939102144, model.maxAlivePeriodInSeconds()); + Assertions.assertEquals(104949992, model.cooldownPeriodInSeconds()); + Assertions.assertEquals(227486860, model.maxAlivePeriodInSeconds()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { LifecycleConfiguration model = new LifecycleConfiguration().withLifecycleType(LifecycleType.ON_CONTAINER_EXIT) - .withCooldownPeriodInSeconds(627294033) - .withMaxAlivePeriodInSeconds(939102144); + .withCooldownPeriodInSeconds(104949992) + .withMaxAlivePeriodInSeconds(227486860); model = BinaryData.fromObject(model).toObject(LifecycleConfiguration.class); Assertions.assertEquals(LifecycleType.ON_CONTAINER_EXIT, model.lifecycleType()); - Assertions.assertEquals(627294033, model.cooldownPeriodInSeconds()); - Assertions.assertEquals(939102144, model.maxAlivePeriodInSeconds()); + Assertions.assertEquals(104949992, model.cooldownPeriodInSeconds()); + Assertions.assertEquals(227486860, model.maxAlivePeriodInSeconds()); } } 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 index 5e2f1c5c11a3..f3b4b226b0b1 100644 --- 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 @@ -1,48 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.appcontainers.implementation.models.ListUsagesResult; 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\":62.789894,\"limit\":86.50556,\"name\":{\"value\":\"gapyyrmfsv\",\"localizedValue\":\"avbopfp\"}},{\"currentValue\":29.759396,\"limit\":84.622314,\"name\":{\"value\":\"nupgahxku\",\"localizedValue\":\"sjcaacfdmmcpugm\"}},{\"currentValue\":92.74943,\"limit\":65.175865,\"name\":{\"value\":\"pvufhbze\",\"localizedValue\":\"whoqhnlbqnbldxe\"}}],\"nextLink\":\"lgsc\"}") + "{\"value\":[{\"currentValue\":95.825554,\"limit\":43.0149,\"name\":{\"value\":\"uffatsgftipwc\",\"localizedValue\":\"yubhiqdx\"}},{\"currentValue\":93.451,\"limit\":86.61713,\"name\":{\"value\":\"pnuhzafccnu\",\"localizedValue\":\"i\"}},{\"currentValue\":15.384394,\"limit\":7.8384876,\"name\":{\"value\":\"bui\",\"localizedValue\":\"xvatvcr\"}}],\"nextLink\":\"lbnb\"}") .toObject(ListUsagesResult.class); - Assertions.assertEquals(62.789894f, model.value().get(0).currentValue()); - Assertions.assertEquals(86.50556f, model.value().get(0).limit()); - Assertions.assertEquals("gapyyrmfsv", model.value().get(0).name().value()); - Assertions.assertEquals("avbopfp", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("lgsc", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ListUsagesResult model = new ListUsagesResult() - .withValue(Arrays.asList( - new UsageInner().withCurrentValue(62.789894f) - .withLimit(86.50556f) - .withName(new UsageName().withValue("gapyyrmfsv").withLocalizedValue("avbopfp")), - new UsageInner().withCurrentValue(29.759396f) - .withLimit(84.622314f) - .withName(new UsageName().withValue("nupgahxku").withLocalizedValue("sjcaacfdmmcpugm")), - new UsageInner().withCurrentValue(92.74943f) - .withLimit(65.175865f) - .withName(new UsageName().withValue("pvufhbze").withLocalizedValue("whoqhnlbqnbldxe")))) - .withNextLink("lgsc"); - model = BinaryData.fromObject(model).toObject(ListUsagesResult.class); - Assertions.assertEquals(62.789894f, model.value().get(0).currentValue()); - Assertions.assertEquals(86.50556f, model.value().get(0).limit()); - Assertions.assertEquals("gapyyrmfsv", model.value().get(0).name().value()); - Assertions.assertEquals("avbopfp", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("lgsc", model.nextLink()); + Assertions.assertEquals(95.825554f, model.value().get(0).currentValue()); + Assertions.assertEquals(43.0149f, model.value().get(0).limit()); + Assertions.assertEquals("uffatsgftipwc", model.value().get(0).name().value()); + Assertions.assertEquals("yubhiqdx", model.value().get(0).name().localizedValue()); + Assertions.assertEquals("lbnb", model.nextLink()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LogicAppInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LogicAppInnerTests.java index fdf38bc1a632..33f2eeb7bdf5 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LogicAppInnerTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LogicAppInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,7 +11,7 @@ public final class LogicAppInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LogicAppInner model = BinaryData - .fromString("{\"id\":\"tkcudfbsfarfsiow\",\"name\":\"kjxnqpvwgfstmhq\",\"type\":\"kizmdksaoafclu\"}") + .fromString("{\"id\":\"dhzmmesckdlp\",\"name\":\"gzrcxfailcfxwmdb\",\"type\":\"xdfgsftufqobr\"}") .toObject(LogicAppInner.class); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsCreateOrUpdateWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsCreateOrUpdateWithResponseMockTests.java index 470ce809c108..6b5c81dd819f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsCreateOrUpdateWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -19,7 +19,7 @@ public final class LogicAppsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr = "{\"id\":\"fbklciichgjsysmv\",\"name\":\"o\",\"type\":\"gwxfkzsi\"}"; + String responseStr = "{\"id\":\"xkydfbwlja\",\"name\":\"huerkjddvrglie\",\"type\":\"ftcvbii\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -29,8 +29,8 @@ public void testCreateOrUpdateWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); LogicApp response = manager.logicApps() - .define("txqfpjbq") - .withExistingContainerApp("qdtadrakgdd", "jkrukizyhgsqtnqs") + .define("mxaqklxym") + .withExistingContainerApp("jfuaxroqvqpilrgu", "canlduwzorxs") .create(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsDeleteWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsDeleteWithResponseMockTests.java index a28294376c4c..42fa1a21d568 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsDeleteWithResponseMockTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsDeleteWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -27,7 +27,8 @@ public void testDeleteWithResponse() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.logicApps().deleteWithResponse("d", "fzjuegrhrhtsl", "jtv", com.azure.core.util.Context.NONE); + manager.logicApps() + .deleteWithResponse("ansbvriaqg", "tojrulfucte", "rthcfjzh", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsGetWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsGetWithResponseMockTests.java index 3f1c272614a6..d677a9f99ac0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsGetWithResponseMockTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LogicAppsGetWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -19,7 +19,7 @@ public final class LogicAppsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - String responseStr = "{\"id\":\"xurntujm\",\"name\":\"il\",\"type\":\"nwemhdeeljslkyo\"}"; + String responseStr = "{\"id\":\"q\",\"name\":\"silc\",\"type\":\"hskxx\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -29,7 +29,7 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); LogicApp response = manager.logicApps() - .getWithResponse("sirncclabvoy", "gsuxxczbmyqj", "ghdsaidjanormov", com.azure.core.util.Context.NONE) + .getWithResponse("eetqujxcxxq", "dcqjkedwqurc", "ojmrvvxwjongzse", com.azure.core.util.Context.NONE) .getValue(); } 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 index 8f222853c74f..0e89358b58f8 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,14 +11,14 @@ 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()); + LoginRoutes model = BinaryData.fromString("{\"logoutEndpoint\":\"mdtzfjltfvnzc\"}").toObject(LoginRoutes.class); + Assertions.assertEquals("mdtzfjltfvnzc", model.logoutEndpoint()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LoginRoutes model = new LoginRoutes().withLogoutEndpoint("i"); + LoginRoutes model = new LoginRoutes().withLogoutEndpoint("mdtzfjltfvnzc"); model = BinaryData.fromObject(model).toObject(LoginRoutes.class); - Assertions.assertEquals("i", model.logoutEndpoint()); + Assertions.assertEquals("mdtzfjltfvnzc", 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 index 93bfce2812c1..936fe05b46d7 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,15 +12,15 @@ 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)); + LoginScopes model + = BinaryData.fromString("{\"scopes\":[\"lihrraiouaubr\",\"tloqxfuojrn\"]}").toObject(LoginScopes.class); + Assertions.assertEquals("lihrraiouaubr", model.scopes().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LoginScopes model = new LoginScopes().withScopes(Arrays.asList("uticndvkaozwyif", "yhxhu", "okftyxolniwpwcuk")); + LoginScopes model = new LoginScopes().withScopes(Arrays.asList("lihrraiouaubr", "tloqxfuojrn")); model = BinaryData.fromObject(model).toObject(LoginScopes.class); - Assertions.assertEquals("uticndvkaozwyif", model.scopes().get(0)); + Assertions.assertEquals("lihrraiouaubr", model.scopes().get(0)); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LogsConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LogsConfigurationTests.java new file mode 100644 index 000000000000..ff6170f52fa6 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LogsConfigurationTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.LogsConfiguration; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class LogsConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + LogsConfiguration model = BinaryData.fromString("{\"destinations\":[\"m\"]}").toObject(LogsConfiguration.class); + Assertions.assertEquals("m", model.destinations().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + LogsConfiguration model = new LogsConfiguration().withDestinations(Arrays.asList("m")); + model = BinaryData.fromObject(model).toObject(LogsConfiguration.class); + Assertions.assertEquals("m", model.destinations().get(0)); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationCollectionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationCollectionTests.java index aff1ac070c26..f7592af10056 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationCollectionTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationCollectionTests.java @@ -1,47 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.MaintenanceConfigurationResourceInner; -import com.azure.resourcemanager.appcontainers.models.MaintenanceConfigurationCollection; -import com.azure.resourcemanager.appcontainers.models.ScheduledEntry; +import com.azure.resourcemanager.appcontainers.implementation.models.MaintenanceConfigurationCollection; import com.azure.resourcemanager.appcontainers.models.WeekDay; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class MaintenanceConfigurationCollectionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MaintenanceConfigurationCollection model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"scheduledEntries\":[{\"weekDay\":\"Tuesday\",\"startHourUtc\":1908236647,\"durationHours\":475630723},{\"weekDay\":\"Friday\",\"startHourUtc\":1747259032,\"durationHours\":58075104},{\"weekDay\":\"Wednesday\",\"startHourUtc\":342947659,\"durationHours\":1385707551},{\"weekDay\":\"Friday\",\"startHourUtc\":1980561633,\"durationHours\":619762190}]},\"id\":\"btcjuah\",\"name\":\"kqtob\",\"type\":\"auxofshfph\"}],\"nextLink\":\"nulaiywzejywhsl\"}") + "{\"value\":[{\"properties\":{\"scheduledEntries\":[{\"weekDay\":\"Tuesday\",\"startHourUtc\":1537959209,\"durationHours\":720636191}]},\"id\":\"xdtddmflhuytxzv\",\"name\":\"zna\",\"type\":\"xbannovvoxc\"},{\"properties\":{\"scheduledEntries\":[{\"weekDay\":\"Saturday\",\"startHourUtc\":504804591,\"durationHours\":1728188290},{\"weekDay\":\"Tuesday\",\"startHourUtc\":1788406883,\"durationHours\":451158053}]},\"id\":\"oevytlyokr\",\"name\":\"rouuxvnsasbcry\",\"type\":\"o\"},{\"properties\":{\"scheduledEntries\":[{\"weekDay\":\"Sunday\",\"startHourUtc\":683265058,\"durationHours\":952405971},{\"weekDay\":\"Sunday\",\"startHourUtc\":1220621790,\"durationHours\":1416170888}]},\"id\":\"xnazpmkml\",\"name\":\"vevfxz\",\"type\":\"pj\"},{\"properties\":{\"scheduledEntries\":[{\"weekDay\":\"Monday\",\"startHourUtc\":1553253878,\"durationHours\":252805227},{\"weekDay\":\"Tuesday\",\"startHourUtc\":881818837,\"durationHours\":1704256415}]},\"id\":\"dd\",\"name\":\"fg\",\"type\":\"qbawpcbbnzqcykn\"}],\"nextLink\":\"qofyuicdhzbdy\"}") .toObject(MaintenanceConfigurationCollection.class); Assertions.assertEquals(WeekDay.TUESDAY, model.value().get(0).scheduledEntries().get(0).weekDay()); - Assertions.assertEquals(1908236647, model.value().get(0).scheduledEntries().get(0).startHourUtc()); - Assertions.assertEquals(475630723, model.value().get(0).scheduledEntries().get(0).durationHours()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenanceConfigurationCollection model = new MaintenanceConfigurationCollection() - .withValue(Arrays.asList(new MaintenanceConfigurationResourceInner().withScheduledEntries(Arrays.asList( - new ScheduledEntry().withWeekDay(WeekDay.TUESDAY) - .withStartHourUtc(1908236647) - .withDurationHours(475630723), - new ScheduledEntry().withWeekDay(WeekDay.FRIDAY) - .withStartHourUtc(1747259032) - .withDurationHours(58075104), - new ScheduledEntry().withWeekDay(WeekDay.WEDNESDAY) - .withStartHourUtc(342947659) - .withDurationHours(1385707551), - new ScheduledEntry().withWeekDay(WeekDay.FRIDAY) - .withStartHourUtc(1980561633) - .withDurationHours(619762190))))); - model = BinaryData.fromObject(model).toObject(MaintenanceConfigurationCollection.class); - Assertions.assertEquals(WeekDay.TUESDAY, model.value().get(0).scheduledEntries().get(0).weekDay()); - Assertions.assertEquals(1908236647, model.value().get(0).scheduledEntries().get(0).startHourUtc()); - Assertions.assertEquals(475630723, model.value().get(0).scheduledEntries().get(0).durationHours()); + Assertions.assertEquals(1537959209, model.value().get(0).scheduledEntries().get(0).startHourUtc()); + Assertions.assertEquals(720636191, model.value().get(0).scheduledEntries().get(0).durationHours()); + Assertions.assertEquals("qofyuicdhzbdy", model.nextLink()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationResourceInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationResourceInnerTests.java index bea8dc33b540..eae5d6fcee5d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationResourceInnerTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationResourceInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -15,32 +15,32 @@ public final class MaintenanceConfigurationResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MaintenanceConfigurationResourceInner model = BinaryData.fromString( - "{\"properties\":{\"scheduledEntries\":[{\"weekDay\":\"Monday\",\"startHourUtc\":1709096498,\"durationHours\":1835022726},{\"weekDay\":\"Sunday\",\"startHourUtc\":1860426462,\"durationHours\":444812162},{\"weekDay\":\"Tuesday\",\"startHourUtc\":1439571591,\"durationHours\":1548261318},{\"weekDay\":\"Friday\",\"startHourUtc\":1233897437,\"durationHours\":1425095527}]},\"id\":\"afgfugsnn\",\"name\":\"hyet\",\"type\":\"fypococtfjgti\"}") + "{\"properties\":{\"scheduledEntries\":[{\"weekDay\":\"Tuesday\",\"startHourUtc\":1571767123,\"durationHours\":64736512},{\"weekDay\":\"Saturday\",\"startHourUtc\":879806054,\"durationHours\":1124530948},{\"weekDay\":\"Tuesday\",\"startHourUtc\":94628257,\"durationHours\":1046360086},{\"weekDay\":\"Saturday\",\"startHourUtc\":972204015,\"durationHours\":705317709}]},\"id\":\"cqxypokkhminq\",\"name\":\"ymc\",\"type\":\"ngnbdxxew\"}") .toObject(MaintenanceConfigurationResourceInner.class); - Assertions.assertEquals(WeekDay.MONDAY, model.scheduledEntries().get(0).weekDay()); - Assertions.assertEquals(1709096498, model.scheduledEntries().get(0).startHourUtc()); - Assertions.assertEquals(1835022726, model.scheduledEntries().get(0).durationHours()); + Assertions.assertEquals(WeekDay.TUESDAY, model.scheduledEntries().get(0).weekDay()); + Assertions.assertEquals(1571767123, model.scheduledEntries().get(0).startHourUtc()); + Assertions.assertEquals(64736512, model.scheduledEntries().get(0).durationHours()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { MaintenanceConfigurationResourceInner model = new MaintenanceConfigurationResourceInner().withScheduledEntries(Arrays.asList( - new ScheduledEntry().withWeekDay(WeekDay.MONDAY) - .withStartHourUtc(1709096498) - .withDurationHours(1835022726), - new ScheduledEntry().withWeekDay(WeekDay.SUNDAY) - .withStartHourUtc(1860426462) - .withDurationHours(444812162), new ScheduledEntry().withWeekDay(WeekDay.TUESDAY) - .withStartHourUtc(1439571591) - .withDurationHours(1548261318), - new ScheduledEntry().withWeekDay(WeekDay.FRIDAY) - .withStartHourUtc(1233897437) - .withDurationHours(1425095527))); + .withStartHourUtc(1571767123) + .withDurationHours(64736512), + new ScheduledEntry().withWeekDay(WeekDay.SATURDAY) + .withStartHourUtc(879806054) + .withDurationHours(1124530948), + new ScheduledEntry().withWeekDay(WeekDay.TUESDAY) + .withStartHourUtc(94628257) + .withDurationHours(1046360086), + new ScheduledEntry().withWeekDay(WeekDay.SATURDAY) + .withStartHourUtc(972204015) + .withDurationHours(705317709))); model = BinaryData.fromObject(model).toObject(MaintenanceConfigurationResourceInner.class); - Assertions.assertEquals(WeekDay.MONDAY, model.scheduledEntries().get(0).weekDay()); - Assertions.assertEquals(1709096498, model.scheduledEntries().get(0).startHourUtc()); - Assertions.assertEquals(1835022726, model.scheduledEntries().get(0).durationHours()); + Assertions.assertEquals(WeekDay.TUESDAY, model.scheduledEntries().get(0).weekDay()); + Assertions.assertEquals(1571767123, model.scheduledEntries().get(0).startHourUtc()); + Assertions.assertEquals(64736512, model.scheduledEntries().get(0).durationHours()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationsCreateOrUpdateWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationsCreateOrUpdateWithResponseMockTests.java index f0d747ada9e4..2cd35f561900 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationsCreateOrUpdateWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -24,7 +24,7 @@ public final class MaintenanceConfigurationsCreateOrUpdateWithResponseMockTests @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"scheduledEntries\":[{\"weekDay\":\"Tuesday\",\"startHourUtc\":1864342091,\"durationHours\":229729592},{\"weekDay\":\"Thursday\",\"startHourUtc\":1659751922,\"durationHours\":485350824},{\"weekDay\":\"Tuesday\",\"startHourUtc\":962255720,\"durationHours\":1456715008}]},\"id\":\"gprkjgu\",\"name\":\"rjmwvvbtuqkxxi\",\"type\":\"wgxql\"}"; + = "{\"properties\":{\"scheduledEntries\":[{\"weekDay\":\"Friday\",\"startHourUtc\":1007635827,\"durationHours\":1122124593}]},\"id\":\"fzuscstun\",\"name\":\"lhxd\",\"type\":\"bkl\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -34,22 +34,19 @@ public void testCreateOrUpdateWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); MaintenanceConfigurationResource response = manager.maintenanceConfigurations() - .define("hmxvvl") - .withExistingManagedEnvironment("pcqzg", "hotjec") + .define("aujegqdtadra") + .withExistingManagedEnvironment("qcrzgeuqxbpia", "w") .withScheduledEntries(Arrays.asList( - new ScheduledEntry().withWeekDay(WeekDay.FRIDAY) - .withStartHourUtc(1354713617) - .withDurationHours(1723467853), new ScheduledEntry().withWeekDay(WeekDay.MONDAY) - .withStartHourUtc(750981171) - .withDurationHours(709169599), - new ScheduledEntry().withWeekDay(WeekDay.FRIDAY) - .withStartHourUtc(1117495980) - .withDurationHours(782286269))) + .withStartHourUtc(924951023) + .withDurationHours(2114055987), + new ScheduledEntry().withWeekDay(WeekDay.THURSDAY) + .withStartHourUtc(663362801) + .withDurationHours(1102666510))) .create(); - Assertions.assertEquals(WeekDay.TUESDAY, response.scheduledEntries().get(0).weekDay()); - Assertions.assertEquals(1864342091, response.scheduledEntries().get(0).startHourUtc()); - Assertions.assertEquals(229729592, response.scheduledEntries().get(0).durationHours()); + Assertions.assertEquals(WeekDay.FRIDAY, response.scheduledEntries().get(0).weekDay()); + Assertions.assertEquals(1007635827, response.scheduledEntries().get(0).startHourUtc()); + Assertions.assertEquals(1122124593, response.scheduledEntries().get(0).durationHours()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationsDeleteWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationsDeleteWithResponseMockTests.java index 989ce2ad9c6f..96f1bbd1276d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationsDeleteWithResponseMockTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationsDeleteWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -28,7 +28,7 @@ public void testDeleteWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.maintenanceConfigurations() - .deleteWithResponse("gbzsxebrslt", "fyhcdjw", "uoard", com.azure.core.util.Context.NONE); + .deleteWithResponse("yvrmkjm", "it", "chwudlxee", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationsGetWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationsGetWithResponseMockTests.java index 053dcb07d94b..40e4b7cdd505 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationsGetWithResponseMockTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationsGetWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -22,7 +22,7 @@ public final class MaintenanceConfigurationsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"scheduledEntries\":[{\"weekDay\":\"Tuesday\",\"startHourUtc\":1714439660,\"durationHours\":411525724},{\"weekDay\":\"Wednesday\",\"startHourUtc\":1637733291,\"durationHours\":1962986932},{\"weekDay\":\"Wednesday\",\"startHourUtc\":67847643,\"durationHours\":477006043}]},\"id\":\"slwhdmcvhtbb\",\"name\":\"jhfv\",\"type\":\"uwzb\"}"; + = "{\"properties\":{\"scheduledEntries\":[{\"weekDay\":\"Saturday\",\"startHourUtc\":721119965,\"durationHours\":584126929},{\"weekDay\":\"Wednesday\",\"startHourUtc\":2025512085,\"durationHours\":83341894},{\"weekDay\":\"Tuesday\",\"startHourUtc\":1086592349,\"durationHours\":1039949457},{\"weekDay\":\"Thursday\",\"startHourUtc\":2015345147,\"durationHours\":1839172932}]},\"id\":\"uxejgwecywnfyszz\",\"name\":\"czs\",\"type\":\"nqbdnddbboz\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,11 +32,11 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); MaintenanceConfigurationResource response = manager.maintenanceConfigurations() - .getWithResponse("agttpufpb", "g", "rholhujbfwxi", com.azure.core.util.Context.NONE) + .getWithResponse("j", "xvgjbfi", "bpnjodf", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(WeekDay.TUESDAY, response.scheduledEntries().get(0).weekDay()); - Assertions.assertEquals(1714439660, response.scheduledEntries().get(0).startHourUtc()); - Assertions.assertEquals(411525724, response.scheduledEntries().get(0).durationHours()); + Assertions.assertEquals(WeekDay.SATURDAY, response.scheduledEntries().get(0).weekDay()); + Assertions.assertEquals(721119965, response.scheduledEntries().get(0).startHourUtc()); + Assertions.assertEquals(584126929, response.scheduledEntries().get(0).durationHours()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationsListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationsListMockTests.java index 821154628666..c8e7f60fca4d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationsListMockTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MaintenanceConfigurationsListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -23,7 +23,7 @@ public final class MaintenanceConfigurationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"scheduledEntries\":[{\"weekDay\":\"Thursday\",\"startHourUtc\":428488381,\"durationHours\":276935692},{\"weekDay\":\"Thursday\",\"startHourUtc\":2081787522,\"durationHours\":1931497357},{\"weekDay\":\"Monday\",\"startHourUtc\":562316193,\"durationHours\":1040898912},{\"weekDay\":\"Wednesday\",\"startHourUtc\":1260910253,\"durationHours\":2037921455}]},\"id\":\"uws\",\"name\":\"kxx\",\"type\":\"clhuulriqbyokv\"}]}"; + = "{\"value\":[{\"properties\":{\"scheduledEntries\":[{\"weekDay\":\"Monday\",\"startHourUtc\":1172854495,\"durationHours\":481196341}]},\"id\":\"vmtywhlakxp\",\"name\":\"jpewpyjlfx\",\"type\":\"m\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,11 +32,11 @@ public void testList() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response - = manager.maintenanceConfigurations().list("wiinjdllw", "tlepowavvqxua", com.azure.core.util.Context.NONE); + PagedIterable response = manager.maintenanceConfigurations() + .list("htpmnoejhq", "fmsibzoyrfgxkyd", com.azure.core.util.Context.NONE); - Assertions.assertEquals(WeekDay.THURSDAY, response.iterator().next().scheduledEntries().get(0).weekDay()); - Assertions.assertEquals(428488381, response.iterator().next().scheduledEntries().get(0).startHourUtc()); - Assertions.assertEquals(276935692, response.iterator().next().scheduledEntries().get(0).durationHours()); + Assertions.assertEquals(WeekDay.MONDAY, response.iterator().next().scheduledEntries().get(0).weekDay()); + Assertions.assertEquals(1172854495, response.iterator().next().scheduledEntries().get(0).startHourUtc()); + Assertions.assertEquals(481196341, response.iterator().next().scheduledEntries().get(0).durationHours()); } } 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 index 089441a8b8c2..cc88de6083b9 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -13,18 +13,16 @@ public final class ManagedCertificatePatchTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ManagedCertificatePatch model - = BinaryData.fromString("{\"tags\":{\"cpopmxel\":\"ickpz\",\"xm\":\"wcltyjede\"}}") - .toObject(ManagedCertificatePatch.class); - Assertions.assertEquals("ickpz", model.tags().get("cpopmxel")); + ManagedCertificatePatch model = BinaryData.fromString("{\"tags\":{\"fchnmnah\":\"uogphuartvtiuky\"}}") + .toObject(ManagedCertificatePatch.class); + Assertions.assertEquals("uogphuartvtiuky", model.tags().get("fchnmnah")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ManagedCertificatePatch model - = new ManagedCertificatePatch().withTags(mapOf("cpopmxel", "ickpz", "xm", "wcltyjede")); + ManagedCertificatePatch model = new ManagedCertificatePatch().withTags(mapOf("fchnmnah", "uogphuartvtiuky")); model = BinaryData.fromObject(model).toObject(ManagedCertificatePatch.class); - Assertions.assertEquals("ickpz", model.tags().get("cpopmxel")); + Assertions.assertEquals("uogphuartvtiuky", model.tags().get("fchnmnah")); } // Use "Map.of" if available 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 index a71c69429309..e9c3372a3660 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -28,7 +28,7 @@ public void testDeleteWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.managedCertificates() - .deleteWithResponse("glkmiqwnnr", "clibbfqpsp", "ladydgnhautwu", com.azure.core.util.Context.NONE); + .deleteWithResponse("batecaat", "dohzniucbdaombwi", "njdllwktlepowavv", 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 index 12a2e87b6a70..202afcd3c504 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -21,7 +21,7 @@ public final class ManagedEnvironmentDiagnosticsGetDetectorWithResponseMockTests @Test public void testGetDetectorWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"metadata\":{\"id\":\"pmfbfununmpzkr\",\"name\":\"yifkdschlzvf\",\"description\":\"tnkjjwgcwnphb\",\"author\":\"fyrtogmhmjp\",\"category\":\"cdf\",\"supportTopicList\":[{\"id\":\"tygevgwmseharx\",\"pesId\":\"vqnrxtmbpj\"},{\"id\":\"nvwjhrsidqpxl\",\"pesId\":\"pakftngatwm\"},{\"id\":\"yutrymd\",\"pesId\":\"fj\"},{\"id\":\"y\",\"pesId\":\"jqdvdwkqpldrlefg\"}],\"analysisTypes\":[\"vuagntetaout\",\"pdctuhspfefyi\",\"duyeuyl\"],\"type\":\"hmtybkcgsuthhll\",\"score\":37.07304},\"dataset\":[{\"table\":{\"tableName\":\"x\",\"columns\":[{}],\"rows\":[\"datai\",\"datatxtjrrlkmds\",\"datajhhxdlajf\"]},\"renderingProperties\":{\"type\":725206748,\"title\":\"cvslxlhuavkrmukm\",\"description\":\"mkxettcsloj\",\"isVisible\":false}},{\"table\":{\"tableName\":\"nqtoqx\",\"columns\":[{},{},{},{}],\"rows\":[\"datas\",\"datahtkbtnq\",\"datarngl\",\"datambiipsnawwlqk\"]},\"renderingProperties\":{\"type\":683780754,\"title\":\"llxricc\",\"description\":\"wmuqqoajxeiygle\",\"isVisible\":true}},{\"table\":{\"tableName\":\"exh\",\"columns\":[{},{},{},{}],\"rows\":[\"dataeqnkbrupobehdml\",\"datazacvu\",\"dataepj\",\"databibnzpphepifex\"]},\"renderingProperties\":{\"type\":64726617,\"title\":\"ccjclykcgxvrpjlv\",\"description\":\"uod\",\"isVisible\":true}},{\"table\":{\"tableName\":\"ettepdjxqe\",\"columns\":[{}],\"rows\":[\"datauiylpc\",\"dataaewse\",\"datavesk\",\"dataxegqphr\"]},\"renderingProperties\":{\"type\":1143125594,\"title\":\"ctmjtsghpbcbc\",\"description\":\"arpzeqacdldtzm\",\"isVisible\":false}}],\"status\":{\"message\":\"cpczshnuqnd\",\"statusId\":1771548992},\"dataProviderMetadata\":{\"providerName\":\"fkhuytu\",\"propertyBag\":[{\"name\":\"mtvtvegwqiukvzwy\",\"value\":\"tthaokgkskj\"}]}},\"id\":\"bs\",\"name\":\"hajqfuk\",\"type\":\"eexpgeumi\"}"; + = "{\"properties\":{\"metadata\":{\"id\":\"ycuxdtzcqip\",\"name\":\"ud\",\"description\":\"o\",\"author\":\"omehx\",\"category\":\"ntolamlb\",\"supportTopicList\":[{\"id\":\"kqllczipvwdt\",\"pesId\":\"kzdqiqdlratrkwxo\"},{\"id\":\"wxsuy\",\"pesId\":\"nhrfgslgl\"},{\"id\":\"ry\",\"pesId\":\"zihuioaeo\"},{\"id\":\"ajtfey\",\"pesId\":\"bdgddkrh\"}],\"analysisTypes\":[\"xbeuuqu\",\"kzwtjwwguzytij\",\"xfn\",\"ndegjdydhqkkkbj\"],\"type\":\"kcat\",\"score\":89.15191},\"dataset\":[{\"table\":{\"tableName\":\"cnxtpzdlysei\",\"columns\":[{}],\"rows\":[\"\\\"dataatprytgrhzbq\\\"\",\"\\\"datad\\\"\",\"\\\"datafa\\\"\",\"\\\"datarptvcshtkutzcttb\\\"\"]},\"renderingProperties\":{\"type\":452519710,\"title\":\"d\",\"description\":\"m\",\"isVisible\":false}},{\"table\":{\"tableName\":\"fjfxtbw\",\"columns\":[{}],\"rows\":[\"\\\"datauydgfttmdofgeoa\\\"\"]},\"renderingProperties\":{\"type\":376615373,\"title\":\"tnxodwxm\",\"description\":\"jwiygmgsevmdmze\",\"isVisible\":true}},{\"table\":{\"tableName\":\"gfc\",\"columns\":[{}],\"rows\":[\"\\\"datacidt\\\"\"]},\"renderingProperties\":{\"type\":98315568,\"title\":\"yznm\",\"description\":\"cdo\",\"isVisible\":false}},{\"table\":{\"tableName\":\"gytoxuwhtt\",\"columns\":[{},{},{},{}],\"rows\":[\"\\\"dataqmebgszplusdekpd\\\"\"]},\"renderingProperties\":{\"type\":1706968612,\"title\":\"gpgvokyejidbdq\",\"description\":\"qunycwztlvvw\",\"isVisible\":false}}],\"status\":{\"message\":\"kyjtrepw\",\"statusId\":1685110120},\"dataProviderMetadata\":{\"providerName\":\"auxuvavcpfpdofu\",\"propertyBag\":[{\"name\":\"btxluevsolzwil\",\"value\":\"gojfsqe\"},{\"name\":\"uxjxhfxf\",\"value\":\"pdkktpmbmxbmbr\"}]}},\"id\":\"zzxljbkhxsdpla\",\"name\":\"mydmhweqjfyxydgt\",\"type\":\"kvqb\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,23 +31,20 @@ public void testGetDetectorWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Diagnostics response = manager.managedEnvironmentDiagnostics() - .getDetectorWithResponse("sjjzyvoaqajuveh", "ptdmkrrbhmpful", "be", com.azure.core.util.Context.NONE) + .getDetectorWithResponse("ovbooqbmdqrxy", "laetscflwtjdtlr", "e", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("vuagntetaout", response.properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("x", response.properties().dataset().get(0).table().tableName()); - Assertions.assertEquals(725206748, response.properties().dataset().get(0).renderingProperties().type()); - Assertions.assertEquals("cvslxlhuavkrmukm", - response.properties().dataset().get(0).renderingProperties().title()); - Assertions.assertEquals("mkxettcsloj", - response.properties().dataset().get(0).renderingProperties().description()); + Assertions.assertEquals("xbeuuqu", response.properties().metadata().analysisTypes().get(0)); + Assertions.assertEquals("cnxtpzdlysei", response.properties().dataset().get(0).table().tableName()); + Assertions.assertEquals(452519710, response.properties().dataset().get(0).renderingProperties().type()); + Assertions.assertEquals("d", response.properties().dataset().get(0).renderingProperties().title()); + Assertions.assertEquals("m", response.properties().dataset().get(0).renderingProperties().description()); Assertions.assertFalse(response.properties().dataset().get(0).renderingProperties().isVisible()); - Assertions.assertEquals("cpczshnuqnd", response.properties().status().message()); - Assertions.assertEquals(1771548992, response.properties().status().statusId()); - Assertions.assertEquals("fkhuytu", response.properties().dataProviderMetadata().providerName()); - Assertions.assertEquals("mtvtvegwqiukvzwy", + Assertions.assertEquals("kyjtrepw", response.properties().status().message()); + Assertions.assertEquals(1685110120, response.properties().status().statusId()); + Assertions.assertEquals("auxuvavcpfpdofu", response.properties().dataProviderMetadata().providerName()); + Assertions.assertEquals("btxluevsolzwil", response.properties().dataProviderMetadata().propertyBag().get(0).name()); - Assertions.assertEquals("tthaokgkskj", - response.properties().dataProviderMetadata().propertyBag().get(0).value()); + Assertions.assertEquals("gojfsqe", 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 index f2fe9147d776..69f0fc2677f9 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -21,7 +21,7 @@ public final class ManagedEnvironmentDiagnosticsListDetectorsWithResponseMockTes @Test public void testListDetectorsWithResponse() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"metadata\":{\"id\":\"zxrrfc\",\"name\":\"r\",\"description\":\"hgsnxuwwkpph\",\"author\":\"sbzxl\",\"category\":\"xomeikjclwzacn\",\"supportTopicList\":[{},{},{}],\"analysisTypes\":[\"uqtaazyqbxyxoyf\",\"uqqiqezxlhd\",\"zq\"],\"type\":\"a\",\"score\":70.80547},\"dataset\":[{},{}],\"status\":{\"message\":\"j\",\"statusId\":1471030356},\"dataProviderMetadata\":{\"providerName\":\"iybmrzoep\",\"propertyBag\":[{},{},{},{}]}},\"id\":\"v\",\"name\":\"njkgvfnmx\",\"type\":\"ursqf\"},{\"properties\":{\"metadata\":{\"id\":\"yibuyvpirfqjpnqn\",\"name\":\"w\",\"description\":\"edenrexkxbhxv\",\"author\":\"nul\",\"category\":\"nhj\",\"supportTopicList\":[{},{},{}],\"analysisTypes\":[\"nfa\",\"svkskmqoz\"],\"type\":\"ivyhjrliizjixlqf\",\"score\":19.982082},\"dataset\":[{}],\"status\":{\"message\":\"solronqqlm\",\"statusId\":561135071},\"dataProviderMetadata\":{\"providerName\":\"sjxtel\",\"propertyBag\":[{},{}]}},\"id\":\"uqbo\",\"name\":\"oolzqocarkuzl\",\"type\":\"cnn\"},{\"properties\":{\"metadata\":{\"id\":\"xawqy\",\"name\":\"lhdyzmyckzex\",\"description\":\"akckywym\",\"author\":\"aabjkdtfohfao\",\"category\":\"vkiwrsiwdyjqu\",\"supportTopicList\":[{}],\"analysisTypes\":[\"raueekcsueh\"],\"type\":\"ddacbcbgydlqidy\",\"score\":74.43678},\"dataset\":[{},{},{},{}],\"status\":{\"message\":\"ril\",\"statusId\":1093314726},\"dataProviderMetadata\":{\"providerName\":\"qqxvztpbn\",\"propertyBag\":[{},{},{},{}]}},\"id\":\"xjtomalswbn\",\"name\":\"ddepldwqjns\",\"type\":\"zygleexahvm\"}],\"nextLink\":\"hsbrcary\"}"; + = "{\"value\":[{\"properties\":{\"metadata\":{\"id\":\"sx\",\"name\":\"ofuworimmovzwde\",\"description\":\"kmvhzfo\",\"author\":\"nyrvaprtgelg\",\"category\":\"wikfyaqandmym\",\"supportTopicList\":[{},{}],\"analysisTypes\":[\"umov\"],\"type\":\"bpbvzopaxmf\",\"score\":58.94165},\"dataset\":[{},{}],\"status\":{\"message\":\"xfaxdtnq\",\"statusId\":903952775},\"dataProviderMetadata\":{\"providerName\":\"troiauesugmo\",\"propertyBag\":[{},{}]}},\"id\":\"ycbo\",\"name\":\"lrgttwfldsiuor\",\"type\":\"nikcedpk\"},{\"properties\":{\"metadata\":{\"id\":\"mmtmqrxrzqvvycz\",\"name\":\"yubtgmbxiqah\",\"description\":\"gpx\",\"author\":\"bp\",\"category\":\"upoyryefqm\",\"supportTopicList\":[{},{}],\"analysisTypes\":[\"t\",\"lnomfpb\",\"ceeg\",\"yieztkutnjil\"],\"type\":\"kkreh\",\"score\":56.38168},\"dataset\":[{},{},{},{}],\"status\":{\"message\":\"uif\",\"statusId\":1367021385},\"dataProviderMetadata\":{\"providerName\":\"aryrvj\",\"propertyBag\":[{},{}]}},\"id\":\"zvj\",\"name\":\"wahoyiyaxqvjw\",\"type\":\"i\"}],\"nextLink\":\"czkddn\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,14 +31,14 @@ public void testListDetectorsWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); DiagnosticsCollection response = manager.managedEnvironmentDiagnostics() - .listDetectorsWithResponse("tbjczjnciui", "qvldaswvppisqqzl", com.azure.core.util.Context.NONE) + .listDetectorsWithResponse("pvdvatlzmgs", "hnzrsbkkzovlzdm", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("uqtaazyqbxyxoyf", - response.value().get(0).properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("j", response.value().get(0).properties().status().message()); - Assertions.assertEquals(1471030356, response.value().get(0).properties().status().statusId()); - Assertions.assertEquals("iybmrzoep", + Assertions.assertEquals("umov", response.value().get(0).properties().metadata().analysisTypes().get(0)); + Assertions.assertEquals("xfaxdtnq", response.value().get(0).properties().status().message()); + Assertions.assertEquals(903952775, response.value().get(0).properties().status().statusId()); + Assertions.assertEquals("troiauesugmo", response.value().get(0).properties().dataProviderMetadata().providerName()); + Assertions.assertEquals("czkddn", response.nextLink()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsCreateOrUpdateMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsCreateOrUpdateMockTests.java index ac38fcda9bd1..aa7b314209dc 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsCreateOrUpdateMockTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsCreateOrUpdateMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -24,7 +24,7 @@ public final class ManagedEnvironmentPrivateEndpointConnectionsCreateOrUpdateMoc @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"groupIds\":[\"ighctxbxmo\",\"pcqydeykvsk\",\"cz\"],\"privateEndpoint\":{\"id\":\"jei\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"qaboohxbms\",\"actionsRequired\":\"cqsxrmdvewu\"},\"provisioningState\":\"Succeeded\"},\"id\":\"ohpjhgejkbv\",\"name\":\"hdaurghooxaexb\",\"type\":\"hxjxjoezlqxrkdkn\"}"; + = "{\"properties\":{\"groupIds\":[\"cdtajdopggorw\",\"oqtrotpvclpo\"],\"privateEndpoint\":{\"id\":\"lmwkptskwxjg\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"cbmkakmkookbp\",\"actionsRequired\":\"mgvmuy\"},\"provisioningState\":\"Succeeded\"},\"id\":\"wk\",\"name\":\"fowzkroyr\",\"type\":\"urxf\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,20 +33,19 @@ public void testCreateOrUpdate() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PrivateEndpointConnection response - = manager.managedEnvironmentPrivateEndpointConnections() - .define("fgjblcd") - .withExistingManagedEnvironment("rmexznlwkb", "okxkhupzer") - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.DISCONNECTED) - .withDescription("ifrhjulrsul") - .withActionsRequired("pflu")) - .create(); + PrivateEndpointConnection response = manager.managedEnvironmentPrivateEndpointConnections() + .define("qvzyuexozonyn") + .withExistingManagedEnvironment("lbz", "ixbnj") + .withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.PENDING) + .withDescription("wgzygbaduvecovsd") + .withActionsRequired("zrtdbakr")) + .create(); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("qaboohxbms", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("cqsxrmdvewu", response.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("cbmkakmkookbp", response.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("mgvmuy", response.privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsGetWithResponseMockTests.java index 38188acb5d75..0878fea0351b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsGetWithResponseMockTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsGetWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -22,7 +22,7 @@ public final class ManagedEnvironmentPrivateEndpointConnectionsGetWithResponseMo @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"groupIds\":[\"mmzp\",\"tauolawiubmom\"],\"privateEndpoint\":{\"id\":\"vjhvvlr\"},\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"wjjmajnkdflqi\",\"actionsRequired\":\"swaeqkzfz\"},\"provisioningState\":\"Succeeded\"},\"id\":\"shohto\",\"name\":\"ryegp\",\"type\":\"h\"}"; + = "{\"properties\":{\"groupIds\":[\"tcsubmzoo\",\"svobchkxfp\"],\"privateEndpoint\":{\"id\":\"yslb\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"mnnkkwayqshw\",\"actionsRequired\":\"xrid\"},\"provisioningState\":\"Canceled\"},\"id\":\"aqjmkgxqwque\",\"name\":\"uylztpziizevjyk\",\"type\":\"fvezefk\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,12 +32,12 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PrivateEndpointConnection response = manager.managedEnvironmentPrivateEndpointConnections() - .getWithResponse("wjekptycaydbj", "c", "ymlcfnzhmhsurlg", com.azure.core.util.Context.NONE) + .getWithResponse("kyelsyasvfnkwmy", "jjekrknfdrugj", "yckgtxkrdtulcrcj", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.DISCONNECTED, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("wjjmajnkdflqi", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("swaeqkzfz", response.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("mnnkkwayqshw", response.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("xrid", response.privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsListMockTests.java index f1ed79f80c96..f77d804e35f4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsListMockTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateEndpointConnectionsListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -23,7 +23,7 @@ public final class ManagedEnvironmentPrivateEndpointConnectionsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"groupIds\":[\"rpzuyudivbx\",\"hsqe\",\"eonqelwgdhuru\",\"y\"],\"privateEndpoint\":{\"id\":\"rogatmolj\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"pinm\",\"actionsRequired\":\"fkneerzztrkn\"},\"provisioningState\":\"Pending\"},\"id\":\"ugdybnhrxlel\",\"name\":\"jhkeizcp\",\"type\":\"htdm\"}]}"; + = "{\"value\":[{\"properties\":{\"groupIds\":[\"kifmxawo\",\"tfzknhrkm\",\"qncfvdscnhe\",\"vwfnqqwypvn\"],\"privateEndpoint\":{\"id\":\"b\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"ggrssgwjfkain\",\"actionsRequired\":\"uymvecvzts\"},\"provisioningState\":\"Canceled\"},\"id\":\"usaictd\",\"name\":\"cnk\",\"type\":\"zohnrddclzeqozre\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,12 +33,13 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.managedEnvironmentPrivateEndpointConnections() - .list("alzb", "obrqlp", com.azure.core.util.Context.NONE); + .list("kqtwqlepjjzkcasf", "zcntogffjwajnrtw", com.azure.core.util.Context.NONE); Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("pinm", response.iterator().next().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("fkneerzztrkn", + Assertions.assertEquals("ggrssgwjfkain", + response.iterator().next().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("uymvecvzts", response.iterator().next().privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateLinkResourcesGetWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateLinkResourcesGetWithResponseMockTests.java new file mode 100644 index 000000000000..b4f7586f020a --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateLinkResourcesGetWithResponseMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.PrivateLinkResource; +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 ManagedEnvironmentPrivateLinkResourcesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"groupId\":\"hbbnkgzuk\",\"requiredMembers\":[\"nzkjthfceyjn\"],\"requiredZoneNames\":[\"lfuyfjbpfiddhlr\",\"fz\",\"qyjmqrfuioc\"]},\"id\":\"el\",\"name\":\"k\",\"type\":\"sazrhxuddqmdtff\"}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateLinkResource response = manager.managedEnvironmentPrivateLinkResources() + .getWithResponse("vl", "q", "xyrqo", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("lfuyfjbpfiddhlr", response.requiredZoneNames().get(0)); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateLinkResourcesListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateLinkResourcesListMockTests.java index 8522a0c3c276..b109407b20c0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateLinkResourcesListMockTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentPrivateLinkResourcesListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -22,7 +22,7 @@ public final class ManagedEnvironmentPrivateLinkResourcesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"groupId\":\"gzseznuxkeua\",\"requiredMembers\":[\"abmdlqj\",\"edpf\",\"xlhupmomihzbdnp\"],\"requiredZoneNames\":[\"cdpreyxelyicg\",\"flr\",\"fss\"]},\"id\":\"ghsfxrkbhammgmqf\",\"name\":\"efgvqcp\",\"type\":\"wjgquxweyslandkd\"}]}"; + = "{\"value\":[{\"properties\":{\"groupId\":\"gawgazmxjqi\",\"requiredMembers\":[\"jjsbcmlzaahzbhur\"],\"requiredZoneNames\":[\"kolirhh\",\"ojusuzgfjzcva\",\"xoia\"]},\"id\":\"hfxwccokd\",\"name\":\"kuk\",\"type\":\"kczynuhhoqeqsh\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,8 +32,8 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.managedEnvironmentPrivateLinkResources() - .list("obektmbozo", "tzamicbig", com.azure.core.util.Context.NONE); + .list("fgkuh", "nwhvuldbkkejj", com.azure.core.util.Context.NONE); - Assertions.assertEquals("cdpreyxelyicg", response.iterator().next().requiredZoneNames().get(0)); + Assertions.assertEquals("kolirhh", response.iterator().next().requiredZoneNames().get(0)); } } 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 index 9dcdc3daa22a..8c7e29cf1538 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; 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 index dac7523fdd1e..7bf9d2cde531 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,17 +12,17 @@ public final class ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryptio @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption model - = BinaryData.fromString("{\"enabled\":false}") + = BinaryData.fromString("{\"enabled\":true}") .toObject(ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption.class); - Assertions.assertFalse(model.enabled()); + Assertions.assertTrue(model.enabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption model - = new ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption().withEnabled(false); + = new ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption().withEnabled(true); model = BinaryData.fromObject(model) .toObject(ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption.class); - Assertions.assertFalse(model.enabled()); + Assertions.assertTrue(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 index a862e6966de4..302003546edf 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; 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 index 89a984910707..c4a38b73113e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -22,7 +22,7 @@ public final class ManagedEnvironmentUsagesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"currentValue\":24.992544,\"limit\":72.632744,\"name\":{\"value\":\"pgehpadkmdzgsszx\",\"localizedValue\":\"tkbbxuhar\"}}]}"; + = "{\"value\":[{\"currentValue\":99.4311,\"limit\":70.24965,\"name\":{\"value\":\"gsoriobij\",\"localizedValue\":\"ydyeuy\"}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,11 +32,11 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.managedEnvironmentUsages().list("tjtdrhutfd", "a", com.azure.core.util.Context.NONE); + = manager.managedEnvironmentUsages().list("kyhydvikmf", "gpmillxgjs", com.azure.core.util.Context.NONE); - Assertions.assertEquals(24.992544f, response.iterator().next().currentValue()); - Assertions.assertEquals(72.632744f, response.iterator().next().limit()); - Assertions.assertEquals("pgehpadkmdzgsszx", response.iterator().next().name().value()); - Assertions.assertEquals("tkbbxuhar", response.iterator().next().name().localizedValue()); + Assertions.assertEquals(99.4311f, response.iterator().next().currentValue()); + Assertions.assertEquals(70.24965f, response.iterator().next().limit()); + Assertions.assertEquals("gsoriobij", response.iterator().next().name().value()); + Assertions.assertEquals("ydyeuy", 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 index 7dad66c6a316..09e0c3657e46 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -27,7 +27,7 @@ public void testDelete() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.managedEnvironments().delete("bxxn", "uisdzhgbdgz", com.azure.core.util.Context.NONE); + manager.managedEnvironments().delete("xelyicghflr", "fss", 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 index 83dfea75a505..850d5a8e46de 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -22,7 +22,7 @@ public final class ManagedEnvironmentsListWorkloadProfileStatesMockTests { @Test public void testListWorkloadProfileStates() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"minimumCount\":696818170,\"maximumCount\":2012943532,\"currentCount\":1699476003},\"id\":\"ilrgun\",\"name\":\"anlduwzorxsb\",\"type\":\"x\"}]}"; + = "{\"value\":[{\"properties\":{\"minimumCount\":30243669,\"maximumCount\":1568799393,\"currentCount\":359184591},\"id\":\"uzexokjxebjvbzin\",\"name\":\"abwmvogljsv\",\"type\":\"pgidnw\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,10 +32,10 @@ public void testListWorkloadProfileStates() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.managedEnvironments() - .listWorkloadProfileStates("oellnkkiiwvmt", "mxpymdjf", com.azure.core.util.Context.NONE); + .listWorkloadProfileStates("otire", "mseobfsxstcyilbv", com.azure.core.util.Context.NONE); - Assertions.assertEquals(696818170, response.iterator().next().properties().minimumCount()); - Assertions.assertEquals(2012943532, response.iterator().next().properties().maximumCount()); - Assertions.assertEquals(1699476003, response.iterator().next().properties().currentCount()); + Assertions.assertEquals(30243669, response.iterator().next().properties().minimumCount()); + Assertions.assertEquals(1568799393, response.iterator().next().properties().maximumCount()); + Assertions.assertEquals(359184591, 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 index 3bb971bdea29..6fb2d5bae2ea 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -28,7 +28,7 @@ public void testDeleteWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.managedEnvironmentsStorages() - .deleteWithResponse("fsn", "skiioshjgczetybn", "gztlcgc", com.azure.core.util.Context.NONE); + .deleteWithResponse("dqxwabzrwiqrxhac", "cdosqkptj", "gkifmmainwh", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedIdentitySettingTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedIdentitySettingTests.java index cef459c8b4f7..0ac804e5c3a4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedIdentitySettingTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedIdentitySettingTests.java @@ -1,29 +1,29 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.IdentitySettingsLifeCycle; import com.azure.resourcemanager.appcontainers.models.ManagedIdentitySetting; +import com.azure.resourcemanager.appcontainers.models.SessionPoolIdentityLifeCycle; import org.junit.jupiter.api.Assertions; public final class ManagedIdentitySettingTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ManagedIdentitySetting model = BinaryData.fromString("{\"identity\":\"agfl\",\"lifecycle\":\"Init\"}") + ManagedIdentitySetting model = BinaryData.fromString("{\"identity\":\"vyvdcs\",\"lifecycle\":\"None\"}") .toObject(ManagedIdentitySetting.class); - Assertions.assertEquals("agfl", model.identity()); - Assertions.assertEquals(IdentitySettingsLifeCycle.INIT, model.lifecycle()); + Assertions.assertEquals("vyvdcs", model.identity()); + Assertions.assertEquals(SessionPoolIdentityLifeCycle.NONE, model.lifecycle()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ManagedIdentitySetting model - = new ManagedIdentitySetting().withIdentity("agfl").withLifecycle(IdentitySettingsLifeCycle.INIT); + = new ManagedIdentitySetting().withIdentity("vyvdcs").withLifecycle(SessionPoolIdentityLifeCycle.NONE); model = BinaryData.fromObject(model).toObject(ManagedIdentitySetting.class); - Assertions.assertEquals("agfl", model.identity()); - Assertions.assertEquals(IdentitySettingsLifeCycle.INIT, model.lifecycle()); + Assertions.assertEquals("vyvdcs", model.identity()); + Assertions.assertEquals(SessionPoolIdentityLifeCycle.NONE, model.lifecycle()); } } 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 index a491bdfde29d..98d03843ae59 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -16,18 +16,17 @@ public final class ManagedServiceIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ManagedServiceIdentity model = BinaryData.fromString( - "{\"principalId\":\"6d1f0362-b4e3-4feb-979c-7053580d2fb1\",\"tenantId\":\"7b2c3890-62ba-4c7f-a3a9-f6c1384307f2\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"jbhckfrlhr\":{\"principalId\":\"e993f11c-547c-487d-a816-c2302fac2109\",\"clientId\":\"b928d768-15c1-4ba8-83dc-6a9a1f00a612\"},\"kyv\":{\"principalId\":\"837c4096-690b-464e-b5aa-e56a2c0d17ca\",\"clientId\":\"0ee55091-9b27-4014-af52-7df61e83eeff\"},\"anuzbpzkafkuw\":{\"principalId\":\"f42cb857-cbb7-4070-9e59-4f92cb4437f4\",\"clientId\":\"e279432b-8f2e-48ad-813f-44640e674ca3\"}}}") + "{\"principalId\":\"naamde\",\"tenantId\":\"eh\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"gm\":{\"principalId\":\"jeyp\",\"clientId\":\"ezrkgqhcjrefo\"},\"cczsq\":{\"principalId\":\"sle\",\"clientId\":\"vxyqjpkcattpngjc\"}}}") .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("jbhckfrlhr", new UserAssignedIdentity(), "kyv", - new UserAssignedIdentity(), "anuzbpzkafkuw", new UserAssignedIdentity())); + ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("gm", new UserAssignedIdentity(), "cczsq", new UserAssignedIdentity())); model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); } // Use "Map.of" if available diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MetricsConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MetricsConfigurationTests.java new file mode 100644 index 000000000000..c7b46ce10d19 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/MetricsConfigurationTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.MetricsConfiguration; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MetricsConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MetricsConfiguration model = BinaryData.fromString( + "{\"includeKeda\":true,\"destinations\":[\"kffqyinljqepqwh\",\"xmonstshi\",\"xgvelfclduccbird\",\"vuwcobiegstmnin\"]}") + .toObject(MetricsConfiguration.class); + Assertions.assertTrue(model.includeKeda()); + Assertions.assertEquals("kffqyinljqepqwh", model.destinations().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MetricsConfiguration model = new MetricsConfiguration().withIncludeKeda(true) + .withDestinations(Arrays.asList("kffqyinljqepqwh", "xmonstshi", "xgvelfclduccbird", "vuwcobiegstmnin")); + model = BinaryData.fromObject(model).toObject(MetricsConfiguration.class); + Assertions.assertTrue(model.includeKeda()); + Assertions.assertEquals("kffqyinljqepqwh", model.destinations().get(0)); + } +} 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 index ee46f9620fa2..fb7f33068e91 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,14 +11,14 @@ public final class MtlsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Mtls model = BinaryData.fromString("{\"enabled\":true}").toObject(Mtls.class); - Assertions.assertTrue(model.enabled()); + Mtls model = BinaryData.fromString("{\"enabled\":false}").toObject(Mtls.class); + Assertions.assertFalse(model.enabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Mtls model = new Mtls().withEnabled(true); + Mtls model = new Mtls().withEnabled(false); model = BinaryData.fromObject(model).toObject(Mtls.class); - Assertions.assertTrue(model.enabled()); + Assertions.assertFalse(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 index 22e0d3544a22..e344b52a6e5d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -22,7 +22,7 @@ public final class NamespacesCheckNameAvailabilityWithResponseMockTests { @Test public void testCheckNameAvailabilityWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":false,\"reason\":\"Invalid\",\"message\":\"rlj\"}"; + String responseStr = "{\"nameAvailable\":true,\"reason\":\"Invalid\",\"message\":\"jjvyweocfkumcfjx\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,13 +32,13 @@ public void testCheckNameAvailabilityWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CheckNameAvailabilityResponse response = manager.namespaces() - .checkNameAvailabilityWithResponse("gpokddxejhhkvgu", "vtptbk", - new CheckNameAvailabilityRequest().withName("kqynspgbvo").withType("bkkwvdxae"), + .checkNameAvailabilityWithResponse("wihvaangqtnh", "rfdmfdvbbaexx", + new CheckNameAvailabilityRequest().withName("wtgdfkkaui").withType("muafmczfedyuepsv"), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertFalse(response.nameAvailable()); + Assertions.assertTrue(response.nameAvailable()); Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, response.reason()); - Assertions.assertEquals("rlj", response.message()); + Assertions.assertEquals("jjvyweocfkumcfjx", response.message()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/NfsAzureFilePropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/NfsAzureFilePropertiesTests.java index c8be5bc938e7..2cc3a4f62d96 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/NfsAzureFilePropertiesTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/NfsAzureFilePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -13,21 +13,20 @@ public final class NfsAzureFilePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NfsAzureFileProperties model - = BinaryData.fromString("{\"server\":\"rd\",\"accessMode\":\"ReadWrite\",\"shareName\":\"xrdcqtj\"}") + = BinaryData.fromString("{\"server\":\"oy\",\"accessMode\":\"ReadOnly\",\"shareName\":\"haim\"}") .toObject(NfsAzureFileProperties.class); - Assertions.assertEquals("rd", model.server()); - Assertions.assertEquals(AccessMode.READ_WRITE, model.accessMode()); - Assertions.assertEquals("xrdcqtj", model.shareName()); + Assertions.assertEquals("oy", model.server()); + Assertions.assertEquals(AccessMode.READ_ONLY, model.accessMode()); + Assertions.assertEquals("haim", model.shareName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - NfsAzureFileProperties model = new NfsAzureFileProperties().withServer("rd") - .withAccessMode(AccessMode.READ_WRITE) - .withShareName("xrdcqtj"); + NfsAzureFileProperties model + = new NfsAzureFileProperties().withServer("oy").withAccessMode(AccessMode.READ_ONLY).withShareName("haim"); model = BinaryData.fromObject(model).toObject(NfsAzureFileProperties.class); - Assertions.assertEquals("rd", model.server()); - Assertions.assertEquals(AccessMode.READ_WRITE, model.accessMode()); - Assertions.assertEquals("xrdcqtj", model.shareName()); + Assertions.assertEquals("oy", model.server()); + Assertions.assertEquals(AccessMode.READ_ONLY, model.accessMode()); + Assertions.assertEquals("haim", model.shareName()); } } 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 index 4835d428fbe7..06eeccff3d9f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,17 +11,17 @@ public final class NonceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Nonce model = BinaryData.fromString("{\"validateNonce\":false,\"nonceExpirationInterval\":\"ewmdw\"}") + Nonce model = BinaryData.fromString("{\"validateNonce\":false,\"nonceExpirationInterval\":\"xbzlmc\"}") .toObject(Nonce.class); Assertions.assertFalse(model.validateNonce()); - Assertions.assertEquals("ewmdw", model.nonceExpirationInterval()); + Assertions.assertEquals("xbzlmc", model.nonceExpirationInterval()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Nonce model = new Nonce().withValidateNonce(false).withNonceExpirationInterval("ewmdw"); + Nonce model = new Nonce().withValidateNonce(false).withNonceExpirationInterval("xbzlmc"); model = BinaryData.fromObject(model).toObject(Nonce.class); Assertions.assertFalse(model.validateNonce()); - Assertions.assertEquals("ewmdw", model.nonceExpirationInterval()); + Assertions.assertEquals("xbzlmc", 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 index 4e1455744548..aa69329248e5 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,18 +12,19 @@ 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)); + OpenIdConnectLogin model + = BinaryData.fromString("{\"nameClaimType\":\"ljhnmgixhcmav\",\"scopes\":[\"oudorhcgyyp\",\"otwypundmb\"]}") + .toObject(OpenIdConnectLogin.class); + Assertions.assertEquals("ljhnmgixhcmav", model.nameClaimType()); + Assertions.assertEquals("oudorhcgyyp", model.scopes().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OpenIdConnectLogin model - = new OpenIdConnectLogin().withNameClaimType("ckyfih").withScopes(Arrays.asList("dfvzwdzuhty")); + OpenIdConnectLogin model = new OpenIdConnectLogin().withNameClaimType("ljhnmgixhcmav") + .withScopes(Arrays.asList("oudorhcgyyp", "otwypundmb")); model = BinaryData.fromObject(model).toObject(OpenIdConnectLogin.class); - Assertions.assertEquals("ckyfih", model.nameClaimType()); - Assertions.assertEquals("dfvzwdzuhty", model.scopes().get(0)); + Assertions.assertEquals("ljhnmgixhcmav", model.nameClaimType()); + Assertions.assertEquals("oudorhcgyyp", 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 index bd9e61fb32f2..78bded812b74 100644 --- 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 @@ -1,45 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\":\"enxpmyyefr\",\"isDataAction\":true,\"display\":{\"provider\":\"qqs\",\"resource\":\"waoqvmmb\",\"operation\":\"qfr\",\"description\":\"lkzmegnitgvkxl\"},\"origin\":\"qdrfegcealzxwhc\"}") + "{\"name\":\"dg\",\"isDataAction\":true,\"display\":{\"provider\":\"mvdjwzrlovmc\",\"resource\":\"hijco\",\"operation\":\"ctbzaq\",\"description\":\"sycbkbfk\"},\"origin\":\"kdkexxp\"}") .toObject(OperationDetailInner.class); - Assertions.assertEquals("enxpmyyefr", model.name()); + Assertions.assertEquals("dg", model.name()); Assertions.assertTrue(model.isDataAction()); - Assertions.assertEquals("qqs", model.display().provider()); - Assertions.assertEquals("waoqvmmb", model.display().resource()); - Assertions.assertEquals("qfr", model.display().operation()); - Assertions.assertEquals("lkzmegnitgvkxl", model.display().description()); - Assertions.assertEquals("qdrfegcealzxwhc", model.origin()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDetailInner model = new OperationDetailInner().withName("enxpmyyefr") - .withIsDataAction(true) - .withDisplay(new OperationDisplay().withProvider("qqs") - .withResource("waoqvmmb") - .withOperation("qfr") - .withDescription("lkzmegnitgvkxl")) - .withOrigin("qdrfegcealzxwhc"); - model = BinaryData.fromObject(model).toObject(OperationDetailInner.class); - Assertions.assertEquals("enxpmyyefr", model.name()); - Assertions.assertTrue(model.isDataAction()); - Assertions.assertEquals("qqs", model.display().provider()); - Assertions.assertEquals("waoqvmmb", model.display().resource()); - Assertions.assertEquals("qfr", model.display().operation()); - Assertions.assertEquals("lkzmegnitgvkxl", model.display().description()); - Assertions.assertEquals("qdrfegcealzxwhc", model.origin()); + Assertions.assertEquals("mvdjwzrlovmc", model.display().provider()); + Assertions.assertEquals("hijco", model.display().resource()); + Assertions.assertEquals("ctbzaq", model.display().operation()); + Assertions.assertEquals("sycbkbfk", model.display().description()); + Assertions.assertEquals("kdkexxp", 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 index 73af90e9c8cc..190c01516cc7 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,24 +12,11 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"symoyq\",\"resource\":\"wigdi\",\"operation\":\"kbxgom\",\"description\":\"juwasqvdaeyyguxa\"}") + "{\"provider\":\"fmxa\",\"resource\":\"fjpgddtocjjxhvp\",\"operation\":\"uexhdzx\",\"description\":\"qeojnxqbzvddntw\"}") .toObject(OperationDisplay.class); - Assertions.assertEquals("symoyq", model.provider()); - Assertions.assertEquals("wigdi", model.resource()); - Assertions.assertEquals("kbxgom", model.operation()); - Assertions.assertEquals("juwasqvdaeyyguxa", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("symoyq") - .withResource("wigdi") - .withOperation("kbxgom") - .withDescription("juwasqvdaeyyguxa"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("symoyq", model.provider()); - Assertions.assertEquals("wigdi", model.resource()); - Assertions.assertEquals("kbxgom", model.operation()); - Assertions.assertEquals("juwasqvdaeyyguxa", model.description()); + Assertions.assertEquals("fmxa", model.provider()); + Assertions.assertEquals("fjpgddtocjjxhvp", model.resource()); + Assertions.assertEquals("uexhdzx", model.operation()); + Assertions.assertEquals("qeojnxqbzvddntw", 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 index 5c80650bbfce..cb9ade8ddc37 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -22,7 +22,7 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"yjdeolctaebfs\",\"isDataAction\":true,\"display\":{\"provider\":\"jcustbvtq\",\"resource\":\"d\",\"operation\":\"vsgeafgf\",\"description\":\"ehxlzsxezppk\"},\"origin\":\"aaeskyfjlpze\"}]}"; + = "{\"value\":[{\"name\":\"hcjmo\",\"isDataAction\":false,\"display\":{\"provider\":\"de\",\"resource\":\"qcwgaxfgvaknokz\",\"operation\":\"jzrltixldzy\",\"description\":\"ytpqsixymmpujiv\"},\"origin\":\"lkjuvsmbmslzoyov\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,12 +33,12 @@ public void testList() throws Exception { PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("yjdeolctaebfs", response.iterator().next().name()); - Assertions.assertTrue(response.iterator().next().isDataAction()); - Assertions.assertEquals("jcustbvtq", response.iterator().next().display().provider()); - Assertions.assertEquals("d", response.iterator().next().display().resource()); - Assertions.assertEquals("vsgeafgf", response.iterator().next().display().operation()); - Assertions.assertEquals("ehxlzsxezppk", response.iterator().next().display().description()); - Assertions.assertEquals("aaeskyfjlpze", response.iterator().next().origin()); + Assertions.assertEquals("hcjmo", response.iterator().next().name()); + Assertions.assertFalse(response.iterator().next().isDataAction()); + Assertions.assertEquals("de", response.iterator().next().display().provider()); + Assertions.assertEquals("qcwgaxfgvaknokz", response.iterator().next().display().resource()); + Assertions.assertEquals("jzrltixldzy", response.iterator().next().display().operation()); + Assertions.assertEquals("ytpqsixymmpujiv", response.iterator().next().display().description()); + Assertions.assertEquals("lkjuvsmbmslzoyov", response.iterator().next().origin()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateEndpointConnectionInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateEndpointConnectionInnerTests.java index 41c75fa429f4..675d5da5e961 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateEndpointConnectionInnerTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateEndpointConnectionInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -15,12 +15,12 @@ public final class PrivateEndpointConnectionInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateEndpointConnectionInner model = BinaryData.fromString( - "{\"properties\":{\"groupIds\":[\"cto\",\"cmisofie\",\"pe\"],\"privateEndpoint\":{\"id\":\"yqdhcuplcplcw\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"ihlhzdsqtzb\",\"actionsRequired\":\"gnowcjhfgmveca\"},\"provisioningState\":\"Waiting\"},\"id\":\"wotey\",\"name\":\"wcluqovekqvgq\",\"type\":\"uwifzmpjwyiv\"}") + "{\"properties\":{\"groupIds\":[\"znvfbycjsxjww\",\"xzv\"],\"privateEndpoint\":{\"id\":\"mxqhndvnoamldse\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"djh\",\"actionsRequired\":\"lzok\"},\"provisioningState\":\"Succeeded\"},\"id\":\"pelnjetag\",\"name\":\"tsxoatftgz\",\"type\":\"npbs\"}") .toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ihlhzdsqtzb", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("gnowcjhfgmveca", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("djh", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("lzok", model.privateLinkServiceConnectionState().actionsRequired()); } @org.junit.jupiter.api.Test @@ -28,13 +28,13 @@ public void testSerialize() throws Exception { PrivateEndpointConnectionInner model = new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("ihlhzdsqtzb") - .withActionsRequired("gnowcjhfgmveca")); + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) + .withDescription("djh") + .withActionsRequired("lzok")); model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ihlhzdsqtzb", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("gnowcjhfgmveca", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("djh", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("lzok", model.privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateEndpointConnectionListResultTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateEndpointConnectionListResultTests.java index eb04d1a564d8..1fbefd0a024e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateEndpointConnectionListResultTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateEndpointConnectionListResultTests.java @@ -1,43 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.appcontainers.models.PrivateEndpoint; -import com.azure.resourcemanager.appcontainers.models.PrivateEndpointConnectionListResult; +import com.azure.resourcemanager.appcontainers.implementation.models.PrivateEndpointConnectionListResult; import com.azure.resourcemanager.appcontainers.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.appcontainers.models.PrivateLinkServiceConnectionState; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class PrivateEndpointConnectionListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateEndpointConnectionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupIds\":[\"lembnkbwvqvxkdi\",\"qihebw\",\"swbzuwfmdurage\",\"izvcjfe\"],\"privateEndpoint\":{\"id\":\"djub\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"igkxkbsazga\",\"actionsRequired\":\"acy\"},\"provisioningState\":\"Waiting\"},\"id\":\"dmspof\",\"name\":\"pv\",\"type\":\"hryl\"}],\"nextLink\":\"ofrzgb\"}") + "{\"value\":[{\"properties\":{\"groupIds\":[\"sycxhxzgaz\",\"taboidvmf\",\"hppubowsepdfgkmt\"],\"privateEndpoint\":{\"id\":\"rngbtcjuahokqtob\"},\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"ofshfphwpnulaiyw\",\"actionsRequired\":\"jy\"},\"provisioningState\":\"Canceled\"},\"id\":\"wkojpllndnpd\",\"name\":\"rpqaf\",\"type\":\"fugsnnfhyetefy\"}],\"nextLink\":\"coc\"}") .toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.DISCONNECTED, model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions.assertEquals("igkxkbsazga", model.value().get(0).privateLinkServiceConnectionState().description()); - Assertions.assertEquals("acy", model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionListResult model - = new PrivateEndpointConnectionListResult() - .withValue(Arrays.asList(new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("igkxkbsazga") - .withActionsRequired("acy")))); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions.assertEquals("igkxkbsazga", model.value().get(0).privateLinkServiceConnectionState().description()); - Assertions.assertEquals("acy", model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("ofshfphwpnulaiyw", + model.value().get(0).privateLinkServiceConnectionState().description()); + Assertions.assertEquals("jy", model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("coc", model.nextLink()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateEndpointConnectionPropertiesTests.java index 4400935b9981..5310ee0f9ea8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateEndpointConnectionPropertiesTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateEndpointConnectionPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -15,12 +15,12 @@ public final class PrivateEndpointConnectionPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateEndpointConnectionProperties model = BinaryData.fromString( - "{\"groupIds\":[\"f\",\"cvhrfsp\",\"uagrttikteusqc\"],\"privateEndpoint\":{\"id\":\"yklxubyjaffmmfbl\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"ubgq\",\"actionsRequired\":\"rtalmet\"},\"provisioningState\":\"Canceled\"}") + "{\"groupIds\":[\"floccsrmozih\"],\"privateEndpoint\":{\"id\":\"g\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"xp\",\"actionsRequired\":\"jcxcjxgrytfmpcyc\"},\"provisioningState\":\"Waiting\"}") .toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ubgq", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("rtalmet", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("xp", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("jcxcjxgrytfmpcyc", model.privateLinkServiceConnectionState().actionsRequired()); } @org.junit.jupiter.api.Test @@ -28,13 +28,13 @@ public void testSerialize() throws Exception { PrivateEndpointConnectionProperties model = new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("ubgq") - .withActionsRequired("rtalmet")); + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.PENDING) + .withDescription("xp") + .withActionsRequired("jcxcjxgrytfmpcyc")); model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ubgq", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("rtalmet", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("xp", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("jcxcjxgrytfmpcyc", model.privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateEndpointTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateEndpointTests.java index 1fc2b7584b2b..adc5a3bfb62f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateEndpointTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateEndpointTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -10,7 +10,7 @@ public final class PrivateEndpointTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"dslqxihhrmooizqs\"}").toObject(PrivateEndpoint.class); + PrivateEndpoint model = BinaryData.fromString("{\"id\":\"caykggnoxuz\"}").toObject(PrivateEndpoint.class); } @org.junit.jupiter.api.Test diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateLinkResourceInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateLinkResourceInnerTests.java index 74cbb455dd17..5820ae7e0ba4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateLinkResourceInnerTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateLinkResourceInnerTests.java @@ -1,28 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.appcontainers.fluent.models.PrivateLinkResourceInner; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class PrivateLinkResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateLinkResourceInner model = BinaryData.fromString( - "{\"properties\":{\"groupId\":\"hclafzvaylptrs\",\"requiredMembers\":[\"ztcmwq\",\"chcxwaxfewzj\",\"jexfdeqvhp\"],\"requiredZoneNames\":[\"kkshkbffm\",\"mxzjrgywwpgjx\",\"nptfujgi\",\"gaao\"]},\"id\":\"ttaqutdew\",\"name\":\"mxswvruunzz\",\"type\":\"gehkfkimrtixokff\"}") + "{\"properties\":{\"groupId\":\"dirazf\",\"requiredMembers\":[\"jwabmd\",\"jtmvc\",\"pexcmjurbuhh\",\"kyqltqsrogt\"],\"requiredZoneNames\":[\"ffdjktsysidfvclg\",\"xnfuijtkbusqogs\",\"ikayiansharuj\"]},\"id\":\"iqxf\",\"name\":\"yjqtt\",\"type\":\"wkpqhjpenuygbq\"}") .toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("kkshkbffm", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceInner model = new PrivateLinkResourceInner() - .withRequiredZoneNames(Arrays.asList("kkshkbffm", "mxzjrgywwpgjx", "nptfujgi", "gaao")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("kkshkbffm", model.requiredZoneNames().get(0)); + Assertions.assertEquals("ffdjktsysidfvclg", model.requiredZoneNames().get(0)); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateLinkResourceListResultTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateLinkResourceListResultTests.java index 17c28f25054e..d8e3bf09bd5c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateLinkResourceListResultTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateLinkResourceListResultTests.java @@ -1,30 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.appcontainers.models.PrivateLinkResourceListResult; -import java.util.Arrays; +import com.azure.resourcemanager.appcontainers.implementation.models.PrivateLinkResourceListResult; import org.junit.jupiter.api.Assertions; public final class PrivateLinkResourceListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateLinkResourceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"st\",\"requiredMembers\":[\"l\",\"xbcuiiznkt\",\"f\"],\"requiredZoneNames\":[\"nv\",\"dibmikostbzbkiwb\",\"qnyophzfyls\"]},\"id\":\"rpfbcunezz\",\"name\":\"e\",\"type\":\"elfwy\"}],\"nextLink\":\"lwxjwetn\"}") + "{\"value\":[{\"properties\":{\"groupId\":\"tixr\",\"requiredMembers\":[\"uyturml\"],\"requiredZoneNames\":[\"wolba\",\"iropionszon\"]},\"id\":\"ngajinnixjawrtmj\",\"name\":\"jmyccxlzhcoxov\",\"type\":\"ekhenl\"},{\"properties\":{\"groupId\":\"nrd\",\"requiredMembers\":[\"txrdcqtjvi\",\"ttgepuslvyjtcv\",\"wkasiziesf\",\"ughtuqfecjxeygtu\"],\"requiredZoneNames\":[\"ic\",\"uewmrswnjlxuzrhw\",\"usxjbaqehg\"]},\"id\":\"ohzjqatucoigeb\",\"name\":\"ncnwfepbnwgf\",\"type\":\"xjg\"},{\"properties\":{\"groupId\":\"jbgdlfgtdysnaquf\",\"requiredMembers\":[\"ctqhamzjrwdk\",\"zeqyjleziun\",\"xdfzantkw\"],\"requiredZoneNames\":[\"yamlbnse\",\"ac\",\"jvpilguooqja\",\"m\"]},\"id\":\"tg\",\"name\":\"eiookjbsah\",\"type\":\"tdtpdelqacslmo\"}],\"nextLink\":\"ebnfxofvc\"}") .toObject(PrivateLinkResourceListResult.class); - Assertions.assertEquals("nv", model.value().get(0).requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceListResult model - = new PrivateLinkResourceListResult().withValue(Arrays.asList(new PrivateLinkResourceInner() - .withRequiredZoneNames(Arrays.asList("nv", "dibmikostbzbkiwb", "qnyophzfyls")))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResult.class); - Assertions.assertEquals("nv", model.value().get(0).requiredZoneNames().get(0)); + Assertions.assertEquals("wolba", model.value().get(0).requiredZoneNames().get(0)); + Assertions.assertEquals("ebnfxofvc", model.nextLink()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateLinkResourcePropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateLinkResourcePropertiesTests.java index c5912bc6a630..1f3e14369925 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateLinkResourcePropertiesTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateLinkResourcePropertiesTests.java @@ -1,28 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.appcontainers.fluent.models.PrivateLinkResourceProperties; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class PrivateLinkResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateLinkResourceProperties model = BinaryData.fromString( - "{\"groupId\":\"inljqepqwhixmo\",\"requiredMembers\":[\"shiy\"],\"requiredZoneNames\":[\"elfclducc\",\"irdsvuwcob\"]}") + "{\"groupId\":\"qekewvnqvcd\",\"requiredMembers\":[\"a\",\"cmfdjwnlax\"],\"requiredZoneNames\":[\"jqi\",\"czvvit\"]}") .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("elfclducc", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceProperties model - = new PrivateLinkResourceProperties().withRequiredZoneNames(Arrays.asList("elfclducc", "irdsvuwcob")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("elfclducc", model.requiredZoneNames().get(0)); + Assertions.assertEquals("jqi", model.requiredZoneNames().get(0)); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateLinkServiceConnectionStateTests.java index 2b5eafd5ca60..f9a935a8d340 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateLinkServiceConnectionStateTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/PrivateLinkServiceConnectionStateTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -13,22 +13,23 @@ public final class PrivateLinkServiceConnectionStateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateLinkServiceConnectionState model = BinaryData - .fromString("{\"status\":\"Approved\",\"description\":\"iut\",\"actionsRequired\":\"apzhyrpetoge\"}") + .fromString( + "{\"status\":\"Approved\",\"description\":\"xwpndfcpf\",\"actionsRequired\":\"nthjtwkjaosrxuzv\"}") .toObject(PrivateLinkServiceConnectionState.class); Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); - Assertions.assertEquals("iut", model.description()); - Assertions.assertEquals("apzhyrpetoge", model.actionsRequired()); + Assertions.assertEquals("xwpndfcpf", model.description()); + Assertions.assertEquals("nthjtwkjaosrxuzv", model.actionsRequired()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { PrivateLinkServiceConnectionState model = new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("iut") - .withActionsRequired("apzhyrpetoge"); + .withDescription("xwpndfcpf") + .withActionsRequired("nthjtwkjaosrxuzv"); model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); - Assertions.assertEquals("iut", model.description()); - Assertions.assertEquals("apzhyrpetoge", model.actionsRequired()); + Assertions.assertEquals("xwpndfcpf", model.description()); + Assertions.assertEquals("nthjtwkjaosrxuzv", model.actionsRequired()); } } 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 index b830a565a3ba..f31455b95f6b 100644 --- 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 @@ -1,63 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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-11-05T04:06:51Z\",\"runningState\":\"NotRunning\",\"runningStateDetails\":\"m\",\"containers\":[{\"name\":\"fktgplc\",\"containerId\":\"wjxeznoigbr\",\"ready\":false,\"started\":false,\"restartCount\":490713776,\"runningState\":\"Running\",\"runningStateDetails\":\"azej\",\"logStreamEndpoint\":\"qkagfhsxt\",\"execEndpoint\":\"ugzxnf\"}],\"initContainers\":[{\"name\":\"xdtnkdmkqjjlw\",\"containerId\":\"nvrk\",\"ready\":false,\"started\":true,\"restartCount\":583930793,\"runningState\":\"Terminated\",\"runningStateDetails\":\"qaaysjkixqt\",\"logStreamEndpoint\":\"ttezlw\",\"execEndpoint\":\"fiakpjpqqm\"},{\"name\":\"d\",\"containerId\":\"mmji\",\"ready\":false,\"started\":false,\"restartCount\":448290186,\"runningState\":\"Terminated\",\"runningStateDetails\":\"uyqncygupkvipmd\",\"logStreamEndpoint\":\"wx\",\"execEndpoint\":\"pevzhfst\"}]},\"id\":\"xhojuj\",\"name\":\"ypelmcu\",\"type\":\"hixbjxyfwnyl\"}]}") + "{\"value\":[{\"properties\":{\"createdTime\":\"2021-08-03T19:11:02Z\",\"runningState\":\"NotRunning\",\"runningStateDetails\":\"m\",\"containers\":[{\"name\":\"w\",\"containerId\":\"ioknssxmoj\",\"ready\":false,\"started\":false,\"restartCount\":2108031583,\"runningState\":\"Terminated\",\"runningStateDetails\":\"wcfzqljyxgt\",\"logStreamEndpoint\":\"heyd\",\"execEndpoint\":\"dshmkxmaehvbbx\",\"debugEndpoint\":\"iplt\"}],\"initContainers\":[{\"name\":\"baxk\",\"containerId\":\"ywrckp\",\"ready\":true,\"started\":true,\"restartCount\":309006078,\"runningState\":\"Running\",\"runningStateDetails\":\"pvruudlg\",\"logStreamEndpoint\":\"bth\",\"execEndpoint\":\"tgk\",\"debugEndpoint\":\"tvdxeclzedqb\"}]},\"id\":\"hzlhplodqkdlww\",\"name\":\"fbumlkx\",\"type\":\"rqjfsmlm\"},{\"properties\":{\"createdTime\":\"2021-11-04T06:43:27Z\",\"runningState\":\"Running\",\"runningStateDetails\":\"wsrt\",\"containers\":[{\"name\":\"ezbrhubskh\",\"containerId\":\"ygo\",\"ready\":true,\"started\":true,\"restartCount\":870237510,\"runningState\":\"Running\",\"runningStateDetails\":\"leorfmluiqtqz\",\"logStreamEndpoint\":\"vyvnqqyb\",\"execEndpoint\":\"yeua\",\"debugEndpoint\":\"kq\"},{\"name\":\"qgzsles\",\"containerId\":\"bhernntiew\",\"ready\":false,\"started\":true,\"restartCount\":730948461,\"runningState\":\"Terminated\",\"runningStateDetails\":\"ehwagoh\",\"logStreamEndpoint\":\"f\",\"execEndpoint\":\"mrqemvvhmx\",\"debugEndpoint\":\"rjfut\"},{\"name\":\"oe\",\"containerId\":\"vewzcj\",\"ready\":false,\"started\":true,\"restartCount\":804328518,\"runningState\":\"Waiting\",\"runningStateDetails\":\"adraufactkahzo\",\"logStreamEndpoint\":\"jjziuxxpsh\",\"execEndpoint\":\"e\",\"debugEndpoint\":\"lfg\"}],\"initContainers\":[{\"name\":\"bkwdlenrds\",\"containerId\":\"ujbazpjuohminyfl\",\"ready\":false,\"started\":false,\"restartCount\":875787207,\"runningState\":\"Waiting\",\"runningStateDetails\":\"klvxwmyg\",\"logStreamEndpoint\":\"pgpqchiszepnnb\",\"execEndpoint\":\"rxgibbd\",\"debugEndpoint\":\"confozauors\"},{\"name\":\"okwbqplh\",\"containerId\":\"nuuepzlrp\",\"ready\":false,\"started\":true,\"restartCount\":450434086,\"runningState\":\"Waiting\",\"runningStateDetails\":\"uqdunvmnnrwrbi\",\"logStreamEndpoint\":\"ktalywjhhgdnhxms\",\"execEndpoint\":\"fomiloxgg\",\"debugEndpoint\":\"fi\"}]},\"id\":\"dieuzaofj\",\"name\":\"hvcyyysfg\",\"type\":\"otcubi\"},{\"properties\":{\"createdTime\":\"2021-03-10T19:30:54Z\",\"runningState\":\"NotRunning\",\"runningStateDetails\":\"qonmacj\",\"containers\":[{\"name\":\"zshq\",\"containerId\":\"impevf\",\"ready\":false,\"started\":true,\"restartCount\":206903175,\"runningState\":\"Waiting\",\"runningStateDetails\":\"wdxsm\",\"logStreamEndpoint\":\"cwrwfs\",\"execEndpoint\":\"fnynszqujizdvoqy\",\"debugEndpoint\":\"byowbblgyavutp\"},{\"name\":\"joxoism\",\"containerId\":\"sbpimlq\",\"ready\":true,\"started\":true,\"restartCount\":1477036061,\"runningState\":\"Running\",\"runningStateDetails\":\"xsffgcviz\",\"logStreamEndpoint\":\"dwl\",\"execEndpoint\":\"lyoupfgfbkju\",\"debugEndpoint\":\"yhgk\"},{\"name\":\"in\",\"containerId\":\"owzfttsttkt\",\"ready\":false,\"started\":true,\"restartCount\":520028629,\"runningState\":\"Waiting\",\"runningStateDetails\":\"gzukxitmm\",\"logStreamEndpoint\":\"gqqqxh\",\"execEndpoint\":\"xrxc\",\"debugEndpoint\":\"uisavokq\"}],\"initContainers\":[{\"name\":\"azivjlfrqttbajl\",\"containerId\":\"tnwxy\",\"ready\":true,\"started\":true,\"restartCount\":1442492241,\"runningState\":\"Running\",\"runningStateDetails\":\"uvscxkdmligov\",\"logStreamEndpoint\":\"rxkpmloazuruoc\",\"execEndpoint\":\"oorb\",\"debugEndpoint\":\"oybfhjxakvvj\"},{\"name\":\"lordilmywwtkgkxn\",\"containerId\":\"dabg\",\"ready\":true,\"started\":true,\"restartCount\":1232794646,\"runningState\":\"Running\",\"runningStateDetails\":\"cihxuuwhcjyx\",\"logStreamEndpoint\":\"ybvpay\",\"execEndpoint\":\"kudzpxgwj\",\"debugEndpoint\":\"mag\"},{\"name\":\"cyohpfkyrkdbd\",\"containerId\":\"ogsjkmnwqjno\",\"ready\":false,\"started\":false,\"restartCount\":261138703,\"runningState\":\"Terminated\",\"runningStateDetails\":\"cegfnmntfp\",\"logStreamEndpoint\":\"memfnczdwvvbalxl\",\"execEndpoint\":\"chp\",\"debugEndpoint\":\"bzevwrd\"},{\"name\":\"fukuvsjcswsmystu\",\"containerId\":\"qypfcv\",\"ready\":true,\"started\":false,\"restartCount\":1201344098,\"runningState\":\"Terminated\",\"runningStateDetails\":\"pjbabwidfc\",\"logStreamEndpoint\":\"spuunnoxyhkxgq\",\"execEndpoint\":\"rihpfhoq\",\"debugEndpoint\":\"a\"}]},\"id\":\"dao\",\"name\":\"djvlpj\",\"type\":\"xkzb\"}]}") .toObject(ReplicaCollectionInner.class); - Assertions.assertEquals("fktgplc", model.value().get(0).containers().get(0).name()); - Assertions.assertEquals("wjxeznoigbr", model.value().get(0).containers().get(0).containerId()); + Assertions.assertEquals("w", model.value().get(0).containers().get(0).name()); + Assertions.assertEquals("ioknssxmoj", model.value().get(0).containers().get(0).containerId()); Assertions.assertFalse(model.value().get(0).containers().get(0).ready()); Assertions.assertFalse(model.value().get(0).containers().get(0).started()); - Assertions.assertEquals(490713776, model.value().get(0).containers().get(0).restartCount()); - Assertions.assertEquals("xdtnkdmkqjjlw", model.value().get(0).initContainers().get(0).name()); - Assertions.assertEquals("nvrk", model.value().get(0).initContainers().get(0).containerId()); - Assertions.assertFalse(model.value().get(0).initContainers().get(0).ready()); + Assertions.assertEquals(2108031583, model.value().get(0).containers().get(0).restartCount()); + Assertions.assertEquals("baxk", model.value().get(0).initContainers().get(0).name()); + Assertions.assertEquals("ywrckp", model.value().get(0).initContainers().get(0).containerId()); + Assertions.assertTrue(model.value().get(0).initContainers().get(0).ready()); Assertions.assertTrue(model.value().get(0).initContainers().get(0).started()); - Assertions.assertEquals(583930793, 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("fktgplc") - .withContainerId("wjxeznoigbr") - .withReady(false) - .withStarted(false) - .withRestartCount(490713776))) - .withInitContainers(Arrays.asList( - new ReplicaContainer().withName("xdtnkdmkqjjlw") - .withContainerId("nvrk") - .withReady(false) - .withStarted(true) - .withRestartCount(583930793), - new ReplicaContainer().withName("d") - .withContainerId("mmji") - .withReady(false) - .withStarted(false) - .withRestartCount(448290186))))); - model = BinaryData.fromObject(model).toObject(ReplicaCollectionInner.class); - Assertions.assertEquals("fktgplc", model.value().get(0).containers().get(0).name()); - Assertions.assertEquals("wjxeznoigbr", model.value().get(0).containers().get(0).containerId()); - Assertions.assertFalse(model.value().get(0).containers().get(0).ready()); - Assertions.assertFalse(model.value().get(0).containers().get(0).started()); - Assertions.assertEquals(490713776, model.value().get(0).containers().get(0).restartCount()); - Assertions.assertEquals("xdtnkdmkqjjlw", model.value().get(0).initContainers().get(0).name()); - Assertions.assertEquals("nvrk", model.value().get(0).initContainers().get(0).containerId()); - Assertions.assertFalse(model.value().get(0).initContainers().get(0).ready()); - Assertions.assertTrue(model.value().get(0).initContainers().get(0).started()); - Assertions.assertEquals(583930793, model.value().get(0).initContainers().get(0).restartCount()); + Assertions.assertEquals(309006078, 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 index 1d7908144663..3e935a5fd349 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,27 +12,12 @@ public final class ReplicaContainerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ReplicaContainer model = BinaryData.fromString( - "{\"name\":\"sxkm\",\"containerId\":\"a\",\"ready\":true,\"started\":true,\"restartCount\":1968525947,\"runningState\":\"Terminated\",\"runningStateDetails\":\"tsgumhj\",\"logStreamEndpoint\":\"ikkx\",\"execEndpoint\":\"lo\"}") + "{\"name\":\"aifmvikl\",\"containerId\":\"dvk\",\"ready\":false,\"started\":false,\"restartCount\":1504091159,\"runningState\":\"Terminated\",\"runningStateDetails\":\"dsrhnjiv\",\"logStreamEndpoint\":\"v\",\"execEndpoint\":\"ovqfzge\",\"debugEndpoint\":\"dftuljltduce\"}") .toObject(ReplicaContainer.class); - Assertions.assertEquals("sxkm", model.name()); - Assertions.assertEquals("a", model.containerId()); - Assertions.assertTrue(model.ready()); - Assertions.assertTrue(model.started()); - Assertions.assertEquals(1968525947, model.restartCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReplicaContainer model = new ReplicaContainer().withName("sxkm") - .withContainerId("a") - .withReady(true) - .withStarted(true) - .withRestartCount(1968525947); - model = BinaryData.fromObject(model).toObject(ReplicaContainer.class); - Assertions.assertEquals("sxkm", model.name()); - Assertions.assertEquals("a", model.containerId()); - Assertions.assertTrue(model.ready()); - Assertions.assertTrue(model.started()); - Assertions.assertEquals(1968525947, model.restartCount()); + Assertions.assertEquals("aifmvikl", model.name()); + Assertions.assertEquals("dvk", model.containerId()); + Assertions.assertFalse(model.ready()); + Assertions.assertFalse(model.started()); + Assertions.assertEquals(1504091159, 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 index 431fe5263189..d5a8ec5d587f 100644 --- 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 @@ -1,68 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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-06-18T14:41:07Z\",\"runningState\":\"Running\",\"runningStateDetails\":\"u\",\"containers\":[{\"name\":\"srezp\",\"containerId\":\"hneuyowqkd\",\"ready\":false,\"started\":true,\"restartCount\":431891008,\"runningState\":\"Running\",\"runningStateDetails\":\"gpikpzimejza\",\"logStreamEndpoint\":\"fzxiavrmb\",\"execEndpoint\":\"nokixrjqcirgz\"},{\"name\":\"rlazszrnw\",\"containerId\":\"indfpwpjyl\",\"ready\":true,\"started\":false,\"restartCount\":775770123,\"runningState\":\"Running\",\"runningStateDetails\":\"dhszfjv\",\"logStreamEndpoint\":\"gofel\",\"execEndpoint\":\"grqmqhldvrii\"}],\"initContainers\":[{\"name\":\"al\",\"containerId\":\"fk\",\"ready\":true,\"started\":false,\"restartCount\":1376433367,\"runningState\":\"Waiting\",\"runningStateDetails\":\"el\",\"logStreamEndpoint\":\"hhahhxvrhmzkwpjg\",\"execEndpoint\":\"spughftqsxhq\"},{\"name\":\"j\",\"containerId\":\"kndxdigrjgu\",\"ready\":true,\"started\":false,\"restartCount\":1986319957,\"runningState\":\"Running\",\"runningStateDetails\":\"ihwhbotzingamvpp\",\"logStreamEndpoint\":\"szqzudphqamv\",\"execEndpoint\":\"fwynwcvtbvkay\"}]},\"id\":\"tnvyqiatkzwp\",\"name\":\"npwzcjaes\",\"type\":\"vvsccyajguq\"}") + "{\"properties\":{\"createdTime\":\"2021-09-06T12:44:24Z\",\"runningState\":\"Unknown\",\"runningStateDetails\":\"ebqaaysjkixqtnq\",\"containers\":[{\"name\":\"lwfffi\",\"containerId\":\"pjpqqmtedltmmji\",\"ready\":false,\"started\":false,\"restartCount\":448290186,\"runningState\":\"Terminated\",\"runningStateDetails\":\"uyqncygupkvipmd\",\"logStreamEndpoint\":\"wx\",\"execEndpoint\":\"pevzhfst\",\"debugEndpoint\":\"xhojuj\"}],\"initContainers\":[{\"name\":\"lmcuvhixb\",\"containerId\":\"yfwnylr\",\"ready\":false,\"started\":false,\"restartCount\":1240689127,\"runningState\":\"Waiting\",\"runningStateDetails\":\"w\",\"logStreamEndpoint\":\"bnujrywvtylbf\",\"execEndpoint\":\"curdoiwiitht\",\"debugEndpoint\":\"ubxcbihw\"},{\"name\":\"nfdn\",\"containerId\":\"jchrdgoihxumw\",\"ready\":false,\"started\":false,\"restartCount\":498677295,\"runningState\":\"Waiting\",\"runningStateDetails\":\"dfdlwggyts\",\"logStreamEndpoint\":\"tov\",\"execEndpoint\":\"gseinq\",\"debugEndpoint\":\"ufxqknpirgnepttw\"},{\"name\":\"sniffc\",\"containerId\":\"qnrojlpijnkrxfrd\",\"ready\":false,\"started\":false,\"restartCount\":2089008391,\"runningState\":\"Running\",\"runningStateDetails\":\"onasxifto\",\"logStreamEndpoint\":\"yzhftwesgogczh\",\"execEndpoint\":\"nxkrlgnyhmossxkk\",\"debugEndpoint\":\"h\"},{\"name\":\"gh\",\"containerId\":\"bdhqxvcxgf\",\"ready\":true,\"started\":false,\"restartCount\":997081682,\"runningState\":\"Terminated\",\"runningStateDetails\":\"nsvbuswdv\",\"logStreamEndpoint\":\"ybycnunvj\",\"execEndpoint\":\"tkfa\",\"debugEndpoint\":\"opqgikyzirtxdyux\"}]},\"id\":\"jntpsewgioilqu\",\"name\":\"rydxtqm\",\"type\":\"eoxorggufhyao\"}") .toObject(ReplicaInner.class); - Assertions.assertEquals("srezp", model.containers().get(0).name()); - Assertions.assertEquals("hneuyowqkd", model.containers().get(0).containerId()); + Assertions.assertEquals("lwfffi", model.containers().get(0).name()); + Assertions.assertEquals("pjpqqmtedltmmji", model.containers().get(0).containerId()); Assertions.assertFalse(model.containers().get(0).ready()); - Assertions.assertTrue(model.containers().get(0).started()); - Assertions.assertEquals(431891008, model.containers().get(0).restartCount()); - Assertions.assertEquals("al", model.initContainers().get(0).name()); - Assertions.assertEquals("fk", model.initContainers().get(0).containerId()); - Assertions.assertTrue(model.initContainers().get(0).ready()); + Assertions.assertFalse(model.containers().get(0).started()); + Assertions.assertEquals(448290186, model.containers().get(0).restartCount()); + Assertions.assertEquals("lmcuvhixb", model.initContainers().get(0).name()); + Assertions.assertEquals("yfwnylr", model.initContainers().get(0).containerId()); + Assertions.assertFalse(model.initContainers().get(0).ready()); Assertions.assertFalse(model.initContainers().get(0).started()); - Assertions.assertEquals(1376433367, 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("srezp") - .withContainerId("hneuyowqkd") - .withReady(false) - .withStarted(true) - .withRestartCount(431891008), - new ReplicaContainer().withName("rlazszrnw") - .withContainerId("indfpwpjyl") - .withReady(true) - .withStarted(false) - .withRestartCount(775770123))) - .withInitContainers(Arrays.asList( - new ReplicaContainer().withName("al") - .withContainerId("fk") - .withReady(true) - .withStarted(false) - .withRestartCount(1376433367), - new ReplicaContainer().withName("j") - .withContainerId("kndxdigrjgu") - .withReady(true) - .withStarted(false) - .withRestartCount(1986319957))); - model = BinaryData.fromObject(model).toObject(ReplicaInner.class); - Assertions.assertEquals("srezp", model.containers().get(0).name()); - Assertions.assertEquals("hneuyowqkd", model.containers().get(0).containerId()); - Assertions.assertFalse(model.containers().get(0).ready()); - Assertions.assertTrue(model.containers().get(0).started()); - Assertions.assertEquals(431891008, model.containers().get(0).restartCount()); - Assertions.assertEquals("al", model.initContainers().get(0).name()); - Assertions.assertEquals("fk", model.initContainers().get(0).containerId()); - Assertions.assertTrue(model.initContainers().get(0).ready()); - Assertions.assertFalse(model.initContainers().get(0).started()); - Assertions.assertEquals(1376433367, model.initContainers().get(0).restartCount()); + Assertions.assertEquals(1240689127, 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 index f41d90d047df..8f6467a38cad 100644 --- 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 @@ -1,72 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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-04-26T06:49:27Z\",\"runningState\":\"NotRunning\",\"runningStateDetails\":\"lvdnkfx\",\"containers\":[{\"name\":\"dwzrmuh\",\"containerId\":\"fcqdpsq\",\"ready\":true,\"started\":false,\"restartCount\":1569708886,\"runningState\":\"Waiting\",\"runningStateDetails\":\"gc\",\"logStreamEndpoint\":\"lvez\",\"execEndpoint\":\"pqlmfe\"},{\"name\":\"erqwkyhkobopg\",\"containerId\":\"dkow\",\"ready\":false,\"started\":false,\"restartCount\":2049440725,\"runningState\":\"Waiting\",\"runningStateDetails\":\"wccsnjvcdwxlpqek\",\"logStreamEndpoint\":\"nkhtjsyingw\",\"execEndpoint\":\"atmtdhtmdvy\"},{\"name\":\"ikdgszywkbir\",\"containerId\":\"uzhlhkjoqrv\",\"ready\":true,\"started\":false,\"restartCount\":680417186,\"runningState\":\"Waiting\",\"runningStateDetails\":\"goupmfiibfg\",\"logStreamEndpoint\":\"ioolvrwxkvtkkgll\",\"execEndpoint\":\"jygvjayvbl\"},{\"name\":\"vkzuhbxvvyhgso\",\"containerId\":\"yrqufegxuvwz\",\"ready\":true,\"started\":false,\"restartCount\":882366629,\"runningState\":\"Running\",\"runningStateDetails\":\"dn\",\"logStreamEndpoint\":\"tvgbmhrixkwmy\",\"execEndpoint\":\"ejvegrhbpnaixex\"}],\"initContainers\":[{\"name\":\"reaxhcexdr\",\"containerId\":\"qahqkghtpwijn\",\"ready\":true,\"started\":false,\"restartCount\":175357143,\"runningState\":\"Terminated\",\"runningStateDetails\":\"bfvoowvrv\",\"logStreamEndpoint\":\"gjqppy\",\"execEndpoint\":\"tronzmyhgfi\"}]}") + "{\"createdTime\":\"2021-09-16T13:00:43Z\",\"runningState\":\"NotRunning\",\"runningStateDetails\":\"avgrvkffovjz\",\"containers\":[{\"name\":\"ibgjmfxumvfcl\",\"containerId\":\"ovwxnbkfezzxsc\",\"ready\":true,\"started\":true,\"restartCount\":1562008045,\"runningState\":\"Terminated\",\"runningStateDetails\":\"bzbomvzzbtdcqvpn\",\"logStreamEndpoint\":\"ujviylwdshfs\",\"execEndpoint\":\"rbgyefry\",\"debugEndpoint\":\"gaojf\"},{\"name\":\"nc\",\"containerId\":\"mrfhirctymox\",\"ready\":true,\"started\":false,\"restartCount\":1678964850,\"runningState\":\"Running\",\"runningStateDetails\":\"zuhx\",\"logStreamEndpoint\":\"pqjlihhyusps\",\"execEndpoint\":\"sdvlmfwdgzxulucv\",\"debugEndpoint\":\"mrsreuzvxurisjnh\"}],\"initContainers\":[{\"name\":\"ifqjz\",\"containerId\":\"mrhublwpc\",\"ready\":false,\"started\":true,\"restartCount\":1760346913,\"runningState\":\"Running\",\"runningStateDetails\":\"uutpwoqhih\",\"logStreamEndpoint\":\"qg\",\"execEndpoint\":\"pnfqntcyp\",\"debugEndpoint\":\"jv\"},{\"name\":\"imwkslircizj\",\"containerId\":\"ydfce\",\"ready\":false,\"started\":true,\"restartCount\":733359450,\"runningState\":\"Waiting\",\"runningStateDetails\":\"ftumrtwnawjslbiw\",\"logStreamEndpoint\":\"jgcyztsfmznba\",\"execEndpoint\":\"ph\",\"debugEndpoint\":\"qnrnrpxehuwryk\"}]}") .toObject(ReplicaProperties.class); - Assertions.assertEquals("dwzrmuh", model.containers().get(0).name()); - Assertions.assertEquals("fcqdpsq", model.containers().get(0).containerId()); + Assertions.assertEquals("ibgjmfxumvfcl", model.containers().get(0).name()); + Assertions.assertEquals("ovwxnbkfezzxsc", model.containers().get(0).containerId()); Assertions.assertTrue(model.containers().get(0).ready()); - Assertions.assertFalse(model.containers().get(0).started()); - Assertions.assertEquals(1569708886, model.containers().get(0).restartCount()); - Assertions.assertEquals("reaxhcexdr", model.initContainers().get(0).name()); - Assertions.assertEquals("qahqkghtpwijn", model.initContainers().get(0).containerId()); - Assertions.assertTrue(model.initContainers().get(0).ready()); - Assertions.assertFalse(model.initContainers().get(0).started()); - Assertions.assertEquals(175357143, 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("dwzrmuh") - .withContainerId("fcqdpsq") - .withReady(true) - .withStarted(false) - .withRestartCount(1569708886), - new ReplicaContainer().withName("erqwkyhkobopg") - .withContainerId("dkow") - .withReady(false) - .withStarted(false) - .withRestartCount(2049440725), - new ReplicaContainer().withName("ikdgszywkbir") - .withContainerId("uzhlhkjoqrv") - .withReady(true) - .withStarted(false) - .withRestartCount(680417186), - new ReplicaContainer().withName("vkzuhbxvvyhgso") - .withContainerId("yrqufegxuvwz") - .withReady(true) - .withStarted(false) - .withRestartCount(882366629))) - .withInitContainers(Arrays.asList(new ReplicaContainer().withName("reaxhcexdr") - .withContainerId("qahqkghtpwijn") - .withReady(true) - .withStarted(false) - .withRestartCount(175357143))); - model = BinaryData.fromObject(model).toObject(ReplicaProperties.class); - Assertions.assertEquals("dwzrmuh", model.containers().get(0).name()); - Assertions.assertEquals("fcqdpsq", model.containers().get(0).containerId()); - Assertions.assertTrue(model.containers().get(0).ready()); - Assertions.assertFalse(model.containers().get(0).started()); - Assertions.assertEquals(1569708886, model.containers().get(0).restartCount()); - Assertions.assertEquals("reaxhcexdr", model.initContainers().get(0).name()); - Assertions.assertEquals("qahqkghtpwijn", model.initContainers().get(0).containerId()); - Assertions.assertTrue(model.initContainers().get(0).ready()); - Assertions.assertFalse(model.initContainers().get(0).started()); - Assertions.assertEquals(175357143, model.initContainers().get(0).restartCount()); + Assertions.assertTrue(model.containers().get(0).started()); + Assertions.assertEquals(1562008045, model.containers().get(0).restartCount()); + Assertions.assertEquals("ifqjz", model.initContainers().get(0).name()); + Assertions.assertEquals("mrhublwpc", model.initContainers().get(0).containerId()); + Assertions.assertFalse(model.initContainers().get(0).ready()); + Assertions.assertTrue(model.initContainers().get(0).started()); + Assertions.assertEquals(1760346913, 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 index 04b55ff51138..ad381d835f99 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -19,7 +19,7 @@ public final class ResourceProvidersGetCustomDomainVerificationIdWithResponseMockTests { @Test public void testGetCustomDomainVerificationIdWithResponse() throws Exception { - String responseStr = "\"ovjowazhpabacom\""; + String responseStr = "\"mvmmagoaqylkjz\""; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,6 +32,6 @@ public void testGetCustomDomainVerificationIdWithResponse() throws Exception { .getCustomDomainVerificationIdWithResponse(com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("ovjowazhpabacom", response); + Assertions.assertEquals("mvmmagoaqylkjz", 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 index 02f159ceb0a5..b25b362d324c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -21,7 +21,7 @@ public final class ResourceProvidersJobExecutionWithResponseMockTests { @Test public void testJobExecutionWithResponse() throws Exception { String responseStr - = "{\"name\":\"dpvozglqj\",\"id\":\"nlzclctz\",\"type\":\"owmnd\",\"properties\":{\"status\":\"Unknown\",\"startTime\":\"2021-02-28T02:25:50Z\",\"endTime\":\"2021-02-25T12:02:40Z\",\"template\":{\"containers\":[{\"image\":\"nhmkvfruwku\",\"name\":\"bcpftxudqyemebun\",\"command\":[\"mcirtneemm\",\"auwcg\"],\"args\":[\"noh\",\"itranizerwguda\",\"mxubvfbngfcoce\"],\"env\":[{},{}],\"resources\":{}},{\"image\":\"y\",\"name\":\"mpztraudsvhlc\",\"command\":[\"lregpq\"],\"args\":[\"jhvrztnvgyshqrdg\",\"twmewjzlpykcfazz\"],\"env\":[{},{}],\"resources\":{}},{\"image\":\"erzrransybylpo\",\"name\":\"zrghsrleink\",\"command\":[\"jfncjwvuagfqw\",\"ltngvmreupt\",\"klzmijajw\",\"l\"],\"args\":[\"vaghmpy\"],\"env\":[{},{},{}],\"resources\":{}}],\"initContainers\":[{\"image\":\"igt\",\"name\":\"cvbxqlapsnss\",\"command\":[\"xpavid\",\"ievw\",\"fcvvy\"],\"args\":[\"lpuxgcbdsvalpnpt\",\"trkxgpazwu\",\"x\"],\"env\":[{},{},{},{}],\"resources\":{}},{\"image\":\"obfelhldiuhz\",\"name\":\"qlmfaewz\",\"command\":[\"djpxpqht\",\"qhnmhk\",\"ezsdsuxheq\"],\"args\":[\"ruxspinymmqgwok\",\"ikpazf\",\"mjxuvjipfdvhaxd\"],\"env\":[{},{},{}],\"resources\":{}},{\"image\":\"hpphthdklm\",\"name\":\"tatlakfqoi\",\"command\":[\"iksbb\",\"tooxrpog\",\"phchgjtnhtukfaci\"],\"args\":[\"fntumeezbxvqx\",\"nuvwcgasgomtmjzw\",\"uqgovsxpwwztjfm\",\"khtgfredmlscgrll\"],\"env\":[{}],\"resources\":{}}]}}}"; + = "{\"properties\":{\"status\":\"Processing\",\"startTime\":\"2021-10-19T16:03Z\",\"endTime\":\"2021-02-07T14:09:56Z\",\"template\":{\"containers\":[{\"image\":\"p\",\"name\":\"qdurelyujlfyoum\",\"command\":[\"yec\",\"cdigpt\",\"jbrzmqxucyc\"],\"args\":[\"clxiutg\",\"cyzyzjdnrqjbt\"],\"env\":[{},{},{}],\"resources\":{}},{\"image\":\"qaqbz\",\"name\":\"hfw\",\"command\":[\"atbwbqam\",\"e\",\"liys\",\"pkcvmwf\"],\"args\":[\"xe\"],\"env\":[{}],\"resources\":{}},{\"image\":\"ormcqmic\",\"name\":\"jqpkzfbo\",\"command\":[\"mcsmyqwixvcp\",\"nkwywzwofa\",\"ickduoiqta\",\"t\"],\"args\":[\"kn\",\"rwzawnvs\",\"cfhzagxnvhycv\",\"imwrzregzgyufu\"],\"env\":[{},{}],\"resources\":{}}],\"initContainers\":[{\"image\":\"ye\",\"name\":\"kdhmeottawjyosx\",\"command\":[\"nhjtf\",\"p\",\"dpmiljpn\",\"ynudqllzsa\"],\"args\":[\"jlxeehuxiqhz\",\"raymezx\",\"skihmxrfd\",\"ajrednwyyshtuw\"],\"env\":[{},{},{},{}],\"resources\":{}},{\"image\":\"afpwzyifrkgwl\",\"name\":\"eqipxgzdy\",\"command\":[\"fayorpravkjoges\",\"abnsmj\",\"wynqxaekqsykvwj\",\"qpkevmyltjc\"],\"args\":[\"xklurcclfgxannno\",\"t\",\"posew\"],\"env\":[{},{},{},{}],\"resources\":{}},{\"image\":\"vkqmaupxvpifdfa\",\"name\":\"yzyzeyuu\",\"command\":[\"ds\",\"l\"],\"args\":[\"oithg\"],\"env\":[{},{}],\"resources\":{}},{\"image\":\"t\",\"name\":\"dihoyn\",\"command\":[\"wetwkdr\",\"yrucpcunnuzdq\",\"moenodnaien\",\"qh\"],\"args\":[\"dnelqkaad\",\"knwfoanniyo\",\"etxivcnrlyxnuc\",\"ephblkwqpatvbqs\"],\"env\":[{},{}],\"resources\":{}}]},\"detailedStatus\":{\"replicas\":[{\"name\":\"i\",\"containers\":[{},{},{},{}]},{\"name\":\"y\",\"containers\":[{}]},{\"name\":\"wogtgitsq\",\"containers\":[{},{}]}]},\"reason\":\"rzcdbanf\",\"message\":\"ds\"},\"id\":\"mxeatkdbmwnrdjy\",\"name\":\"bqbnaomhjrmkuh\",\"type\":\"axljal\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,21 +31,19 @@ public void testJobExecutionWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); JobExecution response = manager.resourceProviders() - .jobExecutionWithResponse("ykeys", "ewfopazdazg", "sqgpewqcfu", com.azure.core.util.Context.NONE) + .jobExecutionWithResponse("jiuazjc", "mxitpfinzcpd", "tkrlgjmtbd", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("dpvozglqj", response.name()); - Assertions.assertEquals("nlzclctz", response.id()); - Assertions.assertEquals("owmnd", response.type()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-28T02:25:50Z"), response.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T12:02:40Z"), response.endTime()); - Assertions.assertEquals("nhmkvfruwku", response.template().containers().get(0).image()); - Assertions.assertEquals("bcpftxudqyemebun", response.template().containers().get(0).name()); - Assertions.assertEquals("mcirtneemm", response.template().containers().get(0).command().get(0)); - Assertions.assertEquals("noh", response.template().containers().get(0).args().get(0)); - Assertions.assertEquals("igt", response.template().initContainers().get(0).image()); - Assertions.assertEquals("cvbxqlapsnss", response.template().initContainers().get(0).name()); - Assertions.assertEquals("xpavid", response.template().initContainers().get(0).command().get(0)); - Assertions.assertEquals("lpuxgcbdsvalpnpt", response.template().initContainers().get(0).args().get(0)); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-19T16:03Z"), response.startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-07T14:09:56Z"), response.endTime()); + Assertions.assertEquals("p", response.template().containers().get(0).image()); + Assertions.assertEquals("qdurelyujlfyoum", response.template().containers().get(0).name()); + Assertions.assertEquals("yec", response.template().containers().get(0).command().get(0)); + Assertions.assertEquals("clxiutg", response.template().containers().get(0).args().get(0)); + Assertions.assertEquals("ye", response.template().initContainers().get(0).image()); + Assertions.assertEquals("kdhmeottawjyosx", response.template().initContainers().get(0).name()); + Assertions.assertEquals("nhjtf", response.template().initContainers().get(0).command().get(0)); + Assertions.assertEquals("jlxeehuxiqhz", response.template().initContainers().get(0).args().get(0)); + Assertions.assertEquals("i", response.detailedStatus().replicas().get(0).name()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ResourceTagsTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ResourceTagsTests.java index 6c325c5477e4..d54a2d9bd190 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ResourceTagsTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ResourceTagsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -13,18 +13,17 @@ public final class ResourceTagsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ResourceTags model = BinaryData - .fromString("{\"tags\":{\"eggzfb\":\"lhocohslkev\",\"ithlvmezyvshxm\":\"hfmvfaxkffe\",\"gigr\":\"sbbzo\"}}") - .toObject(ResourceTags.class); - Assertions.assertEquals("lhocohslkev", model.tags().get("eggzfb")); + ResourceTags model + = BinaryData.fromString("{\"tags\":{\"wfmvigorqjbt\":\"rojphslhcawjutif\",\"n\":\"zhraglkafh\"}}") + .toObject(ResourceTags.class); + Assertions.assertEquals("rojphslhcawjutif", model.tags().get("wfmvigorqjbt")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ResourceTags model = new ResourceTags() - .withTags(mapOf("eggzfb", "lhocohslkev", "ithlvmezyvshxm", "hfmvfaxkffe", "gigr", "sbbzo")); + ResourceTags model = new ResourceTags().withTags(mapOf("wfmvigorqjbt", "rojphslhcawjutif", "n", "zhraglkafh")); model = BinaryData.fromObject(model).toObject(ResourceTags.class); - Assertions.assertEquals("lhocohslkev", model.tags().get("eggzfb")); + Assertions.assertEquals("rojphslhcawjutif", model.tags().get("wfmvigorqjbt")); } // Use "Map.of" if available 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 index 66e961337f3f..f5448ee15318 100644 --- 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 @@ -1,26 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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; +import com.azure.resourcemanager.appcontainers.implementation.models.RevisionCollection; +import org.junit.jupiter.api.Assertions; public final class RevisionCollectionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RevisionCollection model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"createdTime\":\"2021-07-27T14:49:58Z\",\"lastActiveTime\":\"2021-07-16T02:04:17Z\",\"fqdn\":\"iilivpdtiirqtd\",\"template\":{\"revisionSuffix\":\"xoruzfgsquyfxrx\",\"terminationGracePeriodSeconds\":4742398827211014081,\"initContainers\":[{},{},{}],\"containers\":[{},{}],\"scale\":{\"minReplicas\":767638110,\"maxReplicas\":576385447,\"cooldownPeriod\":800812531,\"pollingInterval\":2125136939,\"rules\":[{},{}]},\"volumes\":[{},{}],\"serviceBinds\":[{},{},{}]},\"active\":false,\"replicas\":2021159944,\"trafficWeight\":1772856853,\"provisioningError\":\"ooaojkniodkooebw\",\"healthState\":\"Unhealthy\",\"provisioningState\":\"Provisioning\",\"runningState\":\"Stopped\"},\"id\":\"bvdkcrodtjin\",\"name\":\"wj\",\"type\":\"fltkacjv\"},{\"properties\":{\"createdTime\":\"2021-02-27T20:28:50Z\",\"lastActiveTime\":\"2021-05-26T04:23:15Z\",\"fqdn\":\"akggkfpag\",\"template\":{\"revisionSuffix\":\"pulpqblylsyxk\",\"terminationGracePeriodSeconds\":2784365804369972582,\"initContainers\":[{},{},{}],\"containers\":[{}],\"scale\":{\"minReplicas\":853584621,\"maxReplicas\":574368120,\"cooldownPeriod\":1219711828,\"pollingInterval\":300652105,\"rules\":[{}]},\"volumes\":[{},{},{},{}],\"serviceBinds\":[{},{},{}]},\"active\":true,\"replicas\":71389459,\"trafficWeight\":1389741266,\"provisioningError\":\"v\",\"healthState\":\"Healthy\",\"provisioningState\":\"Provisioning\",\"runningState\":\"Processing\"},\"id\":\"v\",\"name\":\"jjxd\",\"type\":\"rbuukzclewyhmlwp\"},{\"properties\":{\"createdTime\":\"2021-07-12T19:02:13Z\",\"lastActiveTime\":\"2021-09-17T05:43:05Z\",\"fqdn\":\"ncckw\",\"template\":{\"revisionSuffix\":\"qwhxxbuyqaxzfeqz\",\"terminationGracePeriodSeconds\":5894027165628852811,\"initContainers\":[{}],\"containers\":[{},{},{},{}],\"scale\":{\"minReplicas\":110839155,\"maxReplicas\":295575748,\"cooldownPeriod\":1263192387,\"pollingInterval\":1325987050,\"rules\":[{},{},{}]},\"volumes\":[{},{}],\"serviceBinds\":[{},{},{}]},\"active\":true,\"replicas\":1713401176,\"trafficWeight\":1867992626,\"provisioningError\":\"wdcfhucqdpfuv\",\"healthState\":\"Healthy\",\"provisioningState\":\"Provisioned\",\"runningState\":\"Degraded\"},\"id\":\"nvxbvt\",\"name\":\"udutnco\",\"type\":\"mr\"},{\"properties\":{\"createdTime\":\"2021-10-06T09:07:18Z\",\"lastActiveTime\":\"2021-11-04T23:00:23Z\",\"fqdn\":\"fudflvkgjub\",\"template\":{\"revisionSuffix\":\"nnqvsa\",\"terminationGracePeriodSeconds\":8761404710437342780,\"initContainers\":[{},{}],\"containers\":[{},{}],\"scale\":{\"minReplicas\":1292575401,\"maxReplicas\":63235261,\"cooldownPeriod\":1726398247,\"pollingInterval\":332873704,\"rules\":[{},{},{},{}]},\"volumes\":[{},{},{}],\"serviceBinds\":[{}]},\"active\":false,\"replicas\":515836708,\"trafficWeight\":1169859080,\"provisioningError\":\"uruv\",\"healthState\":\"Unhealthy\",\"provisioningState\":\"Provisioned\",\"runningState\":\"Stopped\"},\"id\":\"xwabmqoe\",\"name\":\"kif\",\"type\":\"vtpuqujmqlgk\"}],\"nextLink\":\"tndoaongbjc\"}") + "{\"value\":[{\"properties\":{\"createdTime\":\"2020-12-23T05:41:54Z\",\"lastActiveTime\":\"2021-01-16T04:25:55Z\",\"fqdn\":\"q\",\"template\":{\"revisionSuffix\":\"gzpfrla\",\"terminationGracePeriodSeconds\":4530556699982687099,\"initContainers\":[{},{}],\"containers\":[{}],\"scale\":{\"minReplicas\":1988160983,\"maxReplicas\":618267634,\"cooldownPeriod\":506888609,\"pollingInterval\":2003190846,\"allowScalingRuleOverride\":true,\"rules\":[{},{},{},{}]},\"volumes\":[{}],\"serviceBinds\":[{}]},\"active\":false,\"replicas\":1612307116,\"trafficWeight\":1421362478,\"provisioningError\":\"fjvfbgofeljagr\",\"healthState\":\"Healthy\",\"provisioningState\":\"Deprovisioned\",\"runningState\":\"Processing\"},\"id\":\"iiiojnalghf\",\"name\":\"vtvsexsowueluq\",\"type\":\"hahhxvrhmzkwpj\"},{\"properties\":{\"createdTime\":\"2021-10-11T18:28:46Z\",\"lastActiveTime\":\"2021-02-08T16:54:53Z\",\"fqdn\":\"hftqsxhqxujxukn\",\"template\":{\"revisionSuffix\":\"igrjguufzdm\",\"terminationGracePeriodSeconds\":6962581642062149568,\"initContainers\":[{},{},{},{}],\"containers\":[{},{},{}],\"scale\":{\"minReplicas\":970693674,\"maxReplicas\":110136090,\"cooldownPeriod\":562718876,\"pollingInterval\":1709728841,\"allowScalingRuleOverride\":false,\"rules\":[{},{}]},\"volumes\":[{}],\"serviceBinds\":[{},{}]},\"active\":true,\"replicas\":1680525224,\"trafficWeight\":1947700175,\"provisioningError\":\"amvdkfwynwcvtbv\",\"healthState\":\"Healthy\",\"provisioningState\":\"Provisioned\",\"runningState\":\"Degraded\"},\"id\":\"yqiatkzwp\",\"name\":\"npwzcjaes\",\"type\":\"vvsccyajguq\"},{\"properties\":{\"createdTime\":\"2021-07-13T08:21:12Z\",\"lastActiveTime\":\"2021-07-31T19:29:02Z\",\"fqdn\":\"vdnkfxusem\",\"template\":{\"revisionSuffix\":\"rmuhapfcq\",\"terminationGracePeriodSeconds\":6594560791978849065,\"initContainers\":[{},{},{}],\"containers\":[{},{},{}],\"scale\":{\"minReplicas\":1569708886,\"maxReplicas\":1021951816,\"cooldownPeriod\":434335068,\"pollingInterval\":1300685521,\"allowScalingRuleOverride\":false,\"rules\":[{},{}]},\"volumes\":[{},{},{}],\"serviceBinds\":[{},{}]},\"active\":true,\"replicas\":643673289,\"trafficWeight\":1526160673,\"provisioningError\":\"erqwkyhkobopg\",\"healthState\":\"Healthy\",\"provisioningState\":\"Deprovisioned\",\"runningState\":\"Failed\"},\"id\":\"bqpc\",\"name\":\"fkbw\",\"type\":\"csnjvcdwxlpqekft\"},{\"properties\":{\"createdTime\":\"2021-05-12T04:10:49Z\",\"lastActiveTime\":\"2021-09-07T14:23:49Z\",\"fqdn\":\"i\",\"template\":{\"revisionSuffix\":\"fq\",\"terminationGracePeriodSeconds\":3785815942098550285,\"initContainers\":[{},{}],\"containers\":[{}],\"scale\":{\"minReplicas\":1330472875,\"maxReplicas\":1700439966,\"cooldownPeriod\":811019553,\"pollingInterval\":1506382079,\"allowScalingRuleOverride\":false,\"rules\":[{}]},\"volumes\":[{},{},{}],\"serviceBinds\":[{},{},{}]},\"active\":true,\"replicas\":486581460,\"trafficWeight\":421118351,\"provisioningError\":\"kj\",\"healthState\":\"None\",\"provisioningState\":\"Deprovisioned\",\"runningState\":\"Failed\"},\"id\":\"t\",\"name\":\"inrvgoupmfi\",\"type\":\"bfggjioolvr\"}],\"nextLink\":\"kvtkkg\"}") .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(), new RevisionInner())); - model = BinaryData.fromObject(model).toObject(RevisionCollection.class); + Assertions.assertEquals("kvtkkg", model.nextLink()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RuntimeJavaTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RuntimeJavaTests.java index 923ad77e9943..0fddec20d1b9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RuntimeJavaTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RuntimeJavaTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RuntimeTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RuntimeTests.java index 38ecbc322163..1d7e7d4df92e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RuntimeTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RuntimeTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,14 +12,14 @@ public final class RuntimeTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Runtime model = BinaryData.fromString("{\"java\":{\"enableMetrics\":true}}").toObject(Runtime.class); - Assertions.assertTrue(model.java().enableMetrics()); + Runtime model = BinaryData.fromString("{\"java\":{\"enableMetrics\":false}}").toObject(Runtime.class); + Assertions.assertFalse(model.java().enableMetrics()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Runtime model = new Runtime().withJava(new RuntimeJava().withEnableMetrics(true)); + Runtime model = new Runtime().withJava(new RuntimeJava().withEnableMetrics(false)); model = BinaryData.fromObject(model).toObject(Runtime.class); - Assertions.assertTrue(model.java().enableMetrics()); + Assertions.assertFalse(model.java().enableMetrics()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupInnerTests.java new file mode 100644 index 000000000000..313c035b6e3f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupInnerTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.fluent.models.SandboxGroupInner; +import com.azure.resourcemanager.appcontainers.models.SandboxGroupProperties; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class SandboxGroupInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SandboxGroupInner model = BinaryData.fromString( + "{\"properties\":{\"environmentId\":\"v\",\"defaultDomain\":\"xmzsbbzogg\",\"provisioningState\":\"Succeeded\"},\"location\":\"wburvjxxjnspydpt\",\"tags\":{\"udwtiukbl\":\"nkoukn\",\"o\":\"ngkpocipazy\",\"ntypmrbpizcdrqj\":\"gukgjnpiucgygevq\"},\"id\":\"dpydn\",\"name\":\"yhxdeoejzicwi\",\"type\":\"sjttgzfbish\"}") + .toObject(SandboxGroupInner.class); + Assertions.assertEquals("wburvjxxjnspydpt", model.location()); + Assertions.assertEquals("nkoukn", model.tags().get("udwtiukbl")); + Assertions.assertEquals("v", model.properties().environmentId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SandboxGroupInner model = new SandboxGroupInner().withLocation("wburvjxxjnspydpt") + .withTags(mapOf("udwtiukbl", "nkoukn", "o", "ngkpocipazy", "ntypmrbpizcdrqj", "gukgjnpiucgygevq")) + .withProperties(new SandboxGroupProperties().withEnvironmentId("v")); + model = BinaryData.fromObject(model).toObject(SandboxGroupInner.class); + Assertions.assertEquals("wburvjxxjnspydpt", model.location()); + Assertions.assertEquals("nkoukn", model.tags().get("udwtiukbl")); + Assertions.assertEquals("v", model.properties().environmentId()); + } + + // 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/SandboxGroupListResultTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupListResultTests.java new file mode 100644 index 000000000000..a23995cf3cfd --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupListResultTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.implementation.models.SandboxGroupListResult; +import org.junit.jupiter.api.Assertions; + +public final class SandboxGroupListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SandboxGroupListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"environmentId\":\"ocukoklyax\",\"defaultDomain\":\"onuq\",\"provisioningState\":\"Failed\"},\"location\":\"beypewrmjmw\",\"tags\":{\"wlrsffrzpwv\":\"ektcxsen\",\"ylihkaetckt\":\"qdqgbi\",\"ctq\":\"fcivfsnkym\"},\"id\":\"jf\",\"name\":\"ebrjcxe\",\"type\":\"fuwutttxf\"},{\"properties\":{\"environmentId\":\"birphxepcyva\",\"defaultDomain\":\"nljky\",\"provisioningState\":\"Deleting\"},\"location\":\"uujqgidokgjljyo\",\"tags\":{\"hbijhtxfvgxb\":\"cltbgsncghkjesz\",\"eh\":\"smx\",\"qkkrb\":\"pvecxgodeb\"},\"id\":\"pukgriwflzlfb\",\"name\":\"zpuzycisp\",\"type\":\"qzahmgkbrp\"}],\"nextLink\":\"dhibnuq\"}") + .toObject(SandboxGroupListResult.class); + Assertions.assertEquals("beypewrmjmw", model.value().get(0).location()); + Assertions.assertEquals("ektcxsen", model.value().get(0).tags().get("wlrsffrzpwv")); + Assertions.assertEquals("ocukoklyax", model.value().get(0).properties().environmentId()); + Assertions.assertEquals("dhibnuq", model.nextLink()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupPatchPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupPatchPropertiesTests.java new file mode 100644 index 000000000000..287a10a63109 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupPatchPropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.SandboxGroupPatchProperties; +import org.junit.jupiter.api.Assertions; + +public final class SandboxGroupPatchPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SandboxGroupPatchProperties model + = BinaryData.fromString("{\"environmentId\":\"hheunmmqhgyx\"}").toObject(SandboxGroupPatchProperties.class); + Assertions.assertEquals("hheunmmqhgyx", model.environmentId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SandboxGroupPatchProperties model = new SandboxGroupPatchProperties().withEnvironmentId("hheunmmqhgyx"); + model = BinaryData.fromObject(model).toObject(SandboxGroupPatchProperties.class); + Assertions.assertEquals("hheunmmqhgyx", model.environmentId()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupPatchTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupPatchTests.java new file mode 100644 index 000000000000..8f96f5cf9fd5 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupPatchTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.SandboxGroupPatch; +import com.azure.resourcemanager.appcontainers.models.SandboxGroupPatchProperties; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class SandboxGroupPatchTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SandboxGroupPatch model = BinaryData.fromString( + "{\"tags\":{\"hwankixzbinjepu\":\"pwhonowkg\",\"uzoqft\":\"tmryw\",\"zlsico\":\"yqzrnkcqvyxlw\"},\"properties\":{\"environmentId\":\"qnwvlrya\"}}") + .toObject(SandboxGroupPatch.class); + Assertions.assertEquals("pwhonowkg", model.tags().get("hwankixzbinjepu")); + Assertions.assertEquals("qnwvlrya", model.properties().environmentId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SandboxGroupPatch model = new SandboxGroupPatch() + .withTags(mapOf("hwankixzbinjepu", "pwhonowkg", "uzoqft", "tmryw", "zlsico", "yqzrnkcqvyxlw")) + .withProperties(new SandboxGroupPatchProperties().withEnvironmentId("qnwvlrya")); + model = BinaryData.fromObject(model).toObject(SandboxGroupPatch.class); + Assertions.assertEquals("pwhonowkg", model.tags().get("hwankixzbinjepu")); + Assertions.assertEquals("qnwvlrya", model.properties().environmentId()); + } + + // 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/SandboxGroupPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupPropertiesTests.java new file mode 100644 index 000000000000..2372fcf69fc9 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupPropertiesTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.SandboxGroupProperties; +import org.junit.jupiter.api.Assertions; + +public final class SandboxGroupPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SandboxGroupProperties model = BinaryData + .fromString( + "{\"environmentId\":\"khaj\",\"defaultDomain\":\"yeamdphagalpb\",\"provisioningState\":\"InProgress\"}") + .toObject(SandboxGroupProperties.class); + Assertions.assertEquals("khaj", model.environmentId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SandboxGroupProperties model = new SandboxGroupProperties().withEnvironmentId("khaj"); + model = BinaryData.fromObject(model).toObject(SandboxGroupProperties.class); + Assertions.assertEquals("khaj", model.environmentId()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupsCreateOrUpdateMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupsCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..a8de9d2afedd --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupsCreateOrUpdateMockTests.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.SandboxGroup; +import com.azure.resourcemanager.appcontainers.models.SandboxGroupProperties; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SandboxGroupsCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"environmentId\":\"nxzcm\",\"defaultDomain\":\"ngxno\",\"provisioningState\":\"Succeeded\"},\"location\":\"disnj\",\"tags\":{\"mydidwhepfw\":\"d\",\"dbckyo\":\"tjfdoesxxhmw\",\"jzrbhtmeplv\":\"kxkxhnegk\"},\"id\":\"kaobrl\",\"name\":\"pgsn\",\"type\":\"agnchjhgemuowaky\"}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + SandboxGroup response = manager.sandboxGroups() + .define("hctmmkosz") + .withRegion("lbnld") + .withExistingResourceGroup("xdazv") + .withTags(mapOf("ezyquw", "bh", "brruyuuatv", "sqxutr")) + .withProperties(new SandboxGroupProperties().withEnvironmentId("lnsntrpc")) + .create(); + + Assertions.assertEquals("disnj", response.location()); + Assertions.assertEquals("d", response.tags().get("mydidwhepfw")); + Assertions.assertEquals("nxzcm", response.properties().environmentId()); + } + + // 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/SandboxGroupsGetByResourceGroupWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupsGetByResourceGroupWithResponseMockTests.java new file mode 100644 index 000000000000..b22e68ce46cd --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupsGetByResourceGroupWithResponseMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.SandboxGroup; +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 SandboxGroupsGetByResourceGroupWithResponseMockTests { + @Test + public void testGetByResourceGroupWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"environmentId\":\"iecafygzmxi\",\"defaultDomain\":\"vdsmaklixq\",\"provisioningState\":\"Updating\"},\"location\":\"hxalybxawo\",\"tags\":{\"tblxpkkwjdjodqhy\":\"o\",\"mehllizhceu\":\"incnr\"},\"id\":\"oqodkadpp\",\"name\":\"ibngqladyw\",\"type\":\"xwhydtluvv\"}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + SandboxGroup response = manager.sandboxGroups() + .getByResourceGroupWithResponse("qfrojsydgrhyd", "ygywe", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("hxalybxawo", response.location()); + Assertions.assertEquals("o", response.tags().get("tblxpkkwjdjodqhy")); + Assertions.assertEquals("iecafygzmxi", response.properties().environmentId()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupsListByResourceGroupMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupsListByResourceGroupMockTests.java new file mode 100644 index 000000000000..bf56ef981610 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupsListByResourceGroupMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.SandboxGroup; +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 SandboxGroupsListByResourceGroupMockTests { + @Test + public void testListByResourceGroup() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"environmentId\":\"dxlwyojbfqz\",\"defaultDomain\":\"fnjyix\",\"provisioningState\":\"Updating\"},\"location\":\"atqxmbjroumzzn\",\"tags\":{\"pusllywpv\":\"qjrhuzgfxonj\"},\"id\":\"iotzbpdbollgryfq\",\"name\":\"uasigr\",\"type\":\"wsocnequygdjbo\"}]}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.sandboxGroups().listByResourceGroup("jidhftu", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("atqxmbjroumzzn", response.iterator().next().location()); + Assertions.assertEquals("qjrhuzgfxonj", response.iterator().next().tags().get("pusllywpv")); + Assertions.assertEquals("dxlwyojbfqz", response.iterator().next().properties().environmentId()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupsListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupsListMockTests.java new file mode 100644 index 000000000000..85d4d46eef9d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupsListMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.SandboxGroup; +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 SandboxGroupsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"environmentId\":\"mtqjkqevadrmm\",\"defaultDomain\":\"uawvcmjzk\",\"provisioningState\":\"Canceled\"},\"location\":\"isczskoswo\",\"tags\":{\"sbamnppcc\":\"azugamxzkrrcoi\"},\"id\":\"kuztdsbezaxyfu\",\"name\":\"zxuizhyhnepkpe\",\"type\":\"iarxqiubxdukec\"}]}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.sandboxGroups().list(com.azure.core.util.Context.NONE); + + Assertions.assertEquals("isczskoswo", response.iterator().next().location()); + Assertions.assertEquals("azugamxzkrrcoi", response.iterator().next().tags().get("sbamnppcc")); + Assertions.assertEquals("mtqjkqevadrmm", response.iterator().next().properties().environmentId()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupsUpdateMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupsUpdateMockTests.java new file mode 100644 index 000000000000..303c9cd422f7 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SandboxGroupsUpdateMockTests.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.SandboxGroupPatch; +import com.azure.resourcemanager.appcontainers.models.SandboxGroupPatchProperties; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SandboxGroupsUpdateMockTests { + @Test + public void testUpdate() 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.sandboxGroups() + .update("ds", "zsn", + new SandboxGroupPatch().withTags(mapOf("lnwy", "mlowuowhl", "mo", "mouvbl", "ih", "zkltrfowtdvrfmv")) + .withProperties(new SandboxGroupPatchProperties().withEnvironmentId("drqc")), + com.azure.core.util.Context.NONE); + + } + + // 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/ScaleConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ScaleConfigurationTests.java index 7b955e70950e..a72ee031d924 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ScaleConfigurationTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ScaleConfigurationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,18 +12,18 @@ public final class ScaleConfigurationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScaleConfiguration model - = BinaryData.fromString("{\"maxConcurrentSessions\":924054610,\"readySessionInstances\":1523023612}") + = BinaryData.fromString("{\"maxConcurrentSessions\":423857841,\"readySessionInstances\":676012519}") .toObject(ScaleConfiguration.class); - Assertions.assertEquals(924054610, model.maxConcurrentSessions()); - Assertions.assertEquals(1523023612, model.readySessionInstances()); + Assertions.assertEquals(423857841, model.maxConcurrentSessions()); + Assertions.assertEquals(676012519, model.readySessionInstances()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ScaleConfiguration model - = new ScaleConfiguration().withMaxConcurrentSessions(924054610).withReadySessionInstances(1523023612); + = new ScaleConfiguration().withMaxConcurrentSessions(423857841).withReadySessionInstances(676012519); model = BinaryData.fromObject(model).toObject(ScaleConfiguration.class); - Assertions.assertEquals(924054610, model.maxConcurrentSessions()); - Assertions.assertEquals(1523023612, model.readySessionInstances()); + Assertions.assertEquals(423857841, model.maxConcurrentSessions()); + Assertions.assertEquals(676012519, model.readySessionInstances()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ScheduledEntriesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ScheduledEntriesTests.java index 5cfcbf68c3a2..c9be9d555769 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ScheduledEntriesTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ScheduledEntriesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -15,21 +15,25 @@ public final class ScheduledEntriesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScheduledEntries model = BinaryData.fromString( - "{\"scheduledEntries\":[{\"weekDay\":\"Tuesday\",\"startHourUtc\":597638958,\"durationHours\":868896591},{\"weekDay\":\"Monday\",\"startHourUtc\":97520193,\"durationHours\":96011732}]}") + "{\"scheduledEntries\":[{\"weekDay\":\"Monday\",\"startHourUtc\":1912464572,\"durationHours\":988577798},{\"weekDay\":\"Monday\",\"startHourUtc\":290904524,\"durationHours\":1604128038},{\"weekDay\":\"Sunday\",\"startHourUtc\":91988109,\"durationHours\":2102301127},{\"weekDay\":\"Friday\",\"startHourUtc\":1149033945,\"durationHours\":709462942}]}") .toObject(ScheduledEntries.class); - Assertions.assertEquals(WeekDay.TUESDAY, model.scheduledEntries().get(0).weekDay()); - Assertions.assertEquals(597638958, model.scheduledEntries().get(0).startHourUtc()); - Assertions.assertEquals(868896591, model.scheduledEntries().get(0).durationHours()); + Assertions.assertEquals(WeekDay.MONDAY, model.scheduledEntries().get(0).weekDay()); + Assertions.assertEquals(1912464572, model.scheduledEntries().get(0).startHourUtc()); + Assertions.assertEquals(988577798, model.scheduledEntries().get(0).durationHours()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ScheduledEntries model = new ScheduledEntries().withScheduledEntries(Arrays.asList( - new ScheduledEntry().withWeekDay(WeekDay.TUESDAY).withStartHourUtc(597638958).withDurationHours(868896591), - new ScheduledEntry().withWeekDay(WeekDay.MONDAY).withStartHourUtc(97520193).withDurationHours(96011732))); + new ScheduledEntry().withWeekDay(WeekDay.MONDAY).withStartHourUtc(1912464572).withDurationHours(988577798), + new ScheduledEntry().withWeekDay(WeekDay.MONDAY).withStartHourUtc(290904524).withDurationHours(1604128038), + new ScheduledEntry().withWeekDay(WeekDay.SUNDAY).withStartHourUtc(91988109).withDurationHours(2102301127), + new ScheduledEntry().withWeekDay(WeekDay.FRIDAY) + .withStartHourUtc(1149033945) + .withDurationHours(709462942))); model = BinaryData.fromObject(model).toObject(ScheduledEntries.class); - Assertions.assertEquals(WeekDay.TUESDAY, model.scheduledEntries().get(0).weekDay()); - Assertions.assertEquals(597638958, model.scheduledEntries().get(0).startHourUtc()); - Assertions.assertEquals(868896591, model.scheduledEntries().get(0).durationHours()); + Assertions.assertEquals(WeekDay.MONDAY, model.scheduledEntries().get(0).weekDay()); + Assertions.assertEquals(1912464572, model.scheduledEntries().get(0).startHourUtc()); + Assertions.assertEquals(988577798, model.scheduledEntries().get(0).durationHours()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ScheduledEntryTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ScheduledEntryTests.java index 16d5e8bbde70..413ef1440424 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ScheduledEntryTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ScheduledEntryTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -13,21 +13,21 @@ public final class ScheduledEntryTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScheduledEntry model - = BinaryData.fromString("{\"weekDay\":\"Monday\",\"startHourUtc\":2014891569,\"durationHours\":1921621659}") + = BinaryData.fromString("{\"weekDay\":\"Saturday\",\"startHourUtc\":529081403,\"durationHours\":308339857}") .toObject(ScheduledEntry.class); - Assertions.assertEquals(WeekDay.MONDAY, model.weekDay()); - Assertions.assertEquals(2014891569, model.startHourUtc()); - Assertions.assertEquals(1921621659, model.durationHours()); + Assertions.assertEquals(WeekDay.SATURDAY, model.weekDay()); + Assertions.assertEquals(529081403, model.startHourUtc()); + Assertions.assertEquals(308339857, model.durationHours()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScheduledEntry model = new ScheduledEntry().withWeekDay(WeekDay.MONDAY) - .withStartHourUtc(2014891569) - .withDurationHours(1921621659); + ScheduledEntry model = new ScheduledEntry().withWeekDay(WeekDay.SATURDAY) + .withStartHourUtc(529081403) + .withDurationHours(308339857); model = BinaryData.fromObject(model).toObject(ScheduledEntry.class); - Assertions.assertEquals(WeekDay.MONDAY, model.weekDay()); - Assertions.assertEquals(2014891569, model.startHourUtc()); - Assertions.assertEquals(1921621659, model.durationHours()); + Assertions.assertEquals(WeekDay.SATURDAY, model.weekDay()); + Assertions.assertEquals(529081403, model.startHourUtc()); + Assertions.assertEquals(308339857, model.durationHours()); } } 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 index ec8c35be0e5b..f46d45a02b83 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,17 +11,17 @@ public final class ServiceBindTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ServiceBind model = BinaryData.fromString("{\"serviceId\":\"gebdunygaeq\",\"name\":\"bqfatpxllrxcyjmo\"}") - .toObject(ServiceBind.class); - Assertions.assertEquals("gebdunygaeq", model.serviceId()); - Assertions.assertEquals("bqfatpxllrxcyjmo", model.name()); + ServiceBind model + = BinaryData.fromString("{\"serviceId\":\"ly\",\"name\":\"hdgqggeb\"}").toObject(ServiceBind.class); + Assertions.assertEquals("ly", model.serviceId()); + Assertions.assertEquals("hdgqggeb", model.name()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServiceBind model = new ServiceBind().withServiceId("gebdunygaeq").withName("bqfatpxllrxcyjmo"); + ServiceBind model = new ServiceBind().withServiceId("ly").withName("hdgqggeb"); model = BinaryData.fromObject(model).toObject(ServiceBind.class); - Assertions.assertEquals("gebdunygaeq", model.serviceId()); - Assertions.assertEquals("bqfatpxllrxcyjmo", model.name()); + Assertions.assertEquals("ly", model.serviceId()); + Assertions.assertEquals("hdgqggeb", 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 index b0a7c7f80cf4..cc76e80325a8 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,14 +11,14 @@ public final class ServiceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Service model = BinaryData.fromString("{\"type\":\"vwvxyslqbhsfx\"}").toObject(Service.class); - Assertions.assertEquals("vwvxyslqbhsfx", model.type()); + Service model = BinaryData.fromString("{\"type\":\"hnzdndslgnayqi\"}").toObject(Service.class); + Assertions.assertEquals("hnzdndslgnayqi", model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Service model = new Service().withType("vwvxyslqbhsfx"); + Service model = new Service().withType("hnzdndslgnayqi"); model = BinaryData.fromObject(model).toObject(Service.class); - Assertions.assertEquals("vwvxyslqbhsfx", model.type()); + Assertions.assertEquals("hnzdndslgnayqi", model.type()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionContainerResourcesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionContainerResourcesTests.java index e6f1a0a30099..76fc97fef250 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionContainerResourcesTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionContainerResourcesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,17 +11,18 @@ public final class SessionContainerResourcesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SessionContainerResources model = BinaryData.fromString("{\"cpu\":9.195063147234494,\"memory\":\"nb\"}") + SessionContainerResources model = BinaryData.fromString("{\"cpu\":53.44216017032322,\"memory\":\"grhpdjpju\"}") .toObject(SessionContainerResources.class); - Assertions.assertEquals(9.195063147234494D, model.cpu()); - Assertions.assertEquals("nb", model.memory()); + Assertions.assertEquals(53.44216017032322D, model.cpu()); + Assertions.assertEquals("grhpdjpju", model.memory()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SessionContainerResources model = new SessionContainerResources().withCpu(9.195063147234494D).withMemory("nb"); + SessionContainerResources model + = new SessionContainerResources().withCpu(53.44216017032322D).withMemory("grhpdjpju"); model = BinaryData.fromObject(model).toObject(SessionContainerResources.class); - Assertions.assertEquals(9.195063147234494D, model.cpu()); - Assertions.assertEquals("nb", model.memory()); + Assertions.assertEquals(53.44216017032322D, model.cpu()); + Assertions.assertEquals("grhpdjpju", model.memory()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionIngressTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionIngressTests.java index 414366712d47..548ce6d1af56 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionIngressTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionIngressTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,14 +11,14 @@ public final class SessionIngressTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SessionIngress model = BinaryData.fromString("{\"targetPort\":834158684}").toObject(SessionIngress.class); - Assertions.assertEquals(834158684, model.targetPort()); + SessionIngress model = BinaryData.fromString("{\"targetPort\":1506978127}").toObject(SessionIngress.class); + Assertions.assertEquals(1506978127, model.targetPort()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SessionIngress model = new SessionIngress().withTargetPort(834158684); + SessionIngress model = new SessionIngress().withTargetPort(1506978127); model = BinaryData.fromObject(model).toObject(SessionIngress.class); - Assertions.assertEquals(834158684, model.targetPort()); + Assertions.assertEquals(1506978127, model.targetPort()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionNetworkConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionNetworkConfigurationTests.java index 2cb5ce525aa7..25fdcafdb288 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionNetworkConfigurationTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionNetworkConfigurationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionPoolSecretTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionPoolSecretTests.java index 0d6b18067dd1..cb7ee4763a32 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionPoolSecretTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionPoolSecretTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,17 +11,17 @@ public final class SessionPoolSecretTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SessionPoolSecret model = BinaryData.fromString("{\"name\":\"ogtu\",\"value\":\"ffdjktsysidfvclg\"}") + SessionPoolSecret model = BinaryData.fromString("{\"name\":\"zrvqdr\",\"value\":\"hjybigehoqfbo\"}") .toObject(SessionPoolSecret.class); - Assertions.assertEquals("ogtu", model.name()); - Assertions.assertEquals("ffdjktsysidfvclg", model.value()); + Assertions.assertEquals("zrvqdr", model.name()); + Assertions.assertEquals("hjybigehoqfbo", model.value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SessionPoolSecret model = new SessionPoolSecret().withName("ogtu").withValue("ffdjktsysidfvclg"); + SessionPoolSecret model = new SessionPoolSecret().withName("zrvqdr").withValue("hjybigehoqfbo"); model = BinaryData.fromObject(model).toObject(SessionPoolSecret.class); - Assertions.assertEquals("ogtu", model.name()); - Assertions.assertEquals("ffdjktsysidfvclg", model.value()); + Assertions.assertEquals("zrvqdr", model.name()); + Assertions.assertEquals("hjybigehoqfbo", model.value()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionProbeHttpGetHttpHeadersItemTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionProbeHttpGetHttpHeadersItemTests.java new file mode 100644 index 000000000000..d89d42192de3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionProbeHttpGetHttpHeadersItemTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.SessionProbeHttpGetHttpHeadersItem; +import org.junit.jupiter.api.Assertions; + +public final class SessionProbeHttpGetHttpHeadersItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SessionProbeHttpGetHttpHeadersItem model + = BinaryData.fromString("{\"name\":\"yggdtjixh\",\"value\":\"kuofqweykhme\"}") + .toObject(SessionProbeHttpGetHttpHeadersItem.class); + Assertions.assertEquals("yggdtjixh", model.name()); + Assertions.assertEquals("kuofqweykhme", model.value()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SessionProbeHttpGetHttpHeadersItem model + = new SessionProbeHttpGetHttpHeadersItem().withName("yggdtjixh").withValue("kuofqweykhme"); + model = BinaryData.fromObject(model).toObject(SessionProbeHttpGetHttpHeadersItem.class); + Assertions.assertEquals("yggdtjixh", model.name()); + Assertions.assertEquals("kuofqweykhme", model.value()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionProbeHttpGetTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionProbeHttpGetTests.java new file mode 100644 index 000000000000..5649160466f6 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionProbeHttpGetTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.Scheme; +import com.azure.resourcemanager.appcontainers.models.SessionProbeHttpGet; +import com.azure.resourcemanager.appcontainers.models.SessionProbeHttpGetHttpHeadersItem; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class SessionProbeHttpGetTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SessionProbeHttpGet model = BinaryData.fromString( + "{\"host\":\"dehxnltyfsoppu\",\"httpHeaders\":[{\"name\":\"snzwd\",\"value\":\"jbavorxzdm\"},{\"name\":\"hctbqvudwxdn\",\"value\":\"nvowgujju\"}],\"path\":\"dkcglhsl\",\"port\":525193865,\"scheme\":\"HTTPS\"}") + .toObject(SessionProbeHttpGet.class); + Assertions.assertEquals("dehxnltyfsoppu", model.host()); + Assertions.assertEquals("snzwd", model.httpHeaders().get(0).name()); + Assertions.assertEquals("jbavorxzdm", model.httpHeaders().get(0).value()); + Assertions.assertEquals("dkcglhsl", model.path()); + Assertions.assertEquals(525193865, model.port()); + Assertions.assertEquals(Scheme.HTTPS, model.scheme()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SessionProbeHttpGet model = new SessionProbeHttpGet().withHost("dehxnltyfsoppu") + .withHttpHeaders( + Arrays.asList(new SessionProbeHttpGetHttpHeadersItem().withName("snzwd").withValue("jbavorxzdm"), + new SessionProbeHttpGetHttpHeadersItem().withName("hctbqvudwxdn").withValue("nvowgujju"))) + .withPath("dkcglhsl") + .withPort(525193865) + .withScheme(Scheme.HTTPS); + model = BinaryData.fromObject(model).toObject(SessionProbeHttpGet.class); + Assertions.assertEquals("dehxnltyfsoppu", model.host()); + Assertions.assertEquals("snzwd", model.httpHeaders().get(0).name()); + Assertions.assertEquals("jbavorxzdm", model.httpHeaders().get(0).value()); + Assertions.assertEquals("dkcglhsl", model.path()); + Assertions.assertEquals(525193865, model.port()); + Assertions.assertEquals(Scheme.HTTPS, model.scheme()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionProbeTcpSocketTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionProbeTcpSocketTests.java new file mode 100644 index 000000000000..61f336114b4c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionProbeTcpSocketTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.SessionProbeTcpSocket; +import org.junit.jupiter.api.Assertions; + +public final class SessionProbeTcpSocketTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SessionProbeTcpSocket model + = BinaryData.fromString("{\"host\":\"vfyexfw\",\"port\":1089614022}").toObject(SessionProbeTcpSocket.class); + Assertions.assertEquals("vfyexfw", model.host()); + Assertions.assertEquals(1089614022, model.port()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SessionProbeTcpSocket model = new SessionProbeTcpSocket().withHost("vfyexfw").withPort(1089614022); + model = BinaryData.fromObject(model).toObject(SessionProbeTcpSocket.class); + Assertions.assertEquals("vfyexfw", model.host()); + Assertions.assertEquals(1089614022, model.port()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionProbeTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionProbeTests.java new file mode 100644 index 000000000000..82b05c8f97cc --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SessionProbeTests.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.Scheme; +import com.azure.resourcemanager.appcontainers.models.SessionProbe; +import com.azure.resourcemanager.appcontainers.models.SessionProbeHttpGet; +import com.azure.resourcemanager.appcontainers.models.SessionProbeHttpGetHttpHeadersItem; +import com.azure.resourcemanager.appcontainers.models.SessionProbeTcpSocket; +import com.azure.resourcemanager.appcontainers.models.SessionProbeType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class SessionProbeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SessionProbe model = BinaryData.fromString( + "{\"type\":\"Liveness\",\"httpGet\":{\"host\":\"zj\",\"httpHeaders\":[{\"name\":\"e\",\"value\":\"ualhbxxhejj\"}],\"path\":\"v\",\"port\":514021855,\"scheme\":\"HTTPS\"},\"tcpSocket\":{\"host\":\"slfhotwm\",\"port\":1771103105},\"failureThreshold\":1913635803,\"initialDelaySeconds\":1733107709,\"periodSeconds\":991937495,\"successThreshold\":1848552059,\"terminationGracePeriodSeconds\":5090457672554637609,\"timeoutSeconds\":1625524147}") + .toObject(SessionProbe.class); + Assertions.assertEquals(SessionProbeType.LIVENESS, model.type()); + Assertions.assertEquals("zj", model.httpGet().host()); + Assertions.assertEquals("e", model.httpGet().httpHeaders().get(0).name()); + Assertions.assertEquals("ualhbxxhejj", model.httpGet().httpHeaders().get(0).value()); + Assertions.assertEquals("v", model.httpGet().path()); + Assertions.assertEquals(514021855, model.httpGet().port()); + Assertions.assertEquals(Scheme.HTTPS, model.httpGet().scheme()); + Assertions.assertEquals("slfhotwm", model.tcpSocket().host()); + Assertions.assertEquals(1771103105, model.tcpSocket().port()); + Assertions.assertEquals(1913635803, model.failureThreshold()); + Assertions.assertEquals(1733107709, model.initialDelaySeconds()); + Assertions.assertEquals(991937495, model.periodSeconds()); + Assertions.assertEquals(1848552059, model.successThreshold()); + Assertions.assertEquals(5090457672554637609L, model.terminationGracePeriodSeconds()); + Assertions.assertEquals(1625524147, model.timeoutSeconds()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SessionProbe model = new SessionProbe().withType(SessionProbeType.LIVENESS) + .withHttpGet(new SessionProbeHttpGet().withHost("zj") + .withHttpHeaders( + Arrays.asList(new SessionProbeHttpGetHttpHeadersItem().withName("e").withValue("ualhbxxhejj"))) + .withPath("v") + .withPort(514021855) + .withScheme(Scheme.HTTPS)) + .withTcpSocket(new SessionProbeTcpSocket().withHost("slfhotwm").withPort(1771103105)) + .withFailureThreshold(1913635803) + .withInitialDelaySeconds(1733107709) + .withPeriodSeconds(991937495) + .withSuccessThreshold(1848552059) + .withTerminationGracePeriodSeconds(5090457672554637609L) + .withTimeoutSeconds(1625524147); + model = BinaryData.fromObject(model).toObject(SessionProbe.class); + Assertions.assertEquals(SessionProbeType.LIVENESS, model.type()); + Assertions.assertEquals("zj", model.httpGet().host()); + Assertions.assertEquals("e", model.httpGet().httpHeaders().get(0).name()); + Assertions.assertEquals("ualhbxxhejj", model.httpGet().httpHeaders().get(0).value()); + Assertions.assertEquals("v", model.httpGet().path()); + Assertions.assertEquals(514021855, model.httpGet().port()); + Assertions.assertEquals(Scheme.HTTPS, model.httpGet().scheme()); + Assertions.assertEquals("slfhotwm", model.tcpSocket().host()); + Assertions.assertEquals(1771103105, model.tcpSocket().port()); + Assertions.assertEquals(1913635803, model.failureThreshold()); + Assertions.assertEquals(1733107709, model.initialDelaySeconds()); + Assertions.assertEquals(991937495, model.periodSeconds()); + Assertions.assertEquals(1848552059, model.successThreshold()); + Assertions.assertEquals(5090457672554637609L, model.terminationGracePeriodSeconds()); + Assertions.assertEquals(1625524147, model.timeoutSeconds()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SpringBootAdminComponentTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SpringBootAdminComponentTests.java index c61957feaef5..cdb3fb187187 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SpringBootAdminComponentTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SpringBootAdminComponentTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -17,34 +17,32 @@ public final class SpringBootAdminComponentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SpringBootAdminComponent model = BinaryData.fromString( - "{\"componentType\":\"SpringBootAdmin\",\"ingress\":{\"fqdn\":\"yzlwh\"},\"provisioningState\":\"InProgress\",\"configurations\":[{\"propertyName\":\"oclu\",\"value\":\"pqmem\"},{\"propertyName\":\"jk\",\"value\":\"ykyujxsg\"}],\"scale\":{\"minReplicas\":317592065,\"maxReplicas\":709948754},\"serviceBinds\":[{\"name\":\"ylmbkzudni\",\"serviceId\":\"fihotj\"},{\"name\":\"lpxuzzjgnrefq\",\"serviceId\":\"qotoihiqakydiwfb\"},{\"name\":\"wpzdqtvhcspo\",\"serviceId\":\"qaxsipietgbebjf\"}]}") + "{\"componentType\":\"SpringBootAdmin\",\"ingress\":{\"fqdn\":\"jb\"},\"provisioningState\":\"Canceled\",\"configurations\":[{\"propertyName\":\"vvib\",\"value\":\"jj\"},{\"propertyName\":\"oqbeitpkxzt\",\"value\":\"ob\"}],\"scale\":{\"minReplicas\":2060626839,\"maxReplicas\":2138880865},\"serviceBinds\":[{\"name\":\"wqmpimaqxzhemjyh\",\"serviceId\":\"uj\"}]}") .toObject(SpringBootAdminComponent.class); - Assertions.assertEquals("oclu", model.configurations().get(0).propertyName()); - Assertions.assertEquals("pqmem", model.configurations().get(0).value()); - Assertions.assertEquals(317592065, model.scale().minReplicas()); - Assertions.assertEquals(709948754, model.scale().maxReplicas()); - Assertions.assertEquals("ylmbkzudni", model.serviceBinds().get(0).name()); - Assertions.assertEquals("fihotj", model.serviceBinds().get(0).serviceId()); + Assertions.assertEquals("vvib", model.configurations().get(0).propertyName()); + Assertions.assertEquals("jj", model.configurations().get(0).value()); + Assertions.assertEquals(2060626839, model.scale().minReplicas()); + Assertions.assertEquals(2138880865, model.scale().maxReplicas()); + Assertions.assertEquals("wqmpimaqxzhemjyh", model.serviceBinds().get(0).name()); + Assertions.assertEquals("uj", model.serviceBinds().get(0).serviceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SpringBootAdminComponent model = new SpringBootAdminComponent() .withConfigurations( - Arrays.asList(new JavaComponentConfigurationProperty().withPropertyName("oclu").withValue("pqmem"), - new JavaComponentConfigurationProperty().withPropertyName("jk").withValue("ykyujxsg"))) - .withScale(new JavaComponentPropertiesScale().withMinReplicas(317592065).withMaxReplicas(709948754)) + Arrays.asList(new JavaComponentConfigurationProperty().withPropertyName("vvib").withValue("jj"), + new JavaComponentConfigurationProperty().withPropertyName("oqbeitpkxzt").withValue("ob"))) + .withScale(new JavaComponentPropertiesScale().withMinReplicas(2060626839).withMaxReplicas(2138880865)) .withServiceBinds( - Arrays.asList(new JavaComponentServiceBind().withName("ylmbkzudni").withServiceId("fihotj"), - new JavaComponentServiceBind().withName("lpxuzzjgnrefq").withServiceId("qotoihiqakydiwfb"), - new JavaComponentServiceBind().withName("wpzdqtvhcspo").withServiceId("qaxsipietgbebjf"))) + Arrays.asList(new JavaComponentServiceBind().withName("wqmpimaqxzhemjyh").withServiceId("uj"))) .withIngress(new JavaComponentIngress()); model = BinaryData.fromObject(model).toObject(SpringBootAdminComponent.class); - Assertions.assertEquals("oclu", model.configurations().get(0).propertyName()); - Assertions.assertEquals("pqmem", model.configurations().get(0).value()); - Assertions.assertEquals(317592065, model.scale().minReplicas()); - Assertions.assertEquals(709948754, model.scale().maxReplicas()); - Assertions.assertEquals("ylmbkzudni", model.serviceBinds().get(0).name()); - Assertions.assertEquals("fihotj", model.serviceBinds().get(0).serviceId()); + Assertions.assertEquals("vvib", model.configurations().get(0).propertyName()); + Assertions.assertEquals("jj", model.configurations().get(0).value()); + Assertions.assertEquals(2060626839, model.scale().minReplicas()); + Assertions.assertEquals(2138880865, model.scale().maxReplicas()); + Assertions.assertEquals("wqmpimaqxzhemjyh", model.serviceBinds().get(0).name()); + Assertions.assertEquals("uj", model.serviceBinds().get(0).serviceId()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SpringCloudConfigComponentTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SpringCloudConfigComponentTests.java index de4acbfe378a..98a9c3a40be2 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SpringCloudConfigComponentTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SpringCloudConfigComponentTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -16,34 +16,35 @@ public final class SpringCloudConfigComponentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SpringCloudConfigComponent model = BinaryData.fromString( - "{\"componentType\":\"SpringCloudConfig\",\"provisioningState\":\"Failed\",\"configurations\":[{\"propertyName\":\"jucejikzoeovvtz\",\"value\":\"et\"},{\"propertyName\":\"ln\",\"value\":\"k\"},{\"propertyName\":\"uzk\",\"value\":\"qzolxrzvhqjw\"}],\"scale\":{\"minReplicas\":1391722918,\"maxReplicas\":1336310341},\"serviceBinds\":[{\"name\":\"c\",\"serviceId\":\"kolawjmjsmwrokc\"},{\"name\":\"fzzzwyjafitlhg\",\"serviceId\":\"nuchlgmltxdwhmo\"},{\"name\":\"sgzv\",\"serviceId\":\"snnjzfpafolpym\"}]}") + "{\"componentType\":\"SpringCloudConfig\",\"provisioningState\":\"Failed\",\"configurations\":[{\"propertyName\":\"ivmmghfcfiwrxgk\",\"value\":\"uvyinzqodfvpgs\"},{\"propertyName\":\"xgsg\",\"value\":\"fgzdjtxvz\"}],\"scale\":{\"minReplicas\":195967567,\"maxReplicas\":1485525619},\"serviceBinds\":[{\"name\":\"lgafcqusrdve\",\"serviceId\":\"wsdtutnwl\"},{\"name\":\"ycvuzhyrmewipmv\",\"serviceId\":\"dxukuqgsjjxundxg\"},{\"name\":\"twzhhzjhfjmhv\",\"serviceId\":\"uvgp\"},{\"name\":\"neqsxvmh\",\"serviceId\":\"uzjyihsasbhudypo\"}]}") .toObject(SpringCloudConfigComponent.class); - Assertions.assertEquals("jucejikzoeovvtz", model.configurations().get(0).propertyName()); - Assertions.assertEquals("et", model.configurations().get(0).value()); - Assertions.assertEquals(1391722918, model.scale().minReplicas()); - Assertions.assertEquals(1336310341, model.scale().maxReplicas()); - Assertions.assertEquals("c", model.serviceBinds().get(0).name()); - Assertions.assertEquals("kolawjmjsmwrokc", model.serviceBinds().get(0).serviceId()); + Assertions.assertEquals("ivmmghfcfiwrxgk", model.configurations().get(0).propertyName()); + Assertions.assertEquals("uvyinzqodfvpgs", model.configurations().get(0).value()); + Assertions.assertEquals(195967567, model.scale().minReplicas()); + Assertions.assertEquals(1485525619, model.scale().maxReplicas()); + Assertions.assertEquals("lgafcqusrdve", model.serviceBinds().get(0).name()); + Assertions.assertEquals("wsdtutnwl", model.serviceBinds().get(0).serviceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SpringCloudConfigComponent model = new SpringCloudConfigComponent() .withConfigurations(Arrays.asList( - new JavaComponentConfigurationProperty().withPropertyName("jucejikzoeovvtz").withValue("et"), - new JavaComponentConfigurationProperty().withPropertyName("ln").withValue("k"), - new JavaComponentConfigurationProperty().withPropertyName("uzk").withValue("qzolxrzvhqjw"))) - .withScale(new JavaComponentPropertiesScale().withMinReplicas(1391722918).withMaxReplicas(1336310341)) + new JavaComponentConfigurationProperty().withPropertyName("ivmmghfcfiwrxgk") + .withValue("uvyinzqodfvpgs"), + new JavaComponentConfigurationProperty().withPropertyName("xgsg").withValue("fgzdjtxvz"))) + .withScale(new JavaComponentPropertiesScale().withMinReplicas(195967567).withMaxReplicas(1485525619)) .withServiceBinds( - Arrays.asList(new JavaComponentServiceBind().withName("c").withServiceId("kolawjmjsmwrokc"), - new JavaComponentServiceBind().withName("fzzzwyjafitlhg").withServiceId("nuchlgmltxdwhmo"), - new JavaComponentServiceBind().withName("sgzv").withServiceId("snnjzfpafolpym"))); + Arrays.asList(new JavaComponentServiceBind().withName("lgafcqusrdve").withServiceId("wsdtutnwl"), + new JavaComponentServiceBind().withName("ycvuzhyrmewipmv").withServiceId("dxukuqgsjjxundxg"), + new JavaComponentServiceBind().withName("twzhhzjhfjmhv").withServiceId("uvgp"), + new JavaComponentServiceBind().withName("neqsxvmh").withServiceId("uzjyihsasbhudypo"))); model = BinaryData.fromObject(model).toObject(SpringCloudConfigComponent.class); - Assertions.assertEquals("jucejikzoeovvtz", model.configurations().get(0).propertyName()); - Assertions.assertEquals("et", model.configurations().get(0).value()); - Assertions.assertEquals(1391722918, model.scale().minReplicas()); - Assertions.assertEquals(1336310341, model.scale().maxReplicas()); - Assertions.assertEquals("c", model.serviceBinds().get(0).name()); - Assertions.assertEquals("kolawjmjsmwrokc", model.serviceBinds().get(0).serviceId()); + Assertions.assertEquals("ivmmghfcfiwrxgk", model.configurations().get(0).propertyName()); + Assertions.assertEquals("uvyinzqodfvpgs", model.configurations().get(0).value()); + Assertions.assertEquals(195967567, model.scale().minReplicas()); + Assertions.assertEquals(1485525619, model.scale().maxReplicas()); + Assertions.assertEquals("lgafcqusrdve", model.serviceBinds().get(0).name()); + Assertions.assertEquals("wsdtutnwl", model.serviceBinds().get(0).serviceId()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SpringCloudEurekaComponentTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SpringCloudEurekaComponentTests.java index 90015118eb53..dc5d2978bcf2 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SpringCloudEurekaComponentTests.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SpringCloudEurekaComponentTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -17,35 +17,38 @@ public final class SpringCloudEurekaComponentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SpringCloudEurekaComponent model = BinaryData.fromString( - "{\"componentType\":\"SpringCloudEureka\",\"ingress\":{\"fqdn\":\"moichdlpnfpubntn\"},\"provisioningState\":\"Deleting\",\"configurations\":[{\"propertyName\":\"qs\",\"value\":\"saaelca\"},{\"propertyName\":\"cjuhplrvkm\",\"value\":\"wmj\"},{\"propertyName\":\"gfggcvkyylizrzbj\",\"value\":\"fxsfuztlvtmv\"},{\"propertyName\":\"bwidql\",\"value\":\"ukoveofi\"}],\"scale\":{\"minReplicas\":635551767,\"maxReplicas\":1356341207},\"serviceBinds\":[{\"name\":\"vlwyzg\",\"serviceId\":\"lkujrllfojui\"}]}") + "{\"componentType\":\"SpringCloudEureka\",\"ingress\":{\"fqdn\":\"zzwc\"},\"provisioningState\":\"Succeeded\",\"configurations\":[{\"propertyName\":\"pfajnjwltlwtjj\",\"value\":\"ktalhsnvkcdmxz\"},{\"propertyName\":\"oaimlnw\",\"value\":\"aomylwea\"},{\"propertyName\":\"lcsethwwnpj\",\"value\":\"fz\"},{\"propertyName\":\"pchwa\",\"value\":\"bousn\"}],\"scale\":{\"minReplicas\":1338045494,\"maxReplicas\":2090278878},\"serviceBinds\":[{\"name\":\"wlyxgncxyk\",\"serviceId\":\"djhlimm\"},{\"name\":\"x\",\"serviceId\":\"bcporxvxcjzhqizx\"},{\"name\":\"xtgqscjavftjuh\",\"serviceId\":\"azkmtgguwp\"}]}") .toObject(SpringCloudEurekaComponent.class); - Assertions.assertEquals("qs", model.configurations().get(0).propertyName()); - Assertions.assertEquals("saaelca", model.configurations().get(0).value()); - Assertions.assertEquals(635551767, model.scale().minReplicas()); - Assertions.assertEquals(1356341207, model.scale().maxReplicas()); - Assertions.assertEquals("vlwyzg", model.serviceBinds().get(0).name()); - Assertions.assertEquals("lkujrllfojui", model.serviceBinds().get(0).serviceId()); + Assertions.assertEquals("pfajnjwltlwtjj", model.configurations().get(0).propertyName()); + Assertions.assertEquals("ktalhsnvkcdmxz", model.configurations().get(0).value()); + Assertions.assertEquals(1338045494, model.scale().minReplicas()); + Assertions.assertEquals(2090278878, model.scale().maxReplicas()); + Assertions.assertEquals("wlyxgncxyk", model.serviceBinds().get(0).name()); + Assertions.assertEquals("djhlimm", model.serviceBinds().get(0).serviceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SpringCloudEurekaComponent model = new SpringCloudEurekaComponent() - .withConfigurations( - Arrays.asList(new JavaComponentConfigurationProperty().withPropertyName("qs").withValue("saaelca"), - new JavaComponentConfigurationProperty().withPropertyName("cjuhplrvkm").withValue("wmj"), - new JavaComponentConfigurationProperty().withPropertyName("gfggcvkyylizrzbj") - .withValue("fxsfuztlvtmv"), - new JavaComponentConfigurationProperty().withPropertyName("bwidql").withValue("ukoveofi"))) - .withScale(new JavaComponentPropertiesScale().withMinReplicas(635551767).withMaxReplicas(1356341207)) - .withServiceBinds( - Arrays.asList(new JavaComponentServiceBind().withName("vlwyzg").withServiceId("lkujrllfojui"))) - .withIngress(new JavaComponentIngress()); + SpringCloudEurekaComponent model + = new SpringCloudEurekaComponent() + .withConfigurations(Arrays.asList( + new JavaComponentConfigurationProperty().withPropertyName("pfajnjwltlwtjj") + .withValue("ktalhsnvkcdmxz"), + new JavaComponentConfigurationProperty().withPropertyName("oaimlnw").withValue("aomylwea"), + new JavaComponentConfigurationProperty().withPropertyName("lcsethwwnpj").withValue("fz"), + new JavaComponentConfigurationProperty().withPropertyName("pchwa").withValue("bousn"))) + .withScale(new JavaComponentPropertiesScale().withMinReplicas(1338045494).withMaxReplicas(2090278878)) + .withServiceBinds( + Arrays.asList(new JavaComponentServiceBind().withName("wlyxgncxyk").withServiceId("djhlimm"), + new JavaComponentServiceBind().withName("x").withServiceId("bcporxvxcjzhqizx"), + new JavaComponentServiceBind().withName("xtgqscjavftjuh").withServiceId("azkmtgguwp"))) + .withIngress(new JavaComponentIngress()); model = BinaryData.fromObject(model).toObject(SpringCloudEurekaComponent.class); - Assertions.assertEquals("qs", model.configurations().get(0).propertyName()); - Assertions.assertEquals("saaelca", model.configurations().get(0).value()); - Assertions.assertEquals(635551767, model.scale().minReplicas()); - Assertions.assertEquals(1356341207, model.scale().maxReplicas()); - Assertions.assertEquals("vlwyzg", model.serviceBinds().get(0).name()); - Assertions.assertEquals("lkujrllfojui", model.serviceBinds().get(0).serviceId()); + Assertions.assertEquals("pfajnjwltlwtjj", model.configurations().get(0).propertyName()); + Assertions.assertEquals("ktalhsnvkcdmxz", model.configurations().get(0).value()); + Assertions.assertEquals(1338045494, model.scale().minReplicas()); + Assertions.assertEquals(2090278878, model.scale().maxReplicas()); + Assertions.assertEquals("wlyxgncxyk", model.serviceBinds().get(0).name()); + Assertions.assertEquals("djhlimm", model.serviceBinds().get(0).serviceId()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/TracesConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/TracesConfigurationTests.java new file mode 100644 index 000000000000..e9f9f81f387e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/TracesConfigurationTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.TracesConfiguration; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class TracesConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TracesConfiguration model + = BinaryData.fromString("{\"includeDapr\":false,\"destinations\":[\"taqutdewem\",\"swvr\",\"unzzjgehk\"]}") + .toObject(TracesConfiguration.class); + Assertions.assertFalse(model.includeDapr()); + Assertions.assertEquals("taqutdewem", model.destinations().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TracesConfiguration model = new TracesConfiguration().withIncludeDapr(false) + .withDestinations(Arrays.asList("taqutdewem", "swvr", "unzzjgehk")); + model = BinaryData.fromObject(model).toObject(TracesConfiguration.class); + Assertions.assertFalse(model.includeDapr()); + Assertions.assertEquals("taqutdewem", model.destinations().get(0)); + } +} 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 index 040c8c7cbbcb..11524837c761 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,24 +12,24 @@ public final class TrafficWeightTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TrafficWeight model = BinaryData.fromString( - "{\"revisionName\":\"kelnsmvbxwyjsf\",\"weight\":23472999,\"latestRevision\":false,\"label\":\"lnjixisxya\"}") + "{\"revisionName\":\"napkteoellw\",\"weight\":1750481006,\"latestRevision\":false,\"label\":\"pfqbuaceopzf\"}") .toObject(TrafficWeight.class); - Assertions.assertEquals("kelnsmvbxwyjsf", model.revisionName()); - Assertions.assertEquals(23472999, model.weight()); + Assertions.assertEquals("napkteoellw", model.revisionName()); + Assertions.assertEquals(1750481006, model.weight()); Assertions.assertFalse(model.latestRevision()); - Assertions.assertEquals("lnjixisxya", model.label()); + Assertions.assertEquals("pfqbuaceopzf", model.label()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TrafficWeight model = new TrafficWeight().withRevisionName("kelnsmvbxwyjsf") - .withWeight(23472999) + TrafficWeight model = new TrafficWeight().withRevisionName("napkteoellw") + .withWeight(1750481006) .withLatestRevision(false) - .withLabel("lnjixisxya"); + .withLabel("pfqbuaceopzf"); model = BinaryData.fromObject(model).toObject(TrafficWeight.class); - Assertions.assertEquals("kelnsmvbxwyjsf", model.revisionName()); - Assertions.assertEquals(23472999, model.weight()); + Assertions.assertEquals("napkteoellw", model.revisionName()); + Assertions.assertEquals(1750481006, model.weight()); Assertions.assertFalse(model.latestRevision()); - Assertions.assertEquals("lnjixisxya", model.label()); + Assertions.assertEquals("pfqbuaceopzf", 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 index 9a0cc4877e34..9a750482c5f6 100644 --- 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 @@ -1,35 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\":24.528646,\"limit\":6.7995667,\"name\":{\"value\":\"mkrsrrmoucsofl\",\"localizedValue\":\"uviyfcaabeo\"}}") + "{\"currentValue\":25.181437,\"limit\":20.31349,\"name\":{\"value\":\"csyhzlwxaeaov\",\"localizedValue\":\"exdnd\"}}") .toObject(UsageInner.class); - Assertions.assertEquals(24.528646f, model.currentValue()); - Assertions.assertEquals(6.7995667f, model.limit()); - Assertions.assertEquals("mkrsrrmoucsofl", model.name().value()); - Assertions.assertEquals("uviyfcaabeo", model.name().localizedValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UsageInner model = new UsageInner().withCurrentValue(24.528646f) - .withLimit(6.7995667f) - .withName(new UsageName().withValue("mkrsrrmoucsofl").withLocalizedValue("uviyfcaabeo")); - model = BinaryData.fromObject(model).toObject(UsageInner.class); - Assertions.assertEquals(24.528646f, model.currentValue()); - Assertions.assertEquals(6.7995667f, model.limit()); - Assertions.assertEquals("mkrsrrmoucsofl", model.name().value()); - Assertions.assertEquals("uviyfcaabeo", model.name().localizedValue()); + Assertions.assertEquals(25.181437f, model.currentValue()); + Assertions.assertEquals(20.31349f, model.limit()); + Assertions.assertEquals("csyhzlwxaeaov", model.name().value()); + Assertions.assertEquals("exdnd", 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 index 21a89567c717..16ac88332ade 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,17 +11,9 @@ public final class UsageNameTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UsageName model - = BinaryData.fromString("{\"value\":\"bh\",\"localizedValue\":\"bmxuqib\"}").toObject(UsageName.class); - Assertions.assertEquals("bh", model.value()); - Assertions.assertEquals("bmxuqib", model.localizedValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UsageName model = new UsageName().withValue("bh").withLocalizedValue("bmxuqib"); - model = BinaryData.fromObject(model).toObject(UsageName.class); - Assertions.assertEquals("bh", model.value()); - Assertions.assertEquals("bmxuqib", model.localizedValue()); + UsageName model = BinaryData.fromString("{\"value\":\"dwead\",\"localizedValue\":\"zmwntopagt\"}") + .toObject(UsageName.class); + Assertions.assertEquals("dwead", model.value()); + Assertions.assertEquals("zmwntopagt", 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 index e241d1d17c38..01b6a4a21158 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -22,7 +22,7 @@ public final class UsagesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"currentValue\":17.243671,\"limit\":33.253513,\"name\":{\"value\":\"lfa\",\"localizedValue\":\"occqrqxw\"}}]}"; + = "{\"value\":[{\"currentValue\":76.90058,\"limit\":92.80392,\"name\":{\"value\":\"slavxjfiuof\",\"localizedValue\":\"eidzlvssqywjopa\"}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,11 +31,11 @@ public void testList() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.usages().list("itbfjtdy", com.azure.core.util.Context.NONE); + PagedIterable response = manager.usages().list("xrkgjn", com.azure.core.util.Context.NONE); - Assertions.assertEquals(17.243671f, response.iterator().next().currentValue()); - Assertions.assertEquals(33.253513f, response.iterator().next().limit()); - Assertions.assertEquals("lfa", response.iterator().next().name().value()); - Assertions.assertEquals("occqrqxw", response.iterator().next().name().localizedValue()); + Assertions.assertEquals(76.90058f, response.iterator().next().currentValue()); + Assertions.assertEquals(92.80392f, response.iterator().next().limit()); + Assertions.assertEquals("slavxjfiuof", response.iterator().next().name().value()); + Assertions.assertEquals("eidzlvssqywjopa", 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 index 65a40926ee6d..37a8ceae42fd 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -10,8 +10,7 @@ public final class UserAssignedIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UserAssignedIdentity model = BinaryData.fromString( - "{\"principalId\":\"a83832b3-e489-41b5-92e0-dae94f6a50ce\",\"clientId\":\"1deb6730-5f9a-45cc-b961-2245c8e725b2\"}") + UserAssignedIdentity model = BinaryData.fromString("{\"principalId\":\"hvmdajvnysounq\",\"clientId\":\"a\"}") .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 index 6ba40469a646..800f83d7870d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,27 +12,27 @@ public final class VnetConfigurationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { VnetConfiguration model = BinaryData.fromString( - "{\"internal\":true,\"infrastructureSubnetId\":\"cxgkmoyxcdyui\",\"dockerBridgeCidr\":\"mfdn\",\"platformReservedCidr\":\"ydvfvfcjnae\",\"platformReservedDnsIP\":\"srvhmgorffuki\"}") + "{\"internal\":false,\"infrastructureSubnetId\":\"ylnio\",\"dockerBridgeCidr\":\"zgb\",\"platformReservedCidr\":\"edm\",\"platformReservedDnsIP\":\"kvnlvxbcuiiznkt\"}") .toObject(VnetConfiguration.class); - Assertions.assertTrue(model.internal()); - Assertions.assertEquals("cxgkmoyxcdyui", model.infrastructureSubnetId()); - Assertions.assertEquals("mfdn", model.dockerBridgeCidr()); - Assertions.assertEquals("ydvfvfcjnae", model.platformReservedCidr()); - Assertions.assertEquals("srvhmgorffuki", model.platformReservedDnsIp()); + Assertions.assertFalse(model.internal()); + Assertions.assertEquals("ylnio", model.infrastructureSubnetId()); + Assertions.assertEquals("zgb", model.dockerBridgeCidr()); + Assertions.assertEquals("edm", model.platformReservedCidr()); + Assertions.assertEquals("kvnlvxbcuiiznkt", model.platformReservedDnsIp()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - VnetConfiguration model = new VnetConfiguration().withInternal(true) - .withInfrastructureSubnetId("cxgkmoyxcdyui") - .withDockerBridgeCidr("mfdn") - .withPlatformReservedCidr("ydvfvfcjnae") - .withPlatformReservedDnsIp("srvhmgorffuki"); + VnetConfiguration model = new VnetConfiguration().withInternal(false) + .withInfrastructureSubnetId("ylnio") + .withDockerBridgeCidr("zgb") + .withPlatformReservedCidr("edm") + .withPlatformReservedDnsIp("kvnlvxbcuiiznkt"); model = BinaryData.fromObject(model).toObject(VnetConfiguration.class); - Assertions.assertTrue(model.internal()); - Assertions.assertEquals("cxgkmoyxcdyui", model.infrastructureSubnetId()); - Assertions.assertEquals("mfdn", model.dockerBridgeCidr()); - Assertions.assertEquals("ydvfvfcjnae", model.platformReservedCidr()); - Assertions.assertEquals("srvhmgorffuki", model.platformReservedDnsIp()); + Assertions.assertFalse(model.internal()); + Assertions.assertEquals("ylnio", model.infrastructureSubnetId()); + Assertions.assertEquals("zgb", model.dockerBridgeCidr()); + Assertions.assertEquals("edm", model.platformReservedCidr()); + Assertions.assertEquals("kvnlvxbcuiiznkt", model.platformReservedDnsIp()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionInnerTests.java new file mode 100644 index 000000000000..991f68ad3d8b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionInnerTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.fluent.models.VnetConnectionInner; +import com.azure.resourcemanager.appcontainers.models.VnetConnectionProperties; +import org.junit.jupiter.api.Assertions; + +public final class VnetConnectionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VnetConnectionInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Deleting\",\"subnetId\":\"a\"},\"id\":\"gvtqagnbuynh\",\"name\":\"jggmebfsiarbu\",\"type\":\"rcvpnazzmhjrunmp\"}") + .toObject(VnetConnectionInner.class); + Assertions.assertEquals("a", model.properties().subnetId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VnetConnectionInner model + = new VnetConnectionInner().withProperties(new VnetConnectionProperties().withSubnetId("a")); + model = BinaryData.fromObject(model).toObject(VnetConnectionInner.class); + Assertions.assertEquals("a", model.properties().subnetId()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionListResultTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionListResultTests.java new file mode 100644 index 000000000000..57aeefd73a92 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionListResultTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.implementation.models.VnetConnectionListResult; +import org.junit.jupiter.api.Assertions; + +public final class VnetConnectionListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VnetConnectionListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"subnetId\":\"kx\"},\"id\":\"skpbhenbtkcxywn\",\"name\":\"tnrsyn\",\"type\":\"qidybyx\"},{\"properties\":{\"provisioningState\":\"InProgress\",\"subnetId\":\"haaxdbabphl\"},\"id\":\"qlfktsths\",\"name\":\"cocmnyyaztt\",\"type\":\"twwrqp\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"subnetId\":\"zywbiex\"},\"id\":\"eyueaxibxujwb\",\"name\":\"qwalmuzyoxaepd\",\"type\":\"zjancuxr\"},{\"properties\":{\"provisioningState\":\"Updating\",\"subnetId\":\"v\"},\"id\":\"niwdjsw\",\"name\":\"tsdbpgn\",\"type\":\"ytxhp\"}],\"nextLink\":\"bzpfzab\"}") + .toObject(VnetConnectionListResult.class); + Assertions.assertEquals("kx", model.value().get(0).properties().subnetId()); + Assertions.assertEquals("bzpfzab", model.nextLink()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionPropertiesTests.java new file mode 100644 index 000000000000..b026ac8471c9 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionPropertiesTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.appcontainers.models.VnetConnectionProperties; +import org.junit.jupiter.api.Assertions; + +public final class VnetConnectionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VnetConnectionProperties model + = BinaryData.fromString("{\"provisioningState\":\"Deleting\",\"subnetId\":\"bh\"}") + .toObject(VnetConnectionProperties.class); + Assertions.assertEquals("bh", model.subnetId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VnetConnectionProperties model = new VnetConnectionProperties().withSubnetId("bh"); + model = BinaryData.fromObject(model).toObject(VnetConnectionProperties.class); + Assertions.assertEquals("bh", model.subnetId()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionsCreateOrUpdateWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionsCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..461659c811b5 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionsCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.VnetConnection; +import com.azure.resourcemanager.appcontainers.models.VnetConnectionProperties; +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 VnetConnectionsCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"InProgress\",\"subnetId\":\"vkbcknjolgjyyxp\"},\"id\":\"lszerqzevx\",\"name\":\"qe\",\"type\":\"ntxwaljglzob\"}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + VnetConnection response = manager.vnetConnections() + .define("xbyja") + .withExistingSandboxGroup("qba", "qicqchygt") + .withProperties(new VnetConnectionProperties().withSubnetId("dpkxyqvg")) + .create(); + + Assertions.assertEquals("vkbcknjolgjyyxp", response.properties().subnetId()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionsGetWithResponseMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionsGetWithResponseMockTests.java new file mode 100644 index 000000000000..6a788f69cee7 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionsGetWithResponseMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.VnetConnection; +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 VnetConnectionsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Updating\",\"subnetId\":\"soljome\"},\"id\":\"fycnlb\",\"name\":\"gjco\",\"type\":\"kk\"}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + VnetConnection response = manager.vnetConnections() + .getWithResponse("a", "hjym", "cgqtag", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("soljome", response.properties().subnetId()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionsListBySandboxGroupMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionsListBySandboxGroupMockTests.java new file mode 100644 index 000000000000..94f5e3717ac3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConnectionsListBySandboxGroupMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; +import com.azure.resourcemanager.appcontainers.models.VnetConnection; +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 VnetConnectionsListBySandboxGroupMockTests { + @Test + public void testListBySandboxGroup() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"subnetId\":\"bvntnrgmqsorhce\"},\"id\":\"gnlykm\",\"name\":\"cpwzv\",\"type\":\"doksqdtiwlwxlbon\"}]}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.vnetConnections().listBySandboxGroup("ji", "ytssikiz", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("bvntnrgmqsorhce", response.iterator().next().properties().subnetId()); + } +} 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 index e2efe8105ed7..72c55262283c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -11,21 +11,20 @@ public final class VolumeMountTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - VolumeMount model = BinaryData - .fromString("{\"volumeName\":\"ndlkzgxhurip\",\"mountPath\":\"podxunkb\",\"subPath\":\"xmubyyntwlrbq\"}") - .toObject(VolumeMount.class); - Assertions.assertEquals("ndlkzgxhurip", model.volumeName()); - Assertions.assertEquals("podxunkb", model.mountPath()); - Assertions.assertEquals("xmubyyntwlrbq", model.subPath()); + VolumeMount model + = BinaryData.fromString("{\"volumeName\":\"ohdneuel\",\"mountPath\":\"hsd\",\"subPath\":\"t\"}") + .toObject(VolumeMount.class); + Assertions.assertEquals("ohdneuel", model.volumeName()); + Assertions.assertEquals("hsd", model.mountPath()); + Assertions.assertEquals("t", model.subPath()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - VolumeMount model - = new VolumeMount().withVolumeName("ndlkzgxhurip").withMountPath("podxunkb").withSubPath("xmubyyntwlrbq"); + VolumeMount model = new VolumeMount().withVolumeName("ohdneuel").withMountPath("hsd").withSubPath("t"); model = BinaryData.fromObject(model).toObject(VolumeMount.class); - Assertions.assertEquals("ndlkzgxhurip", model.volumeName()); - Assertions.assertEquals("podxunkb", model.mountPath()); - Assertions.assertEquals("xmubyyntwlrbq", model.subPath()); + Assertions.assertEquals("ohdneuel", model.volumeName()); + Assertions.assertEquals("hsd", model.mountPath()); + Assertions.assertEquals("t", 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 index ac09af89022b..5b64b54a23be 100644 --- 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 @@ -1,41 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.appcontainers.implementation.models.WorkloadProfileStatesCollection; 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\":1115502807,\"maximumCount\":874789657,\"currentCount\":1233115603},\"id\":\"ljhlnymzotq\",\"name\":\"ryuzcbmqqv\",\"type\":\"mv\"},{\"properties\":{\"minimumCount\":958382528,\"maximumCount\":1895835136,\"currentCount\":414360047},\"id\":\"supe\",\"name\":\"jlzqnhc\",\"type\":\"sqltnzo\"}],\"nextLink\":\"gsxgnxfyqon\"}") + "{\"value\":[{\"properties\":{\"minimumCount\":1850637307,\"maximumCount\":1330760213,\"currentCount\":542903246},\"id\":\"mznnbsoqeqalarvl\",\"name\":\"gunbtgfebwlnbm\",\"type\":\"yreeudz\"},{\"properties\":{\"minimumCount\":341362078,\"maximumCount\":1704124687,\"currentCount\":1319470940},\"id\":\"xlyyzglgou\",\"name\":\"tlmj\",\"type\":\"yuojqtobaxk\"},{\"properties\":{\"minimumCount\":512856445,\"maximumCount\":715108825,\"currentCount\":1073974691},\"id\":\"jkwrusnkq\",\"name\":\"hsyrqunj\",\"type\":\"hdenxaulk\"},{\"properties\":{\"minimumCount\":95985677,\"maximumCount\":1551601241,\"currentCount\":1925588819},\"id\":\"nnawtqabpxuckpgg\",\"name\":\"oweyirdhlis\",\"type\":\"gwflq\"}],\"nextLink\":\"pizruwnpqxpxiw\"}") .toObject(WorkloadProfileStatesCollection.class); - Assertions.assertEquals(1115502807, model.value().get(0).properties().minimumCount()); - Assertions.assertEquals(874789657, model.value().get(0).properties().maximumCount()); - Assertions.assertEquals(1233115603, 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(1115502807) - .withMaximumCount(874789657) - .withCurrentCount(1233115603)), - new WorkloadProfileStatesInner() - .withProperties(new WorkloadProfileStatesProperties().withMinimumCount(958382528) - .withMaximumCount(1895835136) - .withCurrentCount(414360047)))); - model = BinaryData.fromObject(model).toObject(WorkloadProfileStatesCollection.class); - Assertions.assertEquals(1115502807, model.value().get(0).properties().minimumCount()); - Assertions.assertEquals(874789657, model.value().get(0).properties().maximumCount()); - Assertions.assertEquals(1233115603, model.value().get(0).properties().currentCount()); + Assertions.assertEquals(1850637307, model.value().get(0).properties().minimumCount()); + Assertions.assertEquals(1330760213, model.value().get(0).properties().maximumCount()); + Assertions.assertEquals(542903246, model.value().get(0).properties().currentCount()); + Assertions.assertEquals("pizruwnpqxpxiw", model.nextLink()); } } 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 index 17f4afe55a06..5ffb60813704 100644 --- 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 @@ -1,34 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\":520618832,\"maximumCount\":331382347,\"currentCount\":198228895},\"id\":\"dbxiqx\",\"name\":\"iiqbi\",\"type\":\"htmwwinh\"}") + "{\"properties\":{\"minimumCount\":673457619,\"maximumCount\":975807918,\"currentCount\":709772908},\"id\":\"iixtmkzj\",\"name\":\"kv\",\"type\":\"irhgfgrwsdp\"}") .toObject(WorkloadProfileStatesInner.class); - Assertions.assertEquals(520618832, model.properties().minimumCount()); - Assertions.assertEquals(331382347, model.properties().maximumCount()); - Assertions.assertEquals(198228895, model.properties().currentCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadProfileStatesInner model = new WorkloadProfileStatesInner() - .withProperties(new WorkloadProfileStatesProperties().withMinimumCount(520618832) - .withMaximumCount(331382347) - .withCurrentCount(198228895)); - model = BinaryData.fromObject(model).toObject(WorkloadProfileStatesInner.class); - Assertions.assertEquals(520618832, model.properties().minimumCount()); - Assertions.assertEquals(331382347, model.properties().maximumCount()); - Assertions.assertEquals(198228895, model.properties().currentCount()); + Assertions.assertEquals(673457619, model.properties().minimumCount()); + Assertions.assertEquals(975807918, model.properties().maximumCount()); + Assertions.assertEquals(709772908, 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 index e254753c50cb..f315433d2fc2 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,21 +12,10 @@ public final class WorkloadProfileStatesPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WorkloadProfileStatesProperties model = BinaryData - .fromString("{\"minimumCount\":46186363,\"maximumCount\":1588363901,\"currentCount\":1581636189}") + .fromString("{\"minimumCount\":1006538190,\"maximumCount\":145136330,\"currentCount\":399709430}") .toObject(WorkloadProfileStatesProperties.class); - Assertions.assertEquals(46186363, model.minimumCount()); - Assertions.assertEquals(1588363901, model.maximumCount()); - Assertions.assertEquals(1581636189, model.currentCount()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkloadProfileStatesProperties model = new WorkloadProfileStatesProperties().withMinimumCount(46186363) - .withMaximumCount(1588363901) - .withCurrentCount(1581636189); - model = BinaryData.fromObject(model).toObject(WorkloadProfileStatesProperties.class); - Assertions.assertEquals(46186363, model.minimumCount()); - Assertions.assertEquals(1588363901, model.maximumCount()); - Assertions.assertEquals(1581636189, model.currentCount()); + Assertions.assertEquals(1006538190, model.minimumCount()); + Assertions.assertEquals(145136330, model.maximumCount()); + Assertions.assertEquals(399709430, 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 index 3ce66a32e882..f7319562d4e1 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.appcontainers.generated; @@ -12,24 +12,24 @@ public final class WorkloadProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WorkloadProfile model = BinaryData.fromString( - "{\"name\":\"gy\",\"workloadProfileType\":\"wqfbylyrfgiagt\",\"minimumCount\":1621141865,\"maximumCount\":1650535228}") + "{\"name\":\"jizcilnghgs\",\"workloadProfileType\":\"ejjtbxqmul\",\"minimumCount\":1413912286,\"maximumCount\":1164696958}") .toObject(WorkloadProfile.class); - Assertions.assertEquals("gy", model.name()); - Assertions.assertEquals("wqfbylyrfgiagt", model.workloadProfileType()); - Assertions.assertEquals(1621141865, model.minimumCount()); - Assertions.assertEquals(1650535228, model.maximumCount()); + Assertions.assertEquals("jizcilnghgs", model.name()); + Assertions.assertEquals("ejjtbxqmul", model.workloadProfileType()); + Assertions.assertEquals(1413912286, model.minimumCount()); + Assertions.assertEquals(1164696958, model.maximumCount()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WorkloadProfile model = new WorkloadProfile().withName("gy") - .withWorkloadProfileType("wqfbylyrfgiagt") - .withMinimumCount(1621141865) - .withMaximumCount(1650535228); + WorkloadProfile model = new WorkloadProfile().withName("jizcilnghgs") + .withWorkloadProfileType("ejjtbxqmul") + .withMinimumCount(1413912286) + .withMaximumCount(1164696958); model = BinaryData.fromObject(model).toObject(WorkloadProfile.class); - Assertions.assertEquals("gy", model.name()); - Assertions.assertEquals("wqfbylyrfgiagt", model.workloadProfileType()); - Assertions.assertEquals(1621141865, model.minimumCount()); - Assertions.assertEquals(1650535228, model.maximumCount()); + Assertions.assertEquals("jizcilnghgs", model.name()); + Assertions.assertEquals("ejjtbxqmul", model.workloadProfileType()); + Assertions.assertEquals(1413912286, model.minimumCount()); + Assertions.assertEquals(1164696958, model.maximumCount()); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/tsp-location.yaml b/sdk/appcontainers/azure-resourcemanager-appcontainers/tsp-location.yaml new file mode 100644 index 000000000000..c3aa8173dc7e --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/app/resource-manager/Microsoft.App/ContainerApps +commit: e8aafa60c2ab7015e3871549d244df4aa3457fb8 +repo: Azure/azure-rest-api-specs +additionalDirectories: